2

How do I, whithin solspace calendar tagpairs, pull data from en ee channel being the parent of the event through ee's relationships tag?

My plan is to keep most articles in an ee:channel and via relationships associate those articles that cover events with Solspace calendar module. Then within solspace calendar tagpairs list only those events that has parents in the articles channel and pull titles and paths to the associated articles entry.

enter image description here

I fear Solspace Calendar doesnt like normal relationships and I really hope to find out my fear is without reason. Croxtons Stash is in my toolbox but I am far from mastering it.

So how do I, whithin solspace calendar tagpairs, pull data from en ee channel being the parent of the event through ee's relationships tag?

2
  • Just to confirm: the relationship field is in your articles channel (not the Calendar: Events channel), and this field contains Calendar event entries?
    – Solspace
    Dec 9, 2013 at 23:41
  • Yes. I have a relationships field in my Articles channel from where I pick what event I want to associate with the article.
    – David S
    Dec 10, 2013 at 20:15

1 Answer 1

1

Except for event date/time data, Calendar channels, both "Calendar: Calendars" and "Calendar: Events", remain mostly channel entries. This means that you can use {exp:channel:entries} to get your parent entries like this:

{exp:channel:entries channel="calendar_events" /* your other parameters */}
    {parents field="event"} {!-- <== Your "Articles" relationship field --}
            {parents:title} - {parents:field1} - {parents:field2}
    {/parents}
{/exp:channel:entries}

However, when using {exp:channel:entries} you won't be able to retrieve data such as {event_start_date} or {event_end_date}. Since {exp:calendar:events} shares the Channel:Entries library, {exp:calendar:events} might work instead to get you both your parent data, while still having access to Calendar date/time event data.

In some cases {exp:calendar:cal} needs to be used to display events chronologically. In this case the Channel:Entries library isn't being called so standard EE relationship tags won't work. In this case you might need to pass {event_id} values in an embed containing {exp:channel:entries} as in the above example, i.e.:

{exp:calendar:cal /* your parameters */}
    // Whatever event data you need to display
    {embed="calendar/parent_entries" child_entry_id="{event_id}"}
{/exp:calendar:cal}

Then, in your "calendar/parent_entries" embed, use {exp:channel:entries} similar to above:

{exp:channel:entries channel="calendar_events" entry_id="{embed:child_entry_id}" dynamic="no" /* your other parameters */}
    {parents field="event"} {!-- <== Your "Articles" relationship field --}
            {parents:title} - {parents:field1} - {parents:field2}
    {/parents}
{/exp:channel:entries}

Your Answer

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

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