Page 1 of 1

[solved] cms_selflink tag and multilanguage

Posted: Fri Feb 20, 2009 9:03 am
by andym
Hi,

I have managed to use $mle_translation for breadcrumbs and search tags ok but the cms_selflink tag simply takes through the text and does not resolve the variable.

All I see is $mle_translation.previous_page displayed.

If I drop the quotes I get array.previous_page


{cms_selflink dir="previous" label='$mle_translation.previous_page'}


Any suggestions?

Andy.

Re: cms_selflink tag and multilanguage

Posted: Sun Feb 22, 2009 11:34 am
by andym
I have tried a simple mod to the plugin, but clearly the relevant variables are not defined there.

I put in the following code in place of the current lines:

$Prev_label = $mle_translation.Prev_label; // andym
$Next_label = $mle_translation.Next_label; // andym
$Parent_label = $mle_translation.Parent_label; //uplink andym
And of course in mle lang file:

// Navigation

'Prev_label'=>'Previous page',
'Next_label'=>'Next page',
'Parent_label'=>'Parent page:',

The result is a moan about undefined constant and Next_label is displayed on the screen in the page.

Any clues as to the missing bit of the jigsaw anyone?

A.

Re: cms_selflink tag and multilanguage

Posted: Mon Feb 23, 2009 6:12 pm
by andym
Cracked it!  Found the answer in another topic.

Use this approach in the template and it works just fine:

{capture assign='prev_page'}{$mle_translation.Prev_label}: {/capture}
{capture assign='next_page'}{$mle_translation.Next_label}: {/capture}

            {cms_selflink dir="previous" label="$prev_page"}

            {cms_selflink dir="next" label="$next_page"}

Works a treat.

A.