Page 1 of 1

[Solved] Get the first parent_id in the template

Posted: Thu Nov 27, 2008 6:35 pm
by yabune
Hi,

In the template I would like to know the first parent_id of the hierarchy of the current page.

For example, if I am in this page:

http://www.somesite.com/a/b/c

I would like to get: a

Thank you!

Re: Get the first parent_id in the template

Posted: Thu Nov 27, 2008 7:03 pm
by Dee
http://wiki.cmsmadesimple.org/index.php ... .27s_alias

Replace

Code: Select all

$result = $currentContent->Alias();
with

Code: Select all

$result = $currentContent->Id();

Regards,
D

Re: Get the first parent_id in the template

Posted: Thu Nov 27, 2008 7:06 pm
by calguy1000
Installl the CGSimpleSmarty module

and useĀ 

Code: Select all

{$cgsimple->get_root_alias()}

Re: Get the first parent_id in the template

Posted: Thu Dec 04, 2008 6:15 pm
by yabune
Thanks!
calguy1000 wrote: Installl the CGSimpleSmarty module

and useĀ 

Code: Select all

{$cgsimple->get_root_alias()}