How can I place articles exactly where I want?
I've been fighting with contao all day today trying to figure this out. Basicly, I have all my HTML/CSS already laid out and want to be able to put articles inside each div without restrictions. To simplify, please take a look at this code.
Code:
<div id="A">
<?php echo $this->A; ?>
</div>
<div id="B">
<?php echo $this->B; ?>
</div>
<div id="C">
<?php echo $this->C; ?>
</div>
<div id="D">
<?php echo $this->D; ?>
</div>
And so on. I tried the custom layout system that contao offers. But let's say I added A, I only have options to place A inside contao's predefined places (headers, before, after, main column, footer), not exactly where I want them.
Is there a way to have this done? Appreciate any help. Thanks
Re: How can I place articles exactly where I want?
Yes it can. I'll edit this post later as I need to lookup the code. But inside the template object (inside the main template) you can find the information you need if you 'print_r" it...
edit: Medianomaly beat me by about an hour, I had the exact same answer...
Re: How can I place articles exactly where I want?
I just happened to have it handy...
Code:
<?php if ($this->sections['Custom Section Name']): ?>
<div id="customSectionID">
<?php echo $this->sections['Custom Section Name']; ?>
</div>
<?php endif; ?>
You just need to sacrifice those predefined areas -- (before, after, main, or footer). Pick any one to assign your custom layout sections to, then REMOVE the code for those sections from the template to prevent things from showing up twice.
Re: How can I place articles exactly where I want?
wow, thank you very much! :D
Ruud - you helped rid a lot of my stress off my shoulder :D knowing Contao is able to do what I want.
Medianomaly - I'll give it a try the first chance I get!