Tip: Make Catalogue entries use ID's instead of Monikers

Post

Posted
Rating:
Item has a rating of 5 (Liked by Chris Graham)
#6222 (In Topic #1538)
Avatar
Site staff
Adam is in the usergroup ‘Super-moderators’
As someone who likes Monikers enabled for most content I did not want to fully disable them but I wanted my catalogue entries to use ID's (for a number of reasons). I wondered how to achieve this for a while before getting a hint from Chris, which was to hack the content_meta_aware hook for catalogue entries. I assumed hack meant a lot more than changing a single value from true to false but it's really that simple ;)

In order to make this change upgrade resistant, place a copy of sources/hooks/systems/content_meta_aware/catalogue_entry.php into sources_custom/hooks/systems/content_meta_aware/catalogue_entry.php then open the custom version of the file for editing and find the following line:-

'support_url_monikers' => true,

Change true to false and save the file. Your catalogue entries will now be using the entry ID's and the rest of your website (which may be using Monikers) will remain unaffected. You could also make the same edit to a custom copy of catalogue_categories.php file if revealing the category ID's is more useful to you than Monikers. In fact, most of the content_meta_aware hooks allow this setting to be changed, though hooks which have Monikers set to false by default should probably be left that way.
Online now: No Back to the top
1 guest and 0 members have just viewed this.

Statistics

Users online:

MVLipwig, deepu_ms, Manu, gabriel58

Usergroups: 

Forum statistics:
  • 1,257 topics, 5,783 posts, 6,957 members
  • Our newest member is Articcio
Birthdays:
Back to Top