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

How would you put this into a template structure?

 
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
ciqala
Smarty Rookie


Joined: 28 Apr 2003
Posts: 9

PostPosted: Mon Apr 28, 2003 10:55 am    Post subject: How would you put this into a template structure? Reply with quote

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
View user's profile Send private message
boots
Administrator


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

PostPosted: Mon Apr 28, 2003 11:09 am    Post subject: Reply with quote

$smarty->assign('block_tpl', 'article.tpl');

---

{include file=header.tpl}
{include file=$block_tpl}
{include file=copyright.tpl}
Back to top
View user's profile Send private message
ciqala
Smarty Rookie


Joined: 28 Apr 2003
Posts: 9

PostPosted: Mon Apr 28, 2003 12:11 pm    Post subject: Reply with quote

ok i get you... i'll try it out that way.

thanks for your reply. Smile
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