Keyword modifiers and %begin_asset


(Armstrongb1) #1

Hi,

I'm trying to ensure that the email address on the alternate context of the site uses a language specific email alias (@caerdydd. in place of @cardiff.) The code below is from the alternate context side of the paint layout.

 

I'm using %begin_asset_metadata_profile.email% to check if the field has been completed then lowercasing the value before replacing the domain in the email address. 

%begin_asset_metadata_profile.email%
  <dt><i class="icon-email" title="Ebost"><span class="hidden-text">Ebost:</span></i></dt>
  <dd><a href="mailto:%asset_metadata_profile.email^lowercase^replace:cardiff:caerdydd%">%asset_metadata_profile.email^lowercase^replace:cardiff:caerdydd%</a></dd>
%end_asset_metadata_profile.email%

The code above appears to work correctly but fails to close the profile.email check as the remainder of the paint layout fails to output meta data from this point onwards in the code.

 

Does anyone have any advice?

Thanks.


(Bart Banda) #2

Not sure if you need the else keyword just before the end keyword, even if you are not printing anything. Have you tried that?

 

Also, what version of Matrix are you using?


(Armstrongb1) #3

Thanks Bart,

It turns out the error was caused by code further down the page and was not the code above which was working correctly.

It is interesting to note however that it doesn't appear possible to use the %begin_asset  to check if an asset has a thumbnail assigned to it. For example %begin_asset_thumbnail% doesn't work but a conditional keyword regular expression keyword does work.


(Bart Banda) #4

Hmm, might be a version issue. I'll see if I can replicate it in a newer version, what version are you using?


(Bart Banda) #5

Just confirmed that being and end keywords on thumbnail works in the latest version of Matrix (5.0.1.0). 


(Armstrongb1) #6

Thanks Bart, that is most useful to know.