How to compare two keyword values?


#1

Matrix Version: v5.3.4.2

Hello there,

I would like to compare the values of %globals_get_var_1% and %asset_metadata_var_2% if they have the same values, I will print some special content for users to view. I tried %globals_get_var_1^contains:asset_metadata_var_2% however, it was not working. Any ideas about this problem? Much appreciated.


(Marcus Fong) #2

You have to use replace_keywords if you need to to nest a keyword replacement within a keyword modifier:

https://matrix.squiz.net/manuals/concepts/appendices/keyword-modifiers#Using-Keyword-Replacements-as-Argument-Values


(Nic Hubbard) #3

I would just use server side JS to compare the values and then print your content if it is true.


#4

I would like to use server side js too if I can, however, our version does not support server side js. The problem is solved nicely by the solution above, much appreciated!


#5

Thanks mate, you save my life! It solved my problem perfectly!