Ik heb 2 templates, daarin staat oa dit:
default.tpl
block.tpl
Het php bestand wat deze templates moet vullen is start.php (wordt geinclude in content.php):
Ik wil dus 2 blocks achter elkaar krijgen (append) met daarin de inhoud uit block.tpl. Ik wil dit zo doen om de site makkelijk te veranderen (een block toevoegen met menu/poll/recent changes/quote). Heeft iemand trouwens nog andere goede ideeen om een site dynamisch op te bouwen zodat'ie makkelijk te veranderen is? Meer verschillende template bestanden of jusit minder? Op- of aanmerkingen zijn welkom.
Maar ik krijg het maar niet voor elkaar om de 2 blocks na elkaar te parsen. Ik krijg nu 2 blocks met 2x 'submenu' erin.
Wie ziet het probleem?
default.tpl
code:
1
2
3
4
5
6
| (...)
<!-- BEGIN block_left -->
{out_left}
[img]'graphics/site/pixel_transparent.gif'[/img]
<!-- END block_left -->
(...) |
block.tpl
code:
1
2
3
4
5
| <table border='1' cellpadding='10' cellspacing='2' bordercolor='#000000' width='{block_width}'><tr><td valign='top'>
<div class='text'>
{block_content}
</div>
</td></tr></table> |
Het php bestand wat deze templates moet vullen is start.php (wordt geinclude in content.php):
PHP:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
| <? $t = new Template(); $t->set_file(array('page_default' => 'default.tpl', 'page_block' => 'block.tpl')); $t->set_block('page_default', 'block_left', 'bl'); $t->set_block('page_default', 'block_right'); $t->set_block('page_default', 'block_center'); $t->set_block('page_default', 'block_top'); $t->set_var('block_width', '150'); $t->set_var('block_content', 'menu'); $t->parse('bl', 'block_left', true); $t->set_var('block_width', '150'); $t->set_var('block_content', 'submenu'); $t->parse('bl', 'block_left', true); $t->parse('out_left', 'page_block', true); $t->parse('out', 'page_default'); $t->p('out'); ?> |
Ik wil dus 2 blocks achter elkaar krijgen (append) met daarin de inhoud uit block.tpl. Ik wil dit zo doen om de site makkelijk te veranderen (een block toevoegen met menu/poll/recent changes/quote). Heeft iemand trouwens nog andere goede ideeen om een site dynamisch op te bouwen zodat'ie makkelijk te veranderen is? Meer verschillende template bestanden of jusit minder? Op- of aanmerkingen zijn welkom.
Maar ik krijg het maar niet voor elkaar om de 2 blocks na elkaar te parsen. Ik krijg nu 2 blocks met 2x 'submenu' erin.
Wie ziet het probleem?