Zielun

page_layout variable

Vote 0 Votes

Hi,

I've just installed MT4 and trying to understand how things work.
After I created a test blog and one entry I noticed in index.html Index Template line:

" class="mt-main-index ">

and can't figure out where page_layout variable is set.
Is it some sort of global variable? If so is there any list of that sort of variables?

I'm totally new to MT so please forgive me if I missed something obvious or that part of docs.

Thanks in advance

5 Replies

| Add a Reply
  • Hi,

    You might have already noticed that the class is injected at the template level.

    It includes the first part, which is hard-coded inside each template, and the variable <$mt:Var name="page_layout"$>.

    That variable could be changed if you select a theme from:
    Design -> Styles

    And then choosing one of the layout variations available on that feed.

    Alternatively, you could overwrite the page_layout variable at the template level.

    More details about that variable could be found at:
    http://www.movabletype.org/documentation/designer/creating-themes-for-movable-type.html
    http://www.movabletype.org/documentation/designer/mt4-main-index-default-template-flattened.html

    See how you could use a parameter called "default" to make sure unless a page_layout is chosen a specific default one is used.

    You could also overwrite the page_layout by adding at the top of a template a variable like this:

    <mt:SetVar name="page_layout" value="layout-wtt">

    Kind Regards,
    Mihai Bocsaru

    ----------------------------------
    Daily Movable Type Consultant

    Web Development
    Movable Type Consulting
    Six Apart Partner

    http://www.pro-it-service.com/
    ----------------------------------

    Movable Type Demo
    http://www.movabletypedemo.org/
    ----------------------------------

    Open Melody Demo
    http://www.openmelodydemo.org/

  • Thanks man. All is clear now.

    I notice one more thing which might be confusing regarding Designer's work. Creating new stylesheet Index Template and including it via <MTLink Template="my-style.css"> from styles.css works nice. However when I switch to a different theme my-style.css changes removing my css code. In that point both files look similar meaning that both include blog.css and appropriate theme css file.
    my-style.css overrides style.css so viewing page it looks fine but viewing source and listing css files which are loaded doesn't look that well. Not optimised.

    Additionaly when I create third css file and include it to the second one in the same way I did previously with the my-style.css the theme switching changes second file, not third. In this case reference to third file from second file is erased.

    Is this the way how it was planned to work? Just curious because this behaviour doesn't look consistent. At least at my MT knowledge level :)
    I'm using MT4, no idea about MT5.

    Thanks again for the clarification and help :-)

  • You're welcome!

    If you want to customize your website CSS, I would recommend you to use this plugin:
    http://www.majordojo.com/projects/movable-type/custom-css/

    Rather than changing the stylesheet supplied with MT.

    Why?

    Because unless you keep local backups of the changes you are making to your project stylesheet, you might loose your customization when resetting the project theme.

  • Thanks for the plugin hint :)

  • You're welcome Zielun!

Add a Reply

If you need to share template code, replace all the "<" signs with "&lt;" or use this utility.

Forum Groups

1774 6167

Last Topic: Template modules by Zielun on Feb 16, 2012

86 302

Last Topic: website entries by masoud on Oct 26, 2011

1434 5088

Last Topic: Maintenance announcement by Nick on Feb 17, 2012

695 2912

Last Topic: Insert Image / File Fails by Russ Miller on Feb 10, 2012

84 291

Last Topic: How to have some other characters in entry basename automatically written by Afshin Haghighatnia on Dec 22, 2011

174 740

Last Topic: Captcha images rendering slowly by ScottM on Feb 12, 2012

190 568

Last Topic: Analytics Reporting by michael webster on Feb 5, 2012

48 210

Last Topic: An idea and also a request by Afshin Haghighatnia on Jun 29, 2011

64 246

Last Topic: jQuery in MT 5.1 still at 1.4 - why? by perlmonkey on May 25, 2011

code.sixapart.com

137 478

Last Topic: Getting a thumbnail with xpath by Peter on Mar 13, 2011

222 720

Last Topic: Custom Field for Asset Not Appearing by android on Feb 9, 2012