Elwood

Switching Templates for Pages

Vote 0 Votes

Hi there,
for some time I started working with Movable Type. I know cms systems for webapplication but no blogging applications. I had a look at wordpress, but I'm a perl developer and so I wnat to use a perl application. I saw that in wordpress I can switch the template for a static page by selecting a template in a selectbox. In movable type I don't find a possibility like this. What is the general way for doing this? Should I build some templates and create a if/else condition in the page template. I think that's a odd way.

Thank you fpr your help.

Elwood

Reported on Movable Type 5

3 Replies

| Add a Reply
  • Hi Elwood,

    It is wise to not create multiple templates for the same page type (i.e. pages in your situation) on movable type, because in case you create multiple ones a page would be created for page based on each template.

    Instead, you could use sticky tags for differentiating the coding under a page archive template.

    A sticky tag is a tag like this:
    @leftcolumn

    Let me give you a sample.

    I would assume that you want to have two variations for the page template. One should contain a left sidebar column, and the other one shouldn't have the footer.

    You would use the following logic:

    <mt:PageIfTagged tag="@leftcolumn">put here the left column coding or include</mt:PageIfTagged>
    <mt:PageIfTagged tag="@nofooter">
    <mt:Ignore>
    This is for those pages were you don't want the footer to be displayed
    </mt:Ignore>
    <mt:Else>
    but put here the footer coding for all the other pages...
    </mt:PageIfTagged>

    Of course, in order for the above to work, you have to tag one or more pages with "@leftcolumn", and one or more pages with "@nofooter" (without the quotes).

    The difference in between a real tag and a sticky tag, is that the sticky tag has the "@" symbol in front of it and is not displayed as a tag associated to the entry inside published pages or tag clouds. It is used only for filtering inside template, as a sort of trick.

    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/

  • Great, thank you for your explanation. I will try this.


    Best regards

    Elwood

  • You're welcome Elwood!

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