Forum Replies Created
-
AuthorPosts
-
February 21, 2025 at 2:50 AM in reply to: Event Single with data from Event and related Topics with related Team Member #47709
swest
ParticipantI think I got it. Thanks for the nudge in the right direction.
Here's my final view:
For another view (All Events) can I just loop the entire Event Single view?
February 20, 2025 at 10:45 PM in reply to: Event Single with data from Event and related Topics with related Team Member #47708swest
ParticipantWhere would I add those query args in my single-event_view.twig?
https://gist.github.com/swest/56de57093c8ca1af90635e23200b81cb#file-single-event_view-twigDoes it replace these?
Line 10{% set relationship = attribute( relationships, 'event-to-topic' ) %} {% for post in relationship.to %}AND
Line 21{% set relationship = attribute( relationships, 'topic-to-team' ) %} {% for post in relationship.to %}February 20, 2025 at 5:29 AM in reply to: Event Single with data from Event and related Topics with related Team Member #47694swest
ParticipantSingle Event page.
https://share.cleanshot.com/VhGY1fPlswest
ParticipantThat worked great.
Thank you very much for your help.swest
ParticipantThank you, that helped.
In the View, how do I set an orderby?
I tried:
{% set topic_args = { relationship: { id: 'relationship-team-to-topic', from: post.ID }, nopaging: true, post_type: 'topic', orderby: '{ post.topic_datetime | date( 'Y-m-d H:i' ) }', order: 'ASC' } %}but it resulted in fatal errors.
swest
ParticipantTopic to Team Relationship
https://pastebin.com/yg9iBdYwTopic to Event Relationship
https://pastebin.com/5wWAL2WvI check this View code https://pastebin.com/f3WD9DXN
but don't see any issue when outputting topic and event posts.Can I give you access to the staging site where I am seeing the fatal errors?
swest
ParticipantThank you Peter.
This is what I finally got to work. I appreciate your help in finding a solution.The key I was looking for was:
{% if post.vod_honor_type_tax.name == 'Faculty' %}<div class="card-heading"> <h4 class="honor-type">{{ post.vod_honor_type_tax.name }}</h4> <h1 class="honoree-name">{{ post.vod_honoree_names }}</h1> {% if post.vod_honor_type_tax.name == 'Faculty' %} <h4 class="years-of-service">Years of Service {{ post.years_of_service }}</h4> {% else %} <h4 class="class-of">class of {{ post.vod_class_of_tax.name }}</h4> {% endif %} </div>swest
ParticipantThanks Peter.
This code goes into a view for a Single item, so I don't think I can use a for loop as I'm seeing multiple items returned.
<div class="vod-wrapper"> <div class="card-heading"> <h4 class="honor-type">{{ post.vod_honor_type_tax.name }}</h4> <h1 class="honoree-name">{{ post.vod_honoree_names }}</h1> {% for item in post.vod_honor_type_tax %} {% if item.name == 'Faculty' %} <h4 class="years-of-service">Years of Service {{ post.years_of_service }}</h4> {% else %} <h4 class="class-of">Class of {{ post.vod_class_of_tax.name }}</h4> {% endif %} {% endfor %} </div>With the View code above, I'm seeing this for output
https://share.cleanshot.com/W9vpCDL2
and
https://share.cleanshot.com/bhN2v6XjInstead of this:
https://share.cleanshot.com/pKqwJ0gQ
and
https://share.cleanshot.com/4vVBzhZ1 -
AuthorPosts