Forums

Multiple page templates e.g. for multilingual site? (2 posts)

  1. DavidWinter101
    Member
    Posted 4 years ago #

    Hello everyone,

    I’d like to (mis)use WordPress as a lightweight CMS for a few non-blogging projects - hope this is not seen as blasphemy. :)

    These projects are basically static web sites. My question is:

    I want to group (single post) pages by giving them a specific layout, ie I need to use multiple templates.

    E.g., I might do a multilingual web site, and I want the English pages to have an English menu and header and the French pages to have a French menu and header.

    What is the best way to achieve this?

    I think an obvious route would be to link categories and templates. So: Is there a way to have (single post) pages belonging to a certain category ("French") use a specific template ("French.php")?

    (I have seen in the docs that I can have category templates - but I understand that means a template for a "TOC" page showing all posts for that category.)

    Another approach that probably goes over the top would be to do browser-sniffing and send a language-based "variation" of the post (i.e., a request for page "support.htm" would bring up "support_EN.htm" or "support_FR" based on the browser’s language preference setting. This would probably be unreliable and may not be possible in WP (or is it?).

    I guess the last resort would be to set up multiple blogs, but that seems overkill when you only want a slight design variation.

    What would you guys suggest?

    Thank you for helping!

  2. moshu
    Member
    Posted 4 years ago #

    1. If your site will be made up mainly of Pages (you mentioned "static") - then categories don't play because Pages don't have categories.
    2. If you go by posts, you can try this plugin: http://guff.szub.net/2005/07/21/post-templates-by-category/
    which allows to have different templates for single posts in a certain category.

Topic Closed

This topic has been closed to new replies.

About this Topic