Is there any way to do this in ExpressionEngine (3.5.10)....
I have a channel of services offered by a company. The channel name is called
services. I then have a list of news articles in a channel called
There will be around 50
services and hundreds (or potentially thousands) of
What I want to do is when a user is looking at a particular service, I want to show news articles that are relevant.
However, any workflow for the publisher (the person using the EE Admin panel) is tedious, or it seems impossible to write a query in the template to do the job.
For example, it could technically be done like this:
Set up a Relationship on
newssuch that I can say which
servicesit applies to. I don't understand how I could then query this to get the actual news content when viewing a service on the front-end because the relationship exists on the
newschannel entry, not the
serviceschannel entry. ** see notes below for what the intended outcome is here and you'll understand what the issue with this is.
Set up a Relationship on
servicesand select the appropriate
news. This is impractical because of the amount of work it would involve to maintain. For example every single time a
newsentry is published the publisher would have to go into potentially 50
servicesrather than being able to do it from 1 place.
Use categories... not really sure where to begin with that as I could set up categories on my
newsarticles (where the categories are the names of the services) but then unsure how to query this in the template. For example, I don't understand in terms of writing a query, how you could correlate a category name (or category slug) to specific channel entries.
** The relevant template is the one which shows details of an individual service. These are set up with a URL structure like so:
So when the user goes to
/services/service-two it should list any
news entries that are relevant to
What is the most efficient way of doing this in terms of:
- Workflow for the publisher, i.e. the least number of clicks and data entry.
- Something that scales well given there may be 50 services and >1000 news articles, with further news articles being added daily.
- How does the proposed solution work in the template - i.e. when I'm looking at
services/service-twowhat code do I need to bring out the list of
newsentries such that I can read at least their title and URL?
My apologies if the answer to this is obvious but I've thought about it so long now I'm asking for help as I can't see a way around it.