1

Here is the situation. I have two channels; one is "calendar_events" and the other one is "projects" and there is a relationship field, "event_related_project" to relate that particular event to a specific project.

<h2>{title}</h2>
<h4 class="project_tagline">{project_tagline}</h4>
        {project_description}
            <section class="related-activities">
            <h3 class="related-title">Related Events</h3>
            <ul>
            {parents field="event_related_project" orderby="date" }
                {if parents:no_results}
                <p class="note-message">No related events are found.</p>
                {/if}
                <li><a href="{path='event/view'}/{parents:entry_id}/">{parents:title}</a> / {event_start_date format="%F %d, %Y"}</li>
            {/parents}
            </ul>

            <h3 class="related-title-news">Related News</h3>
            <ul>
            {parents field="news_related_project" orderby="date" limit="3"}
            {if parents:no_results}
            <p class="note-message">No related news are found.</p>
            {/if}
            <li><a href="{title_permalink='news/view'}">{parents:title} / {parents:entry_date format="%F %d, %Y"}</a></li>
            {/parents}  
            </ul>
        </section>

It can display all the related events under a specific project but I cannot display the "event_start_date". I also tried to make the list wrapped by the {exp:calendar:events} pair tag but the result does not show correctly. May someone help? Thanks, Chris

2

Try passing the event_id to an embedded template to a calendar:events tag. Which you would use to display the date.

something like:

{embed="my_date_template" event_id="{parents:entry_id}"}

then, your embedded template:

{exp:calendar:events event_id="{embed:event_id}"}
{event_start_date format="%F %d, %Y"}
{/exp:calendar:events}
| improve this answer | |
  • For Calendar 3.1.0, as the parameter of event_id is not available for use, what alternative approach will you suggest for the same result? – Chun Kit Wong Dec 24 '18 at 3:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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