Oddity in using keyword modifiers


(paul walker) #1

I had a problem which, by chance, I fixed but I do not understand why this happens

In my code
%asset_parents^index:0^as_asset:asset_parent% - returns 632528
And
%globals_asset_name:632528% returns the name of the page (My Page)
However
%globals_asset_name:asset_parents^index:0^as_asset:asset_parent% - does not return the page name
UNLESS - I use

  1. %asset_parents^index:0^as_asset:asset_parent%
  2. %globals_asset_name:%asset_parents^index:0^as_asset:asset_parent%%

I can ‘comment out’ the top line (line 1) and it still works
Is that an expected behaviour that I must use the first line to make the second call work? It almost feels like declaring a variable before it can be used

Anyway - I have my workaround but am curious

Cheers folks - have a good weekend


(Iain Simmons) #2

Hi Paul,

So I’m not able to test right now but I don’t think the following is a valid keyword:

%globals_asset_name:asset_parents^index:0^as_asset:asset_parent%

And the number 2 you had above works because the inner keyword with just the asset prefix resolves first.

In any case, you could try this too:
%asset_parents^index:0^as_asset:asset_parent^as_asset:asset_name%

Let me know how it goes!