• Resolved nico-lino

    (@nico-lino)


    Hi,
    I’m trying to add inside a shortcode different fields to add when adding in calendar

    [add-to-calendar-button name=”Post title page”
    options=”‘Apple’,’Google'”
    startDate=”event_date (ACF field)” (i attached my ACF date field config to know if it is well formated)
    location=”event_location (ACF field)”
    description=”short_description (ACF field)” ]

    Can you please help me or maybe is there a sample showing how to add kind of acf fields in this way and the post title off course.

    Lat but not least > is there a way to change or translate “Add to Calendar” name ?

    Thx in advance

Viewing 12 replies - 1 through 12 (of 12 total)
  • Thread Starter nico-lino

    (@nico-lino)

    Impossible to select acf field and display them into calendar (i’m testing with Google).
    There are no samples even a cheap one to show how to add code for displaying infos from acf fields inside different calendar emplacement, neither even post title.

    Plugin Contributor Jens Kuerschner

    (@jekuer)

    Hi Nico,

    Even the plugin does not explicitly support any combination with third party plugins, it is possible to use a shortcode inside the shortcode that comes with this plugin.

    You can check other recent posts for some samples.

    In doubt, you can share your code here to get some help.

    Best, Jens

    Thread Starter nico-lino

    (@nico-lino)

    Hi thanks for replying to me.
    But i tried to search and test few codes that i found here and i couldn’t succed

    What i need is

    [add-to-calendar-button name=”my post title field” options=”‘Apple’,’Google'” startDate=”my post acf field named event_date” description= “my post acf field named description”]

    Plugin Contributor Jens Kuerschner

    (@jekuer)

    Thread Starter nico-lino

    (@nico-lino)

    hi,

    thank you for your answer.

    i red this one and all other questions regarding ACF integration

    i assume that

    startDate=”{sc_start}acf:welcome_page_date_and_start_time{sc_end}”

    Means that ACF field name is > welcome_page_and_start_time

    but it doesn’t work for me when adding my acf field. (Maybe due to my date format – that’s why I added a screen capture to let me know what kind of date format I need to set)

    regarding the other elements

    any ACF text field

    do have I to add it with ACF: First inside same {sc_start} and {sc_end} ? Cause it doesn’t work

    post title > what code or value have I to add to display my post title (inside same {sc_start} and {sc_end} ?)

    Thx

    Plugin Contributor Jens Kuerschner

    (@jekuer)

    you need to use the shortcode function. see https://www.advancedcustomfields.com/resources/shortcode/

    {sc_start} represents the beginning “[” of it. {sc_end} the “/]”.

    Thread Starter nico-lino

    (@nico-lino)

    Thank you for your reply.
    By refering to your ACF link explanation i tried by displaying

    acf field named : lieu_evenement

    using shortcode in my wysiwig editor as [acf field=”lieu_evenement”]
    And it works fine by displaying field value inside my text

    But when adding same shortcode in the way you mentionned it inside your calendar button sortcode as
    description= “{sc_start}acf field=”lieu_evenement”{sc_end}”
    i get nothing inside my Google Agenda description

    When displaying
    description= {sc_start}acf field=”lieu_evenement”{sc_end}
    i get only acf characters written inside my Google Agenda description

    So i haven’t tried yet acf date value as i’m not able to display simple acf shortcode text and neither post title cause i don’t know what value i have to add.

    I think that in all your basic samples you could provide a simple with post title, acf date and an any acf field that needs to be display in description.

    Thread Starter nico-lino

    (@nico-lino)

    Hi i succeded in ! ??
    Date value is missing….:(

    Post title
    i added a php code for creating a shortcode named post_title for using then inside add to calendar button code :
    name=”{sc_start}post_title{sc_end}”

    ACF fields value
    i added my acf shortcode in this way :
    location= “{sc_start}acf field=acf_field_name{sc_end}”
    description= “{sc_start}acf field=acf_field_name{sc_end}”

    ACF Start value
    I get an error message : falide: date misspelled YYYY-MM-DD
    As my date is an ACF value from ACF date picker how can i display value without mispelling it ?
    Or how can i add my value and transform value result in date that would be good ?

    Thanks in advance in helping me for this last missing point

    Plugin Contributor Jens Kuerschner

    (@jekuer)

    1. You cannot use double quotes inside the value as they would break the html scheme. You can use single quotes for the nested shortcode
    2. there is unofficial support for YYYYMMDDThhmm or similar. However, transforming it on your side to the official format would be the most stable solution.
    Thread Starter nico-lino

    (@nico-lino)

    Hi,

    Thank you for your support.
    I succeded for adding Start Date value to calendar by formating my ACF fields into correct / needed value.

    @nico-lino Can you share the shortcode that works for you?
    I tried multiple variables but nothings seems to work.
    Specially I see the double quotes and double quotes are different that the initially the plugin offer.
    Which ones are the correct ones?

    Thread Starter nico-lino

    (@nico-lino)

    here is the shortcodes that worked for me.

    you can see on live here : https://acaa.fr/projet-noel-strasbourg/

    [add-to-calendar-button styleLight=”–btn-background: #C71E98; –btn-text: #fff;” debug name=”{sc_start}post_title{sc_end}” options=”‘Apple’,’Google'” startDate=”{sc_start}acf field=date_evenement{sc_end}” endDate=”{sc_start}acf field=date_fin_evenement{sc_end}” label=”ajouter au calendrier” location= “{sc_start}acf field=lieu_evenement{sc_end}” description= “{sc_start}acf field=introduction{sc_end}”]

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