Add page ID to page when publish

Graham Lewis's Avatar

Graham Lewis

07 Jan, 2015 05:08 PM

I am needing to add the page ID for each page when it is published. Preferably in the META area. Any help would be appreciated - thanks!

  1. 1 Posted by Ryan Griffith on 07 Jan, 2015 06:11 PM

    Ryan Griffith's Avatar

    Hi Graham,

    Simplest way to accomplish this would be to add a region in your page's Template within the <head> tag and apply a Velocity Format that simply outputs the desired meta tag.

    If you are running Cascade Server 7.10.1 or newer, you could use something like the following:

    <meta name="page-id" content="${currentPage.identifier.id}">
    

    Please let me know if you have any questions.

    Thanks!

  2. 2 Posted by Graham Lewis on 07 Jan, 2015 07:18 PM

    Graham Lewis's Avatar

    Never mind...I'm an idiot haha, got it figured out :)

    Graham Lewis
    Webmaster
    Jacksonville State University

    256.782.5331
    www.jsu.edu

  3. 3 Posted by Ryan Griffith on 07 Jan, 2015 07:29 PM

    Ryan Griffith's Avatar

    Glad to hear you were able to figure things out, Graham.

    I'm going to go ahead and close this discussion, please feel free to comment or reply to re-open if you have any additional questions.

    Have a great day!

  4. Ryan Griffith closed this discussion on 07 Jan, 2015 07:29 PM.

  5. Graham Lewis re-opened this discussion on 07 Jan, 2015 07:35 PM

  6. 4 Posted by Graham Lewis on 07 Jan, 2015 07:35 PM

    Graham Lewis's Avatar

    Ryan,

    I think I missed a step - I added it to the template and published it. And it just outputs the same thing ${currentPage.identifier.id} - I need to add a format to it?

    Graham Lewis
    Webmaster
    Jacksonville State University

    256.782.5331
    www.jsu.edu

  7. 5 Posted by Ryan Griffith on 07 Jan, 2015 07:56 PM

    Ryan Griffith's Avatar

    Hi Graham,

    You are correct, this code would need to be added to a Velocity Format, because it is using the $currentPage variable that is registered with Velocity Formats. ou would then apply that Format to your Template region.

    You may be thinking of the system tags that allow you to output wired metadata information for the current page, such as title, display name, etc.

    Please let me know if you have any questions.

    Thanks!

  8. 6 Posted by Graham Lewis on 07 Jan, 2015 08:01 PM

    Graham Lewis's Avatar

    Got it working - thanks! Have a good one!

    Graham Lewis
    Webmaster
    Jacksonville State University

    256.782.5331
    www.jsu.edu

  9. 7 Posted by Ryan Griffith on 07 Jan, 2015 08:02 PM

    Ryan Griffith's Avatar

    Glad to hear you got it working, Graham.

    I'm going to go ahead and close this discussion, please feel free to comment or reply to re-open if you have any additional questions.

    Have a great day!

  10. Ryan Griffith closed this discussion on 07 Jan, 2015 08:02 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac