Template variable for parent title?
Template variable for parent title?
I'm looking for a template variable for the parent article's title and URL, so I can link back to it directly to the parent from an article - but breadcrumbs wasn't what I was looking for. Is this possible? I didn't see any template variables that seemed to suit what I need.
Re: Template variable for parent title?
Still working on this, and by adding something like:
{$content_obj|print_r}
I see various interesting variables that are close, but no cigar. For example, I see:
[mId] => 109
...
[mParentId] => 104
...
[mHierarchyPath] => parent_alias/article_alias
where mId is the current article's ID, parent_alias is the parent article's alias, and mParentId is the parent's article ID. Is there some nifty call I can use in the template to actually fetch the parent article and get the details from there??
{$content_obj|print_r}
I see various interesting variables that are close, but no cigar. For example, I see:
[mId] => 109
...
[mParentId] => 104
...
[mHierarchyPath] => parent_alias/article_alias
where mId is the current article's ID, parent_alias is the parent article's alias, and mParentId is the parent's article ID. Is there some nifty call I can use in the template to actually fetch the parent article and get the details from there??
Re: Template variable for parent title?
Hi.
You can always install the module CGSimpleSmarty and use the functions that come with it.
For example:
Didn't test it but just read the help file! It's quite easy.
Bernd
You can always install the module CGSimpleSmarty and use the functions that come with it.
For example:
Code: Select all
{$cgsimple->get_parent_alias(['',$your_var)}
Assign the alias to the variable $your_var
Then:
{$cgsimple->get_page_title($your_var,'$pagetitle')}
The parent's page tiltle is: {$pagetitle}
Bernd
Re: Template variable for parent title?
Hey, Thanks for the tip! I've implemented it almost just like this, and it does (almost) exactly what I need. 
The only problem now, which I have worked around be restructuring my pages, is that I am using some "External link" entries, and they have children. From the child, I can't seem to get the external link page URL in a clever way using $cgsimple. I posted a question about this in a relevant thread I found here:
http://forum.cmsmadesimple.org/index.ph ... #msg186293

The only problem now, which I have worked around be restructuring my pages, is that I am using some "External link" entries, and they have children. From the child, I can't seem to get the external link page URL in a clever way using $cgsimple. I posted a question about this in a relevant thread I found here:
http://forum.cmsmadesimple.org/index.ph ... #msg186293