Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Include template file and <IFRAME> ??

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
tdm
Smarty Rookie


Joined: 01 May 2003
Posts: 18

PostPosted: Thu May 01, 2003 1:26 pm    Post subject: Include template file and <IFRAME> ?? Reply with quote

I have a template for news messages, and below that I want to have an <IFRAME> with a page showing some pictures from the newsmessage.

How can I get this done with Smarty Templates?

I need the IFRAME because I want that the Picture part of that page works on it's own (so that the whole page doesn't needs to refresh to show other pictures on the page).

Thanks
Back to top
View user's profile Send private message
eadz
Smarty Regular


Joined: 30 Apr 2003
Posts: 61
Location: Auckland, New Zealand

PostPosted: Thu May 01, 2003 1:34 pm    Post subject: Reply with quote

You have to have an <iframe src=pictures.php> tag in your main template, then a seperate php file for your pictures, that shows a pictures.tpl template.

You can not "embed" an Iframe, it requires a seperate page.
Back to top
View user's profile Send private message Visit poster's website
tdm
Smarty Rookie


Joined: 01 May 2003
Posts: 18

PostPosted: Thu May 01, 2003 2:47 pm    Post subject: Reply with quote

oke, thanks.
I was hopeing to embed it, to bad.. but thanks for the answer Smile
Back to top
View user's profile Send private message
JF1980
Smarty Rookie


Joined: 18 May 2003
Posts: 19

PostPosted: Tue May 20, 2003 10:38 pm    Post subject: Reply with quote

Hmm, I have an issue.

I have a main template, in that template I includevarious other templates depending on content.

Now I want to have an iframe, opening a template (section looping), at the moment I am using one template to call the iframe, this is <iframe src="prodlist.tpl"></iframe>, prodlist.tpl is a section loop, but when I try this I just get the html in the iframe with the tags unprocessed.
Back to top
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Tue May 20, 2003 11:04 pm    Post subject: Reply with quote

JF1980:

Step back and think about it--how do you call a templated page right now? Something like... http://yoursite/page.php where "page.php" contains the essential code to start Smarty and display your template. Okay, good.

Now, when you embed an IFRAME and specifiy the SRC attribute (which is a URL that must return a valid HTML document) you should be pointing to a PHP page that will render your prodlist.tpl -- something like "myframe.php".

HTH.
Back to top
View user's profile Send private message
JF1980
Smarty Rookie


Joined: 18 May 2003
Posts: 19

PostPosted: Tue May 20, 2003 11:25 pm    Post subject: Reply with quote

yeah I am, but it doesn't parse the variables. I tried using session variables too but it didn't work.

Is there no way to get an iframe effect without calling an external file? E.g. I have a section look, and I want the output from this loop to be in an embedded scrollbox on the page. So in effect I would like to be able to use <iframe>HTML with section loop here</iframe>. I know this does not work, but you could imagine what im after. A bit like an uneditable text area I suppose, but with HTML in it, not text. Is there a way without I frames?
Back to top
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Tue May 20, 2003 11:33 pm    Post subject: Reply with quote

Quote:
yeah I am, but it doesn't parse the variables. I tried using session variables too but it didn't work.


yeah, you are what? I just described how your code was incorrectly using IFRAME's -- the SRC has to point to an HTML output file (like a PHP file that generates HTML) not the source for a template file.

Perhaps you never meant to use IFRAME's. Do normal DIV's not fit the bill? Or how about using a table? IFRAME's are a very specific feature of HTML with very specific uses. Why did you choose IFRAME to begin with? It SOUNDS like you just need some normal formatting elements, but I'm not sure based on your description so far.

Sorry if I haven't been too much of a help -- I want to give you a more detailed answer, but I really don't have a good idea of what you are trying to do, only the problem code you listed. Try again??
Back to top
View user's profile Send private message
JF1980
Smarty Rookie


Joined: 18 May 2003
Posts: 19

PostPosted: Wed May 21, 2003 8:35 am    Post subject: Reply with quote

You are correct, I do not want an iframe as such, but I want something that will give the apperance of an iframe, e.g I want to have a box/window embeded into the page (like an iframe or text area) into which I can put my section loop. This is so that in my main frame (template, virtual frame, not HTML frames) I can show a list of products, and the user can scroll down the list within the frame, rather than having the whole page expand downwards as would happen with a table. An iframe would be ideal in terms of apperance, just not in operation.
Back to top
View user's profile Send private message
JF1980
Smarty Rookie


Joined: 18 May 2003
Posts: 19

PostPosted: Wed May 21, 2003 1:52 pm    Post subject: Reply with quote

Ok, I found a solution.

HTML layer with the style atributte overflow set to auto Laughing
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP