If you want to store this stuff rather than just output in on the frontend, you have to store it first, $page->update().
In that case, using yml is the better option, see the famous addToStructure() method here
If you want to store this stuff rather than just output in on the frontend, you have to store it first, $page->update().
In that case, using yml is the better option, see the famous addToStructure() method here