[SOLVED] Global Content Blocks within a Calendar event?

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
User avatar
tophers
Forum Members
Forum Members
Posts: 218
Joined: Thu Jun 07, 2007 7:25 pm
Location: Calgary, Alberta, Canada

[SOLVED] Global Content Blocks within a Calendar event?

Post by tophers »

I have a schedule of on-call personnel that I'm trying to add to a CGCalendar. Since contact info can change, I've put each person into a gbc for ease of editing. I then set up a calendar event for their time period, and want to call the gbc inside the event Details.

So far it will work - once you've clicked on the summary to get to the details page. My problem is I'd like to simply show this info in the summary view, and not have a click-through to a detail page at all. This is where the gbc fails - it simply show the code:

Code: Select all

{global_content name='on-call-john'} 
Rather than displaying the contents of the gbc itself.

I'm calling the calendar with this:

Code: Select all

{cms_module module="CGCalendar" display="upcominglist" upcominglisttemplate="upcoming_on_call" category="Environmental On-Call" limit="1"} 
Are gbcs not processed inside the Calendar? Or is there a different way to approach this?
Last edited by tophers on Mon Feb 25, 2013 6:32 pm, edited 1 time in total.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Global Content Blocks within a Calendar event?

Post by calguy1000 »

use the smarty {eval} tag...see the smarty docs..
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
User avatar
tophers
Forum Members
Forum Members
Posts: 218
Joined: Thu Jun 07, 2007 7:25 pm
Location: Calgary, Alberta, Canada

Re: Global Content Blocks within a Calendar event?

Post by tophers »

That looks like it may work, but I confess it's beyond my limited (but ever-expanding!) programming skills. I want to set up multiple calendar events, each one calling a different gbc (person). How would I use the {eval} tag in my template to accomplish this?

At first glance it looks like my GBC needs to be set up like:

Code: Select all

name = First Last
Cel = 123-456-7890
Home = 123-456-7890
Office = 123-456-7890
Then my Calendar template needs to have:

Code: Select all

{config_load file='{global_content name='on-call-john'} '
{eval var=#name#}
{eval var=#Cel#}
{eval var=#Home#}
{eval var=#Office#}
I'm sure I have errors here already (is 'config_load file' the right syntax?). But even if this worked, how do I change people with each event? Or do I use the above code in the actual Calendar Summary?

This project is starting to show me why I need a full-time programmer on staff again...
User avatar
tophers
Forum Members
Forum Members
Posts: 218
Joined: Thu Jun 07, 2007 7:25 pm
Location: Calgary, Alberta, Canada

Re: Global Content Blocks within a Calendar event?

Post by tophers »

This project is starting to show me why I need a full-time programmer on staff again...

Or just leave it to someone who's brain is running at full capacity - my designer figured it out. In the template (in this case the Summary template for the Calendar), where I'm calling the content, use this:

Code: Select all

{eval var=$event.event_details}
And viola! My GBC is displayed properly. Thanks again Calguy - saved my butt once again.
Post Reply

Return to “Modules/Add-Ons”