Hey there, I just played a bit with the new dynamic data PHP Function return values and it seems that there are 2 Scenarios not working:
I want to pass a PHP Variable like so:
{ echo: returnValues($myVariable) }
which results in the following output:
{echo: returnValues($myVariable) }
I want to use dynamic Data inside that function, like so:
{echo: returnValues({post_title}) }
which results in the following output
{echo: returnValues(My Post Title)}
I don’t know if it’s intended to work that way, but it would be cool if those 2 scenarios could also get a look from the devs, maybe it’s just a case they didn’t think of!
tuve el mismo problema con parametros, lo bueno es que la funcion hereda los valores de post asi que puedes invocar al ID y continuar con lo que desees.
saludos
For anyone else stuck on this, what the guy is saying in english for the above post is:
I had the same problem with parameters, the good thing is that the function inherits the values ​​of post so you can call the ID and continue with what you want.
Cheers
This question was never answered. What is the official Bricks team response to whether dynamic data can be passed to an echo tag?
For example, if I have a PHP function “get_taxonomy_title_by_slug” to which I need to pass a URL parameter dynamic data “{url_parameter:cat}”.
Executing “{echo:get_taxonomy_title_by_slug({url_parameter:cat})}” results in “{echo:get_taxonomy_title_by_slug(my-category)}” appearing on the front end. The echo is never executed.
The problem is that one can’t use dynamic data (not sure if it’s all dynamic data or just certain ones) in an echo statement which calls a custom PHP function. My example again, if I have a PHP function “get_taxonomy_title_by_slug” to which I need to pass a URL parameter dynamic data “{url_parameter:cat}”.
Executing “{echo:get_taxonomy_title_by_slug({url_parameter:cat})}” results in “{echo:get_taxonomy_title_by_slug(my-category)}” appearing on the front end (the url parameter is ?cat=my-category). The echo is never executed.
Answer - You can’t put a dynamic tag inside of an echo dynamic tag, no. There may be exceptions, but generally not. You can only use functions that return values, like get_query_var(), not other dynamic tags.
It’s marked as WIP and duplicate for the previous times it’s been asked, so best to assume the answer will be the same - “I reproduced the issue and added it to our bug tracker”. This will be marked as duplicate i expect as it’s all the same thing being reported from what I can tell.