Get parent page alias

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
10010110

Get parent page alias

Post by 10010110 »

calguy1000 wrote: Four new methods in the CustomContent module do this:

$ccuser->get_parent_alias($alias = '')  get_root_alias($alias = '') get_page_title($alias = '') has_children($alias = '')  get_parent_alias($alias = '')[/i] method? I can’t put this as smarty tag like {$ccuser->get_parent_alias($alias = '')}, this would give an error. I’m getting frustrated as I’ve been looking for a solution for this and none of the posts I found helped me because they didn’t really explain things properly. That other thread has brought me quite a step forward but I need to get the direct parent alias, not the root alias. How would I go about that?  :-\

Thanks for any help.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Get parent page alias

Post by calguy1000 »

{$ccuser->get_parent_page_alias()}

the = ''  stuff is code indicating that the parameter is optional.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
10010110

Re: Get parent page alias

Post by 10010110 »

Thanks calguy. I must be doing something wrong, though, because if I put this as value in my template’s body’s ID I’m getting:
Fatal error: Call to undefined method ccUser::get_parent_page_alias() in […]/www/cms/tmp/templates_c/%%7E^7E8^7E8F1701%%template%3A20.php on line 34
What am I doing wrong? Do I have to put that somewhere else? I have CustomContent 1.4.10, by the way (no user set up, though, as I don’t have sepcific content for certain users to show, I only wanna get the direct parent alias).
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Get parent page alias

Post by calguy1000 »

OOOPS:

Code: Select all

$ccuser->get_parent_alias($alias) 
outputs the page alias of the parent page, or empty if the specified page does not have a parent (is at the top). This function will accept a page alias as an argument, if no page alias is specified, the current page is assumed.

Code: Select all

$ccuser->get_root_alias($alias)
outputs the page alias of the topmost parent page, or empty if the specified page does not have a parent (is at the top). This function will accept a page alias as an argument, if no page alias is specified, the current page is assumed.

Code: Select all

$ccuser->get_page_title($alias)
outputs the title of the page matching the supplied alias. This function will accept a page alias as an argument, if no page alias is specified, the current page is assumed.

Code: Select all

$ccuser->has_children($alias)
outputs a boolean indicating if the specified page has child pages or not. This function will accept a page alias as an argument, if no page alias is specified, the current page is assumed.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
10010110

Re: Get parent page alias

Post by 10010110 »

Sweet, man! That did it. Thanks a lot!  :D
Locked

Return to “CMSMS Core”