Results 1 to 6 of 6

Thread: Separating Page title from main content template

  1. #1
    User
    Join Date
    12-11-09.
    Location
    New York, NY USA
    Posts
    87

    Default Separating Page title from main content template

    Is it possible to separate the title of a page from the "echo $this->main; " by editing the templates?

    I suppose I may be able to do this by absolute positioning but it would be really helpful If I could just output the page title independent of the main content in my web template.

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

    Default Re: Separating Page title from main content template

    What template are you attempting to edit? (where you see echo $this->main)? If you are editing fe_page.tpl you are most likely looking in the wrong place.

    In most instances, the headline is already separate from the content -- as long as you are editing the correct template. Remember each element of TL has its own template -- so if you are spitting out an article, content element, news items, etc, you need to look at its relevant .tpl file.

    Also, can you explain what you are trying to do -- maybe there is an alternative solution. Just based on your post, I don't understand WHY you are asking to do this...
    Brian

  3. #3
    User
    Join Date
    12-11-09.
    Location
    New York, NY USA
    Posts
    87

    Default Re: Separating Page title from main content template

    Well,

    I'm still a little in the dark with the scope of the .tpl files.

    I have been adapting an older design into TL which is almost complete not posted anyway but the old design is here http://www.abmac.com, there will now be a right column and the front page is changing and I'm adding a blog. Previously I had images for the titles as this was a static website - which I can do here as well but I'm planning on using the image-headline extension to handle my image replacement.

    I need to keep the baseline of the title above the 3 columns, I can use absolute positioning to get the title above the columns but if my headline goes to 2 lines it presents a problem since I can't figure out how to get the 2nd line to push up within the absolute div.

    So I thought if I could separate the page title from the rest of the content, I could just put it in the div above my columns without absolute positioning and it would push down as needed. That's the idea anyway.

    Separately, I am having some issues styling the line-height and letter spacing that I would prefer with the image-headline module but I guess I can live with that.

  4. #4
    User
    Join Date
    10-05-09.
    Location
    Dallas, TX, US
    Posts
    70

    Default Re: Separating Page title from main content template

    I'm a bit confused as well so if I've misinterpreted please excuse me.

    Sounds like you could add a custom section (Settings > Global configuration > Custom layout sections), and make sure that your template has access to it.

    Then create an article for the page, place it in the custom section, and provide it with a headline content element.

  5. #5
    User
    Join Date
    12-11-09.
    Location
    New York, NY USA
    Posts
    87

    Default Re: Separating Page title from main content template

    I didn't know about the custom sections. There are a few thing here that are not clear. If I create a custom section then do I access it like this $this->customheadersection in my template? And do I need to create a .tpl file? If so what would it be named?

    I guess i need to look at the API docs and learn more about .tpl files usage.

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

    Default Re: Separating Page title from main content template

    I concur with Mark.

    There's lots of info on custom sections floating around -- so I would search around a bit.

    If you add a custom section as Mark outlined, then under Page Layout -> Custom Sections Position you choose "After the Page Header", that should be enough to do what you want without coding anything. You do not need to create a .tpl file for it.

    Another way would be to add this in your fe_page.tpl file below your header and above your columns:

    Code:
    <div class="pagetitle">{{env:page_title}}</div>
    Here you are using an insert tag to hard code the title of the current page into your template. (See: http://www.typolight.org/insert-tags.html).
    Brian

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
  •