Results 1 to 10 of 12

Thread: How do you obtain the PageID

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2009
    Posts
    53

    Default How do you obtain the PageID

    Is the page ID held in $_SESSION['PageID'] or $_COOKIE['PageID'] something? Or, is there something much simpler like {PageID}

    SOLUTION: You can obtain the pageID by using $_GET['PageID'];

  2. #2
    the_sandking's Avatar
    the_sandking is offline hadron remnant - Moderation Fachmann
    Join Date
    Apr 2003
    Location
    Nullspace
    Posts
    5,289

    Default Re: How do you obtain the PageID

    For what page specifically?
    "Much of what looks like rudeness in hacker circles is not intended to give offense. Rather, it's the product of the direct, cut-through-the-BS communications style that is natural to people who are more concerned about solving problems than making others feel warm and fuzzy."

    "We gotta' go to the crappy town where I'm a hero!"
    -Hoban 'Wash' Washburne 2485-2519


    "When you’re born you get a ticket to the freak show. When you’re born in America, you get a front-row seat.."
    -George Carlin 1937-2008

    New to Open-Realty® and need help? Check the:
    -OR DOCUMENTATION -

    Important: Read this at least once in your lifetime
    How To Ask Questions The Smart Way

  3. #3
    Join Date
    Aug 2009
    Posts
    53

    Default Re: How do you obtain the PageID

    For any page I created using the page editor. I'd like to create a link that uses the current page Id but I can't figure out how to get it since we use the new SEO links which don't use page ids at the end of the url

  4. #4
    Join Date
    Jul 2005
    Location
    Sao Paulo, BRAZIL
    Posts
    3,763

    Default Re: How do you obtain the PageID

    Quote Originally Posted by millera View Post
    ...I'd like to create a link that uses the current page Id...
    Insert at the body section of your main.html:
    PHP Code:
    <?php

    if(isset($_GET['PageID'])) {
        
    $my_current_pageid $_GET['PageID'];
        echo 
    '<p>The current PageID is: ' $my_current_pageid '</p>';
        echo 
    '<p>And the link I wish is: <a href="{page_link_' $my_current_pageid '}" title="">MY LINK</a></p>';
        }

    ?>
    Makes no difference if SEF links are enabled/disabled or how are configured.
    NOTICE: in spite of using PHP at HTML files, you should make it an add-on.

    Eduardo

    Open-Realty® DOCs
    We can easily forgive a child who is afraid of the dark; the real tragedy of life is when men are afraid of the light. (Author Unknown)

  5. #5
    Join Date
    Jul 2003
    Location
    California
    Age
    42
    Posts
    4,229

    Default Re: How do you obtain the PageID

    when you're editing the page in the page editor it has a field below the page content called "Template tag for page:" that gives you a template tag to link to that page such as {page_link_1}. It also has the full URL to that page as well. If you just need to know the ID of the page, it is the number in the template tag (1 in this example)
    Open-Realty 2 Documentation

    ~The Difference Between an ORDEAL and an ADVENTURE is ATTITUDE~

  6. #6
    Join Date
    Aug 2009
    Posts
    53

    Default Re: How do you obtain the PageID

    But what if I want to make an addon that gets this automagically for me? That's basically what I'm trying to do. I know how to find page ID's but how does the script know where to get it from? Is it stored in a $_SESSION or $_COOKIE variable?

  7. #7
    the_sandking's Avatar
    the_sandking is offline hadron remnant - Moderation Fachmann
    Join Date
    Apr 2003
    Location
    Nullspace
    Posts
    5,289

    Default Re: How do you obtain the PageID

    I'll ask again. What page specifically are you trying to obtain the page ID# from?

    Do you know what a $_GET variable is?
    "Much of what looks like rudeness in hacker circles is not intended to give offense. Rather, it's the product of the direct, cut-through-the-BS communications style that is natural to people who are more concerned about solving problems than making others feel warm and fuzzy."

    "We gotta' go to the crappy town where I'm a hero!"
    -Hoban 'Wash' Washburne 2485-2519


    "When you’re born you get a ticket to the freak show. When you’re born in America, you get a front-row seat.."
    -George Carlin 1937-2008

    New to Open-Realty® and need help? Check the:
    -OR DOCUMENTATION -

    Important: Read this at least once in your lifetime
    How To Ask Questions The Smart Way

  8. #8
    Join Date
    Aug 2009
    Posts
    53

    Default Re: How do you obtain the PageID

    I'll say again as well, I'm trying to get the PageID of any page I've created with the Page editor. It's not any one specific page I'm trying to get, I'm trying to dynamically get the page ID for every page I've created. Yes, I know what the $_GET variable is. Is that what I use? $_GET['PageID']?. If so, that's all I'm asking. Thanks for your help!

  9. #9
    the_sandking's Avatar
    the_sandking is offline hadron remnant - Moderation Fachmann
    Join Date
    Apr 2003
    Location
    Nullspace
    Posts
    5,289

    Default Re: How do you obtain the PageID

    O.K.

    Turn off SEO friendly links. Visit a page on the OR front-end that you created with the Page Editor. Obtain valid $_GET vars from the link displayed in your browser.

    FYI this method works for any page that accepts $_GET vars, regardless of if it is OR or not.
    "Much of what looks like rudeness in hacker circles is not intended to give offense. Rather, it's the product of the direct, cut-through-the-BS communications style that is natural to people who are more concerned about solving problems than making others feel warm and fuzzy."

    "We gotta' go to the crappy town where I'm a hero!"
    -Hoban 'Wash' Washburne 2485-2519


    "When you’re born you get a ticket to the freak show. When you’re born in America, you get a front-row seat.."
    -George Carlin 1937-2008

    New to Open-Realty® and need help? Check the:
    -OR DOCUMENTATION -

    Important: Read this at least once in your lifetime
    How To Ask Questions The Smart Way

Similar Threads

  1. ERROR. PageID not sent
    By pappysniper in forum Templates - Help/Ideas/Discussion (CLOSED)
    Replies: 7
    Last Post: 09-25-2008, 04:37 AM
  2. PageID=# variable
    By alexoverton in forum General Help (CLOSED)
    Replies: 6
    Last Post: 12-20-2007, 09:52 AM
  3. php if/else or switch by PageID
    By kimyahasira in forum General Help (CLOSED)
    Replies: 2
    Last Post: 06-21-2006, 11:50 PM
  4. ERROR. PageID not sent
    By ecrader in forum General Discussion
    Replies: 0
    Last Post: 05-21-2006, 08:57 PM
  5. Where to Obtain Content? How do you Get First Listings?
    By zebracobra in forum General Discussion
    Replies: 1
    Last Post: 03-14-2006, 11:51 AM

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
  •