Results 1 to 3 of 3

Thread: Parent Page ID?

  1. #1
    User
    Join Date
    07-01-09.
    Posts
    91

    Default Parent Page ID?

    I see in the Insert tags list, you can get the parent page alias, but no mention of an ID (like you can with the current page_id). Is it possible to get that through a variable of some kind?

  2. #2
    User
    Join Date
    06-19-09.
    Posts
    328

    Default Re: Parent Page ID?

    Quote Originally Posted by harley77
    I see in the Insert tags list, you can get the parent page alias, but no mention of an ID (like you can with the current page_id). Is it possible to get that through a variable of some kind?
    if you need it in a template you can use

    Code:
    $GLOBALS['objPage']->pid
    Consulenza Contao CMS https://www.intco.it

  3. #3
    User
    Join Date
    07-01-09.
    Posts
    91

    Default Re: Parent Page ID?

    THANK YOU. Holy cow this will save me a lot of work. The location where I was needing this is in a conditional statement for a Catalog List. I couldn't figure out how to use the Global you posted directly in the box, however, I was able to make a simple php file with it, and then call it using the {{file:*}} insert tag.

    The final Code looks like this:

    FIND_IN_SET( {{file:arentid.php}} , item_pagelocation )>0

    The end result is a catalog list that will show a listing of items associated with the parent page of the current location.

    I know there may be a better way, but this works and I thank you.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •