Question

Photo of Kathryn Kent

0

Content Channel Event Item Link

I am making a Content Channel and I've added the Item Attribute "Event Items". When I go to add a new content channel item I select the Event Item from the drop down menu, but I wanted to know what lava code to use so I can  make it a link to the specific Event Item. 

I've tried these codes, but I'm obviously doing something wrong:

   <a href="{{ item | Attribute:'EventItem'}}" class="btn btn-primary">See More</a>

    <a href="/event/details/{{Slug}}" class="btn btn-primary">See More</a> 

<a href="/event/details/{{ item | Attribute:'EventItem','Slug' }}" class="btn btn-primary">See More</a>

<a href="/event/details/{{ item | Attribute:'EventItem','Id' }}" class="btn btn-primary">See More</a>


  • Photo of Stan Yoder

    0

    Just to confirm - do you really want to link to an EventItem? Or did you mean EventItemOccurrence?

    I'm assuming based on the example code you tried that your Event Details page must have a route defined of "/event/details/{some id}". If your setup is like the demo site - then that id is an EventOccurrenceId. So you will want to change the attribute on your content channel to an EventItemOccurrence ... and for the url you would use "/event/details/{{ item | Attribute:'EventItemOccurrence','Id' }}"


  • Photo of Kathryn Kent

    0

    I'm trying to set it to the occurrence, but I want to set it up when I select from the drop down menu on Event Items in the Content Item Details so that it can be linked to that page somehow. Here are screenshots of what I'm trying to do when making a button for the link. 


    .Screenshot_2024-08-22_at_10.12.41_AM.pngScreenshot_2024-08-22_at_10.14.55_AM.pngScreenshot_2024-08-22_at_10.18.36_AM.png


  • Photo of Stan Yoder

    0

    What about the details/setup for the page you're trying to link to? What blocks are on it? What is it's route? That will help determine what you have to pass to the page.