Language specific parameter in macro? Options
tkahn
Posted: Wednesday, December 05, 2007 11:06:08 AM

Rank: Fanatic

Joined: 11/24/2006
Posts: 323
Location: Stockholm, Sweden
How do I pass a language specific parameter to an Umbraco macro?

The code in my template looks like this:
Code:
<?UMBRACO_MACRO macroAlias="FlashImageRotator" objectID="i_fokus" width="229" height="100" transition="fade" showNavigation="0" overStretch="0" mediaFile="" flashVars="rotatetime=5;file=/sv/banners.aspx"></?UMBRACO_MACRO>


The part I want to make language dependant is file=/sv/banners.aspx. This is the relative URL to the page that generates the Swedish banner playlist (XML). (The page "banners.aspx" uses another XSLT/macro to generate an XML playlist for the Flash Image Rotator. This playlist is different depending on the language version of the site.)

So, when the English version of the site is used, the macro code in the page template should look like this:

Code:
<?UMBRACO_MACRO macroAlias="FlashImageRotator" objectID="i_fokus" width="229" height="100" transition="fade" showNavigation="0" overStretch="0" mediaFile="" flashVars="rotatetime=5;file=/en/banners.aspx"></?UMBRACO_MACRO>


...the only difference being the URL to the page that generates the playlist; file=/en/banners.aspx. This means that the page template should get the English banner playlist.

Sounds complicated, but it really isn't.

Since the parameter "file" is encapsulated in a call to an Umbraco macro, I can't use a dictionary item to add "/sv" or "/en" to the macro call. Is there another way? Remember that the English and Swedish site uses the same page template.

Web Developer at Kärnhuset - http://www.karnhuset.net - Stockholm, Sweden
tim
Posted: Wednesday, December 05, 2007 11:49:36 AM

Rank: Addict

Joined: 2/19/2007
Posts: 819
Location: Belgium
You can define a new dictionary item. And just fetch it in the xslt using an umbraco.library method

Umbraco tips and tricks: http://www.nibble.be - umbraco mvp 08/09 - certified level 1 & 2 professional
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.