[pmwiki-users] Pagelists and multiple (:description:) tags

Hans design5 at softflow.co.uk
Sun Mar 1 04:33:58 CST 2009

Saturday, February 28, 2009, 9:56:41 PM, Olaf Marzocchi wrote:

> Hi everyone,
> I am using pmwiki since 2.1 as CMS, more or less, but only now I started
> trying to use custom templates for pagelists: I don't want to update 
> manually the page indexes anymore...
> I am using currently the "multiplanguage" recipe to allow the writing in
> the same page of different versions of the text, of the keywords and of
> the page description, then chosen automatically depending on the browser
> language.
> It works beautifully, but I found a problem with pagelists. I use the 
> following custom template:

> [[#titlesummary]]
> [[{=$FullName} | {=$Titlespaced}]]
->> {=$Description} ({=$LastModified})

> [[#titlesummaryend]]

> and I always get all the (:description:) fields of each page! For 
> example, I get

> Immagini di lampadine
> Bilder von zwei Glühlampen
> Immagini di due diverse lampadine Pictures of two different light bulbs
> (28/02/2009 ore 21:15 CET)

> The title ("Immagini lampadine") is correctly chosen depending on the 
> current language, but not the description field and not the language of
> the "last modified" field. The latter is, however, not important, I care
> about the description fields.

How does your page switch the view to a particular language?
Do you use a cookie setting for this, perhaps a page variable is set
by a cookie? How are the different description tags made individual?

For instanc ei have been using the Viewmodes recipe for language
switching: http://www.pmwiki.org/wiki/Cookbook/ViewModes

This gives me apart from a (:if view :) conditional also a {$View} page
variable. So with views defined to values of de, en, it, fr for
instance, {$View}  will be rendered as one of those little strings,
and i can use it to define a language (view) specific title or
description or whatever page text variable.

For setting the title I used:

(:title {$:title{$View}} :)

and then set language specific titles with PTVs:

(:titlede: Ein Deutscher Titel:)

(:titleen: An English Title:)


Same goes for (:description {$:description{$View}} :)

Then your pagelist template can stay as you got it, since
 {=$Description} will be rendered as the value from PTV
or you could use  {=$:description{$View}} directly in the template.

Hope this helps a bit!



More information about the pmwiki-users mailing list