I'm use Collections add-on in two site pages. For whis two pages as parents I have few internal pages as childs.
It's not a problem to get link for parent page inside child page template by [[~[[*parent]]]]. But I can't find how I can get parent page title inside child page template.
Please help!
Here you go:
https://forums.modx.com/thread/11074/display-the-parent-s-pagetitle?page=2#dis-post-454048
Create a snippet:
myVeryOwnFieldGrabber
$field = "pagetitle"; //default value
if($modx->resource && !$id){
$id = $modx->resource->get('parent'); //default value
}
if($grabResource = $modx->getObject('modResource', $id)){
return $grabResource->get($field);
}
Use in Template like this
[[!myVeryOwnFieldGrabber]]
or
[[!myVeryOwnFieldGrabber? &id=`[[*parent]]` &field=`pagetitle`]]
[ed. note: donshakespeare last edited this post 9 years, 1 month ago.]
TinymceWrapper: Complete back/frontend content solution.
Harden your MODX site by
passwording your three main folders:
core, manager, connectors and renaming your
assets (thank me later!)
5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
I don't know if the Extra called Collections works in Evo
TinymceWrapper: Complete back/frontend content solution.
Harden your MODX site by
passwording your three main folders:
core, manager, connectors and renaming your
assets (thank me later!)
5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.