Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
How to retrive the content of h1 in {asset name="Content"}
Clément
✭
Hello,
I need to extract the title of the h1 in {asset name="Content"} for displayed to another place.
What is the best solution ?
Is it possible to extract with a regular expression ?
Thank you in advance !
PS: I know it possible with jQuery but I would avoid.
0
Comments
too general to answer. need some specifics.
in the before render events and various other events you can retrieve.
var_dump($Sender->Data['Title']);
or via
var_dump(Gdn::Controller()->Data('Title'));
and stash it away if you like.
but your question is so general and non-specific it is impossible to answer.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Thank for your help.
I am working with master.tpl in my theme and for an example:
{$title}
{asset name="Content"}
I want to display the h1 tag out of the asset "Content" ($title variable dosen't exist)
Is it more clear for you ?
true $title does not exist ....
but {$Title} does exist.
you can find all the variables with
{debug}
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Thank you so much !!!
The debug variable is really convenient !
peregrine IS a living debug variable
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌