• Resolved kkarl

    (@kkarl)


    Hello, I would like the url event links to open in an external window in effort to not drive traffic away from site. I cannot find any recent documentation in this support forum and the documentation to do this on your site, https://www.joedolson.com/my-calendar/faq/#a3, is not working and using older jQuery strings.

    Is there a way I can accomplish this? And preferably a way that doesn’t get overwritten with every new update. Thank you.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter kkarl

    (@kkarl)

    Hello, following up on this as I have not received any comments. Thank you.

    Plugin Author Joe Dolson

    (@joedolson)

    I updated the FAQ and the script so that it’s more up to date. Thanks!

    Thread Starter kkarl

    (@kkarl)

    Thank you Joe for follow up. I tried adding the updated script in my child theme footer.php file but still can’t get it to work. Tried putting at beginning and end and refreshing to make sure code is loading but still opening in same window.

    Saw your comment you may need to disable AJAX navigation. I’m using Salient WordPress them and saw this but not sure if it will disable other needed functionality, https://themenectar.com/docs/salient/disable-ajax-save-theme-options/

    Plugin Author Joe Dolson

    (@joedolson)

    The AJAX navigation I’m referring to is the calendar navigation; it won’t impact your theme. Go to My Calendar > Design > Scripts and uncheck that option.

    Can you share a link that I can look at?

    Thread Starter kkarl

    (@kkarl)

    Hi Joe. I tried the above but still can’t get to work. The “Disable AJAX” checkbox under My Calendar > Design > Scripts was currently unchecked already. Tried checking it to disable it but still not working. Cleared cache on browser and using W3 Total Cache on site. Using Google Chrome as browser.

    Here is my link for reference https://mineralconference.com/events/

    Thank you

    Plugin Author Joe Dolson

    (@joedolson)

    I see that you’re using the upcoming events list to display your events; and it looks like you’re using a custom template to display the link. What’s your template? That link doesn’t have the external class, and I assume that’s because the code isn’t being generated by My Calendar.

    Thread Starter kkarl

    (@kkarl)

    Hi Joe. Here is the shortcode I’m using on page above:

    [my_calendar_upcoming before=”0″ after=”999″ type=”event” fallback=”No events currently scheduled” category=”” template=”{daterange} {time} – {endtime} {link_title} > {location}” order=”asc” show_today=”yes” skip=”0″ ltype=”” lvalue=””]

    Is there an update to code above to achieve same results that utilizes the “external” class?

    Plugin Author Joe Dolson

    (@joedolson)

    You can create a new custom template at My Calendar > Design > Templates with the template

    {daterange} {time} – {endtime} <a href="{link}" target="_blank">{title}</a> > {location}

    You’ll then get an encoded string you can use to reference that template. You can’t do complex templates inside a shortcode, because the nested quotes quickly get unmanageable.

    You *should*, for accessibility, also add text that notifies the user that the link will open in a new tab.

    Thread Starter kkarl

    (@kkarl)

    Hi Joe,

    Awesome. I got it to work by creating a template and using this shortcode inside it {daterange} {time} – {endtime} a href="{link} target="_blank">{title}</a> &gt; {location}

    One last question. Some events do not have a link associated with them. With the above code when you click on event it launches the current page you’re viewing in a new url window. Is there a way for an if/else statement in shortcode if link is present or not? Or individually in the event can I put something in the link field to prevent from it being clicked on? I tried # but didn’t work

    Plugin Author Joe Dolson

    (@joedolson)

    If you switch to PHP templating, then you can use logic in templates. See https://docs.joedolson.com/my-calendar/php-templates/

    The string templates have limited logic; the PHP templates support any logic you can work out in PHP. So they’re much more sophisticated.

    Thread Starter kkarl

    (@kkarl)

    Thank you Joe, this is great. You can mark this as resolved.

Viewing 11 replies - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.