Results 1 to 4 of 4

Thread: How can I place articles exactly where I want?

  1. #1
    New user
    Join Date
    04-30-11.
    Posts
    24

    Default 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

  2. #2
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default 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...

  3. #3
    Experienced user
    Join Date
    08-21-09.
    Posts
    563

    Default 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.
    Brian

  4. #4
    New user
    Join Date
    04-30-11.
    Posts
    24

    Default 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!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •