- This topic has 7 replies, 2 voices, and was last updated 1 year, 7 months ago by Tom.
March 4, 2019 at 10:58 am #828692Paul
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 #828696TomLead DeveloperLead Developer
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.March 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 #828887TomLead DeveloperLead Developer
elements/assets/admin/metabox.jsand find line 185:
Replace it with:
text: elements.showID && value.id ? value.name + ': ' + value.id : value.name
elements/class-metabox.phpand 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' );March 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 #828958TomLead DeveloperLead DeveloperMarch 4, 2019 at 6:50 pm #828961Paul
OK, cool! Thanks a million.March 5, 2019 at 9:30 am #829708
- You must be logged in to reply to this topic.