0

I'm displaying a list of events and details on a page. Replacing the current channel:entries tag pair with the Solspace Calendar:Events tag.

I cannot work out how I am meant to display the current code (below) using the Calendar tags.

e_image is a channel_images field. Adding {calendar:e_image} doesn't work.

    {if e_image}{e_image}
    <div class="ceimg2" style="background-image: url({image:url:esml})">
        <a href="{image:url:elrg}" title="{image:title}" class="large"><span>ENLARGE IMAGE</span></a>
    </div>{/e_image}
    {if:elseif e_map && ! e_image}
    <div class="ceimg1">
        <p>VIEW<br>MAP</p>
        <a href="{e_map}" target="_blank" title="VIEW MAP"><span></span></a>
    </div>{/if}

I have tried embedding it as a template using {exp:channel:entries channel="event" entry_id="?" dynamic="no"} but not sure if i am missing something or it's just not possible?

I also have the same issue with details in a Grid field - also tried embedding as a template (as noted in the docs) but cannot understand what I'm doing wrong. Below is part of my original channel:entries code, with some added calendar:events tags. How would I go about embedding this?

e_contact is the actual grid field, with ename, ephone, etc the individual grid columns.

        {e_contact}
        {if e_contact:count == "1"}<a href="tel:{e_contact:ephone}">{e_contact:ephone}</a> {e_contact:ename}{/if}
        {if e_contact:count == "2" AND "{e_contact:ephone}" != ""} &nbsp;<i>or</i> &nbsp; <a href="tel:{e_contact:ephone}">{e_contact:ephone}</a> {e_contact:ename}{/if}
        {if e_contact:count == "3" AND "{e_contact:ephone}" != ""} &nbsp;<i>or</i> &nbsp; <a href="tel:{e_contact:ephone}">{e_contact:ephone}</a> {e_contact:ename}{/if}
        {if e_contact:count == "4" AND "{e_contact:ephone}" != ""} &nbsp;<i>or</i> &nbsp; <a href="tel:{e_contact:ephone}">{e_contact:ephone}</a> {e_contact:ename}{/if}
        {/e_contact}
        {e_contact limit="1"}{if e_contact:ephone}{/if}{/e_contact}
        {e_contact}
        {if e_contact:count =="1" AND "{e_contact:eemail}" != ""}<a href="mailto:{e_contact:eemail}?subject={title} - {e_date format="%j%S %M %Y"}">{e_contact:eemail}</a>{/if}
        {if e_contact:count =="2" AND "{e_contact:eemail}" != ""} <i>or</i> &nbsp; <a href="mailto:{e_contact:eemail}?subject={title} - {e_date format="%j%S %M %Y"}">{e_contact:eemail}</a>{/if}
        {if e_contact:count =="3" AND "{e_contact:eemail}" != ""} <i>or</i> &nbsp; <a href="mailto:{e_contact:eemail}?subject={title} - {e_date format="%j%S %M %Y"}">{e_contact:eemail}</a>{/if}
        {if e_contact:count =="4" AND "{e_contact:eemail}" != ""} <i>or</i> &nbsp; <a href="mailto:{e_contact:eemail}?subject={title} - {e_date format="%j%S %M %Y"}">{e_contact:eemail}</a>{/if}
        {/e_contact}
        {e_contact limit="1"}{if e_contact:eemail}</span>{/if}{/e_contact}

ANY HELP is appreciated!

1

If you're going to use embeds, you need to make sure you're passing the entry ID from the {exp:calendar:events} tag over to the embedded {exp:channel:entries} tag inside the embed. That would look something like this:

Main template:

{exp:calendar:events
    channel="events"
    date_range_start="today"
    date_range_end="30 days"
    limit="20"
}
   {calendar:title} - {calendar:event_start_date format="%F %j, %Y"}
   {embed="path_to/template" entry_id="{calendar:entry_id}"}
{/exp:calendar:events}

Embedded Template:

{exp:channel:entries
    channel="events"
    entry_id="{embed:entry_id}"
}
   STUFF
{/exp:channel:entries}
1
  • Thankyou! Both {calendar:entry_id} and {embed:entry_id} was what I needed.
    – ZEDG
    May 6 '19 at 14:05

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.