Asset listing Context Type Key Words


(Jonathon Jenkins) #1

Hi,

 

I am setting up an Asset Listing Page showing a list of Standard Pages displaying the asset short name (%asset_short_name%) and the asset name (%asset_name_linked%) to then link to the asset.

 

Each asset has a different Page Name and Short Page Name for each context.

 

The site I am working on is bilingual, English and Welsh, using a default context of each asset in English and then a second context of each asset in Welsh.

 

The problem I have is that the welsh context name and short name for each of the standard page assets only display the English contexts ie, the default and do not display the Welsh when you switch to the Welsh conext. When you click on the link you are however taken to the Welsh context of the body copy for that particular standard page asset.

 

Is there a way of getting the %asset_short_name% and %asset_name_linked% key words to display the correct context instead of the default each time?

 

Many thanks


(Tom Chadwin) #2

Hi Jonathon

 

The manuals page gives a possible direction you might want to look into:

 

http://manuals.matrix.squizsuite.net/contexts/chapters/backend-operations

 

It says you can use keyword modifiers to change contexts:

%asset_attribute_name^context:French%

I don't know whether you can get the current context name as a keyword to use as the modifier, though.

 

Tom


(Tom Chadwin) #3

OK, I think you have to follow the syntax for using a keyword as a modifier argument:

 

http://manuals.matrix.squizsuite.net/keyword-replacements/chapters/keyword-modifiers#Using-Keyword-Replacements-as-Argument-Values

 

That means you'll need something like:

 

%asset_short_name^replace_keywords:context:(globals_context)%

(Untested, and probably buggy.)

 

Tom