This topic is locked

Adding JSON to html code

2/19/2022 6:17:07 AM
PHPRunner General questions
D
Dynamiccomp author

I was trying to add code like this to the editor code for a page, but its giving me an unexpected ":" error message, so I am trying to figure out how to add it to the project:

<div class="atcb" style="display:none;">
{
"name":"Add the title of your event",
"description":"A nice description does not hurt",
"startDate":"2022-02-21",
"endDate":"2022-03-24",
"startTime":"10:13",
"endTime":"17:57",
"location":"Somewhere over the rainbow",
"label":"Add to Calendar",
"options":[
"Apple",
"Google",
"iCal",
"Microsoft365",
"Outlook.com",
"Yahoo"
],
"timeZone":"Europe/Berlin",
"timeZoneOffset":"+01:00",
"trigger":"click",
"iCalFileName":"Reminder-Event"
}
</div>

I have a custom CSS and custom JS script that I added to the header of the page as well as the folder with the corresponding files uploaded to my site. All i need to figure out is how to add this code to my project?

Thanks for the help.

D
Dynamiccomp author 2/19/2022

i forgot I had tried to create a custom snippet with that code, once I removed it, I was able to see the button.

Now my issue though is I am trying to pass some of the fields to the code and I can't seem to get it to work.

I have tried using {$Name_value}, $Name_value as a test, but all I see is $Name_value in the calendar file, so anyone have any pointers for me?