ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Creating variable catagory description

September 24, 2010 7:10pm

Subscribe [3]
  • #1 / Sep 24, 2010 7:10pm

    xmo1

    45 posts

    Hi,

    I am developing a French and English version of an EE version 1.6.7 website. I’m almost done but for a category page. The category page shows the category description. The category description currently uses an embed tag to embed a template containing English copy.

    I want to have a French description on the French page and an English description on the English page but using a single category description field from the current blog.

    English template:
    http://www.gwennseemel.com/index.php/paintings/from/category/you_bag/

    The French template (currently shows the English copy):
    http://www.gwennseemel.com/index.php/paintings/from-fr/category/you_bag/

    I saw in the user guide that I can check the sections of the URL but don’t know how I would write the PHP. Can I put an {if} statement into the description field of the category to check the page URL and display the appropriate template? If the URL contains “from-fr” then embed the French template and if it says “from” in the URL then embed the English template (see the different URLs above). 

    Does that make sense? If so, how would the if statement look?

    Thank you!

  • #2 / Sep 25, 2010 10:19pm

    Sue Crocker

    26054 posts

    xmo1, John Henry gave a presentation on this last year and has posted his slides online.

    http://www.slideshare.net/vinnyio/multilanguage-websites-in-expressionengine

    See if this helps at all.

  • #3 / Sep 25, 2010 11:24pm

    xmo1

    45 posts

    THANK YOU Sue! Slide 12 of that presentation had the key and all that was missing was the double equal signs.

    Here’s what I used in case anyone else has the same issue:

    {if segment_2 == 'french-template-name' }
    
    This is French. 
    
    {if:else}
    
    This is English. 
    
    {/if}
  • #4 / Sep 27, 2010 3:20am

    John Henry Donovan

    12339 posts

    Glad my slides were of help. Feel free to start a new thread if you have any more questions.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases