- This topic has 7 replies, 2 voices, and was last updated 4 years ago by
Tom.
-
AuthorPosts
-
March 4, 2019 at 10:58 am #828692
Paul
Is it possible to display page slugs instead of titles in Elements > Location? I have multiple “thank you” pages that use Thank You as the title (which I use for display in page headers) but it’s difficult to tell which page is which when the drop down uses titles instead of the page slug.
See my screenshot. Here you can see I have two pages with the same title:
GeneratePress 2.2.2GP Premium 1.7.8March 4, 2019 at 11:12 am #828696Tom
Lead DeveloperLead DeveloperHey Paul,
Definitely an issue right now. Unfortunately there isn’t a fix unless you’re comfortable editing core code.
In GPP 1.8, I’ve added a filter that allows you to show the ID next to the title. Let me know if you want instructions to make that change now.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentMarch 4, 2019 at 11:22 am #828700Paul
Hey Tom, yes, I’m interested in that code. TIA!
FYI, my use case on this is building client landing pages using unique Facebook Lead Event pixels on each page and I need to be able to easily identify the pages. A page ID definitely is helpful in the meantime though.
March 4, 2019 at 4:49 pm #828887Tom
Lead DeveloperLead DeveloperOpen
elements/assets/admin/metabox.js
and find line 185:text: value.name
Replace it with:
text: elements.showID && value.id ? value.name + ': ' + value.id : value.name
Then, open
elements/class-metabox.php
and find line 97. On the line below it, add this:'showID' => apply_filters( 'generate_elements_show_object_ids', false ),
It should look like this:
'choose' => __( 'Choose...', 'gp-premium' ), 'showID' => apply_filters( 'generate_elements_show_object_ids', false ),
Now you can add this function to your site:
add_filter( 'generate_elements_show_object_ids', '__return_true' );
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentMarch 4, 2019 at 5:30 pm #828911Paul
Thanks Tom. That’s awesome. However, I’ll lose this with the next GPP update. Or will this be added to the next version?
March 4, 2019 at 6:46 pm #828958Tom
Lead DeveloperLead DeveloperThis is added to the next version ๐
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentMarch 4, 2019 at 6:50 pm #828961Paul
OK, cool! Thanks a million.
March 5, 2019 at 9:30 am #829708Tom
Lead DeveloperLead DeveloperNo problem ๐
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-development -
AuthorPosts
- You must be logged in to reply to this topic.