Advanced catalogue back-refs
#5741 (In Topic #1341)
This is to help out @KingBast who likes to do over-complicated stuff with catalogues . It follows on from an IRC conversation.
As I understand it, his use case is he has 3 catalogues. Let's make this abstract and call them a, b, c.
Catalogue 'a' has entries in it that fields in catalogues 'b' and 'c' are referencing (via "A reference to a catalogue entry in a catalogue" fields).
He wants it so that when you view catalogue 'a' entries you get links to the referencing entries in catalogue 'b' only.
Currently it is not possible, because the CATALOGUE_ENTRY_BACKREFS symbol is going to find back-references from all fields pointing to entries in 'a', there's no way to filter it down to individual fields.
I have fixed this in Allow tying catalogue field backref search to a particular field, use… · ocproducts/composr@8951633 · GitHub, which will be in the next patch release. Now you can filter your back-refs to only ones appearing in a particular field.
You need to dip into the database to find the field IDs. In my test site my catalogue 'b' reference field is #45, so that's what I'll use.
If I make CATALOGUE_a_ENTRY_SCREEN.tpl, to override how entries in catalogue 'a' are templated, I can include this code:
This works. It generates hyperlinks, with proper captions, pointing back to the entries in catalogue 'b'.
- If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
- If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
- If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
- If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
1 guest and 0 members have just viewed this.