1

Okay first of all, many apologies for the title of this post. Having a bit of a brain drain today and couldn't really think of a better way of putting it.

Here goes though.

I am using Structure on a site running EE 2.6.1. I'd like to have a page which is called 'Winners'. That page is linked to a Channel which will store all the winners names and they will be displayed on that page.

So far so good and easy to do.

Next up I need to have each of those winners names clickable and to go to a new template which will be a blog type page which will show entries from another channel which are related to the winner.

So basically :

1 - A page which lists winners (all entries in a winners channel) 2 - Each name is clickable to another template 3 - When reaching this template a Channel tag is on the page (winners_blog) 4 - The entries in this Channel (winners_blog) have a relationship field to relate them to the winners. 5 - This template will then only show blog posts for that winner.

1 & 2 are done but I'm having a brain drain on how to now only show the blog posts related to the winner once on that page.

If anyone understands what I'm on about here and can lend a quick hand then that would be greatly appreciated.

Thanks.

Best wishes,

Mark

7
  • not sure I follow - these winners are the authors of said blog posts? Aug 21, 2014 at 12:21
  • Hi Erwin, Sorry no they won't be the authors.
    – Mark Bowen
    Aug 21, 2014 at 14:40
  • Gaaahh!!! Trying to add a long reply to you and pressed return to get a new line and it posted the comment. How do I post with line breaks?
    – Mark Bowen
    Aug 21, 2014 at 14:40
  • Okay let's say this is my hierarchy using the Structure module : Home Forms Display Winners Contact The 'Winners' Structure page has a Channel (listing) attached to it called Winners. This Channel (listing) holds the name (title) of the winner and a field to hold some general information about them.
    – Mark Bowen
    Aug 21, 2014 at 14:46
  • This is all done and easy to do however what I want to be able to do is to click on a link for each winner and take people to another page which will have a separate Channel tag on it called winners_blog. The Winners Blog Channel will have lots of posts which each have a relationship field pointing to one of the entries (winners) in the Winners Channel. So therefore this is how it will go : Click on Winners structure page link and you're taken to a page which shows all the entries from the winners blog. This is done.
    – Mark Bowen
    Aug 21, 2014 at 14:46

1 Answer 1

0

I think one approach here would be as follows:

1) create a blog template e.g. blog/winner

2) this template will expect either the winner id or url_title field in segment 3 (your preference)

3) this template then does a channel entries tag limit 1 on the winners channel. You may need to set dynamic="no" and then set either the entry_id or url_title parameter to {segment_3} as appropriate

4) within the channel entries tag then use the parents tag to list out the relevant blog entries e.g. {parents field="blog_winner"}. See https://ellislab.com/expressionengine/user-guide/add-ons/channel/relationships.html#accessing-parents

5) in your winners list template you won't use page_url in your links. Instead you would use path=blog/winner/{entry_id} or {url_title} Although, depending on your set up you may be able to keep using the structure page_url links as the winner links and then in whichever template ends up being used you would start at step 3.

4
  • Hiya, Thanks for that. Will have to take a look at that. Not entirely sure if that tag is available in 2.6.1 but if it is then that may well be an option. If not then will have to see about updating the site first. Thanks again for the help. Will see if that works for this case. Best wishes, Mark.
    – Mark Bowen
    Aug 22, 2014 at 9:33
  • Near the top of that docs page it says relationships were revamped in 2.6, but in case that's not accurate, it would be the reverse related entries tag in the old relationships tags - here's the EE1 docs link and you would just replace the weblog parameter with channel etc: ee1docs.com/modules/weblog/reverse_related_entries.html
    – Janine
    Aug 22, 2014 at 13:39
  • Hiya. Thanks for all that. Looking at it I think I may just go with categories instead and set both the 'Winners' and the 'Winners Blog channels to use the same category group as I'd like to pagination the entries as much as I can. It's not ideal but will work for this case. Many thanks for the thought food though, much appreciated.
    – Mark Bowen
    Aug 22, 2014 at 18:09
  • No worries Mark. Glad you worked out a olan.
    – Janine
    Aug 22, 2014 at 21:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.