I am having troubles with global variables not parsing when passed as parameters.
{exp:channel:entries
disable="categories|category_fields|member_data|pagination|trackbacks"
dynamic="no"
entry_id="{structure:child_ids_for:21}"
}
(0.012500 / 3.36MB) Tag: {exp:channel:entries disable=”categories|category_fields|member_data|pagination|trackbacks” dynamic=”no” entry_id=”{structure:child_ids_for:21}” }
The same result is produced with and without parse=”inward”
However this works fine and grabs the data I need
{exp:channel:entries
disable="categories|category_fields|member_data|pagination|trackbacks"
dynamic="no"
entry_id="{exp:query sql='SELECT exp_structure.entry_id,
exp_structure.parent_id,
exp_structure.lft
FROM exp_structure
WHERE parent_id = 21
ORDER BY exp_structure.lft ASC'}{entry_id}|{/exp:query}"
parse="inward"
}
But, then if I add in a global variable author_id=”{logged_in_member_id}” it fails to work, if I hard code that value as 1 then it functions.
Any thoughts as to what could be happening here?
I can’t speak for Structure’s global variables, but
{logged_in_member_id}is a late-parsed global variable, meaning you can’t use it in a module tag parameter. I can only only assume that the same goes for the Structure variables.You can use the
CURRENT_USERconstant in theauthor_idparameter though (docs).Unfortunately, the solution for your
{structure:child_ids_for:21}issue is to pass that as an embed variable, and put your Channel Entries loop in an embed. (I say unfortunately because embeds do incur some overhead.)One note:
parse="inward"has no effect on module tag pairs – they always parse inward. It only affects plugin tag pairs.