|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
ciqala Smarty Rookie
Joined: 28 Apr 2003 Posts: 9
|
Posted: Mon Apr 28, 2003 10:55 am Post subject: How would you put this into a template structure? |
|
|
I have a site that uses a lot of tables for layout as follows
Code: |
<table //main layout>
<tr><td>
{* header *}
<table //header layout>
<tr><td>Logo image - banner image</td></tr>
<tr><td>menu stuff</td></tr>
<table>
{* end header *}
</td></tr>
<tr><td>
{* random features *}
<table //features images>
<tr><td>image linked to article1</td><td>image linked to article2...</td></tr>
</table>
{* end random features *}
</tr></td>
<tr><td>
{* left bar *}
<table //left bar>
<tr><td>some random stuff</td></tr>
<tr><td>more random stuff</td></tr>
</table>
{* end left bar *}
</td>
<td>
{* article *}
<table //article content>
<tr><td>Headline</td></tr>
<tr><td>article text</td></td>
</table>
{* end article *}
</td><tr>
<tr><td>
{* copyright *}
<table //copyright info + footer>
<tr><td>affiliate buttons</td></tr>
<tr><td>copyright text</td></tr>
</table>
{* end copyright *}
</td></tr>
</table>
|
the sections which have been marked in smarty quotes will each be made as an individual template and what i would like to do with the remaining layout code (the html not in smarty quotes) is make it into a standard fixed layout into which i can drop these blocks as i like (so i can interchange features on a page such as the article block which may be replaced by an interview block or similiar).
just curious to see how more experienced users of smarty would go about this.
[/i]
Last edited by ciqala on Wed May 05, 2010 10:41 pm; edited 1 time in total |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Mon Apr 28, 2003 11:09 am Post subject: |
|
|
$smarty->assign('block_tpl', 'article.tpl');
---
{include file=header.tpl}
{include file=$block_tpl}
{include file=copyright.tpl} |
|
Back to top |
|
ciqala Smarty Rookie
Joined: 28 Apr 2003 Posts: 9
|
|
Back to top |
|
|
|
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
|