How to embed and display Google Calendar in Zotonic for Erlang CMS

I would like to be able to save the Google Calendar iframe as a medium and then bind it to a resource. I could not get this working.

I saved the iframe code as a multimedia element, selecting the inline code and selecting the β€œother” I created rsc and attached this multimedia element to it. I either do not refer to it correctly in the template or in the element it is not stored properly. Can someone shed some light on how to do this. I'm sorry if this is a simple thing, but I just can't seem to figure it out.

Significant appreciation.

Jeff

+3
source share
1 answer

It is decided:

, . .

  • Google Calender ( ).
  • Zotonic Calendar
  • . " ", , "" " " . id 387.
  • - Media- > Document .
  • rsc . 388, slug "building-project"
  • , , rsc .

, - /calendars/ [id]/[slug]

{calendar_details, [ "calendar", id, slug], resource_page, [{template, "calendar_details.tpl" }, {cat, calendar}]},

"" , - /calendars/ 388/building-project

_details.tpl

 {% for m in  m.rsc[id].media %} {# this returns a list of the media attached.  Unfortunately I'm assuming only one item returned [387] #}
   {% media m %} {# apply the media tag to the elements in this list, ie  media 387 #}
 {% endfor %}

, , - , , :)

!

+4

Source: https://habr.com/ru/post/1794336/


All Articles