View previous topic :: View next topic |
Author |
Message |
tdm Smarty Rookie
Joined: 01 May 2003 Posts: 18
|
Posted: Thu May 01, 2003 1:26 pm Post subject: Include template file and <IFRAME> ?? |
|
|
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 |
|
eadz Smarty Regular
Joined: 30 Apr 2003 Posts: 61 Location: Auckland, New Zealand
|
Posted: Thu May 01, 2003 1:34 pm Post subject: |
|
|
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 |
|
tdm Smarty Rookie
Joined: 01 May 2003 Posts: 18
|
Posted: Thu May 01, 2003 2:47 pm Post subject: |
|
|
oke, thanks.
I was hopeing to embed it, to bad.. but thanks for the answer |
|
Back to top |
|
JF1980 Smarty Rookie
Joined: 18 May 2003 Posts: 19
|
Posted: Tue May 20, 2003 10:38 pm Post subject: |
|
|
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 |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Tue May 20, 2003 11:04 pm Post subject: |
|
|
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 |
|
JF1980 Smarty Rookie
Joined: 18 May 2003 Posts: 19
|
Posted: Tue May 20, 2003 11:25 pm Post subject: |
|
|
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 |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Tue May 20, 2003 11:33 pm Post subject: |
|
|
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 |
|
JF1980 Smarty Rookie
Joined: 18 May 2003 Posts: 19
|
Posted: Wed May 21, 2003 8:35 am Post subject: |
|
|
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 |
|
JF1980 Smarty Rookie
Joined: 18 May 2003 Posts: 19
|
Posted: Wed May 21, 2003 1:52 pm Post subject: |
|
|
Ok, I found a solution.
HTML layer with the style atributte overflow set to auto |
|
Back to top |
|
|