iFrames in the albumBody.tpl

juddster

Joined: 2005-01-25
Posts: 23
Posted: Mon, 2005-04-18 12:36

Is it possible to include an i-frame from within the albumBody.tpl? I'm not familiar with Smarty, and so far I'm unable to do this succesfully.

I tried making a call like:
<iframe src="{include file="gallery:layouts/test/templates/iFrame.tpl"}">
but that literally included the template code into the src="" call , which clearly didn't work! Oops....

...so I tried making a call like
<iframe src="layouts/test/templates/iFrame.tpl">
which resulted in the template being displayed *as code* inside the iframe, i.e. the template was no longer acting as a Smarty template.

Basically, I'm trying to include the "view photos" part of albumBody.tpl inside an iframe, so that you can scroll horizontally from right under the photos, instead of having the page expand off the screen.

Thanks in advance for any tips!

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2005-04-18 12:41

AFAIK, you can accomplish the same by defining a size for the html container where the item is in and setting the overflow mode (css) to auto or something like that. this will result in scrollbars when the item is too large for the html container.
so no (i)frames are needed.

 
juddster

Joined: 2005-01-25
Posts: 23
Posted: Mon, 2005-04-18 14:21

sounds even better! not sure how to do that either, but will read up on css...

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2005-04-18 14:29

the difference is an iframe will make a separate http request to show a new document.. overflow: auto or overflow: scroll makes a scrollable area to show part of the current html document.

<div style="width: 600px; height: 400px; overflow: scroll">
 content....
</div>
 
juddster

Joined: 2005-01-25
Posts: 23
Posted: Mon, 2005-04-18 15:15

sweet sweet sweet! I've not been a css-convert until now - Gallery is the first time I've seen it used so extensively, and I can really see the benefits, thanks for both the tip and the enlightenment!