Search…

X3 Photo Gallery Support Forums

Search…
 
User avatar
Paul Styler
Experienced
Topic Author
Posts: 26
Joined: 21 Feb 2016, 20:34

Gallery sharing as embed

09 Jul 2016, 14:18

Hello everybody !
I think it will be great if X3 will allow to share whole gallery ( album or folder) as embeded.
I know that it is always possible to embed the gallery as iframe, but in this case footer and header will be embede to.
PAUL STYLER PHOTOGRAPHY
The art comes true
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Gallery sharing as embed

10 Jul 2016, 06:53

Paul Styler wrote:I think it will be great if X3 will allow to share whole gallery ( album or folder) as embeded.
I know that it is always possible to embed the gallery as iframe, but in this case footer and header will be embede to.
Since we always wanted to do something like this, let me expand the topic a bit: There are basically THREE ways of "embedding" a gallery, or basically an X3 web page into another web page so to speak:

Iframe
One can already embed any X3 page into an iframe. As you mention, it would by default include the header and footer. We could perhaps circumvent this by removing the header/footer when X3 detects that it is inside an iframe. This would work acceptably.

However, then it would come down to the limitations of iframe: What height would you set the iframe? You can't set an iframe to expand to cover the required scrolling area for all content ... Thus you would need to set a fixed size, and the visitor would just have to scroll within the iframe. Width is also an issue, although normally you could set the iframe to 100% and it should work fine. Furthermore, Im not sure if the popup window would be able to operate within the realms of the parent window. Ultimately, although it will work, it's simply not an elegant solution, and it would be susceptible to the website it is embedded inside. Not really something we would wish to support as an official feature.

Javascript solution
Getting a bit more advanced, we could perhaps create a special embed script that loads an X3 album directly into the page. This way, one has more control of the layout. However, this isn't really X3 ... This would basically be a separate script that loads images into the page from your X3 content, using an X3 add-on. It would use separate style sheets, which would probably be limited as to not interfere with your website CSS. Furthermore, we have no control over how the parent website's CSS may affect the layout and style of embedded images from X3.

So to put it like this, it's not really an embed, but really an entirely separate script ... and even if it was made, as you see, there are complications. It's an interesting idea though.

PHP include
Not quite on topic, as this would require advanced editing of templates from the parent website, and not strictly a html embed. By adding something like <?php $gallery='path'; include 'x3_include.php' ?>, one could include a separate script that would load a gallery into the page. However, like the javascript solution, it would basically be an entirely separate X3 script, and would have the same issues when it comes to CSS/styles. You would also need to embed CSS/javascript into the <head> section of your page template. As you can understand, not a simple solution, and we have little control over how it actually works alongside the unknown website we are including it into.

Realistically, you are left with the iframe solution ... Could be there are some additional tricks so that we could dynamically set the height of the iframe window based on the content inside. I will add it to my list and look into it ...
 
User avatar
Paul Styler
Experienced
Topic Author
Posts: 26
Joined: 21 Feb 2016, 20:34

Re: Gallery sharing as embed

07 Dec 2016, 04:33

Hi !
I found easy work around solution for my issue.
There is few easy steps to do:
1. Add new page ( folder)
2. Exclude this page from site menu ( Menu--> Hide page from menu )
3. Select gallery i want to show ( Gallery-->Gallery Assets -->select from list)
4. Hide header and footer ( Details-->Body Classes--> select no-header, no-footer, no-pad )
5. Add URL of page to Iframe
Code
<iframe src="http://www.paulstyler.com/test/" style="border:none;"></iframe>
PAUL STYLER PHOTOGRAPHY
The art comes true
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Gallery sharing as embed

07 Dec 2016, 05:04

Good solution!