Stuck using conditional keyword modifiers


(Nick Papadatos) #1

Matrix Version: 5.3.4.2
Soon to be on the latest version

I know I can do the following:

    %begin_asset_metadata_has_fullstory^eq:yes%
    <p class="text-right">
       <a class="btn btn-readmore" href="%asset_url%">read more</a>
    </p>
   %end_asset_metadata_fullstrory%

But how do I use the following correctly or can this not be done i.e nested keywords?

   %asset_metadata_has_fullstory^eq:yes:<p class="text-right"><a class="btn btn-readmore" href="%asset_url%">read more</a></p>%

regards
N


(Peter McLeod) #2

Hi Nicky
Just replace the % with braces for the keyword replacement.
{asset_url}
Thanks
Peter


(Nick Papadatos) #3

Thanks Peter - tried that but it didn’t work
see attached:


(Erwin Strobel) #4

Give this a try

%begin_asset_metadata_has_fullstory^eq:yes%
<p class="text-right"><a class="btn btn-readmore" href="%asset_url%">read more</a></p>
%end_asset%

(Nick Papadatos) #5

Thanks Erwin - That’s a given if you look at my original post :slight_smile: I’m was trying the latter, I’m sure there’s a way to nest keywords but may not be able to with what I’m trying to do


#7

Peter’s suggestion is spot on for newer versions of Matrix, if it’s just displaying as text for you I suspect you’ll need to add an additional modifier, ^replace_keywords into the mix.

Try:

   %asset_metadata_has_fullstory^replace_keywords^eq:yes:<p class="text-right"><a class="btn btn-readmore" href="{asset_url}">read more</a></p>%

(Peter McLeod) #8

yeah good call, just saw Nicky’s version is 5.3… the shorthand version {} came in 5.4.