| Previous · Next | |
| User | Message |
|
philadev
|
Date: 1/11/2008 3:25 pm · Subject: Calendar Template Help · Rating: 0
I hope someone out there can help me: I'm trying to create a semantic small month view for the calendar. The problem is that I keep getting an error: Couldn't call method view on asset for url: offices/e/example/staging/calendar Root cause: HTML::Template->output() : fatal error in loop output : HTML::Template->output() : fatal error in loop output : HTML::Template::param() : attempt to set parameter 'events' with an array ref - parameter is not a TMPL_LOOP! at /data/wre/prereqs/perl/lib/site_perl/5.8.8/HTML/Template.pm line 2997 The real problem is I can't stop the problem loop and the loop and variable descriptions don't seem to match the variables and loop names in the templates (i.e. dayOfMonth is listed as the tmpl_var but dayMonth is the actual var etc...) I plan to post a few calendar templates based on this to the Add Ons section so any help will hopefully benefit us all. Here's the template:
--- (Edited on 1/11/2008 3:25 pm [GMT-0600] by philadev) --- |
| Back to Top |
Rate [ | ]
|
|
colink
|
Date: 1/11/2008 5:05 pm · Subject: Re: Calendar Template Help · Rating: 5
I've looked at this, and I'm pretty sure that this is due to your use of tmpl_if events, without really using events as a loop inside each if statement. It's an issue with HTML::Template. Here are a few suggestions to try:
--- (Edited on 1/11/2008 5:05 pm [GMT-0600] by colink) --- |
| Back to Top |
Rate [ | ]
|
|
philadev
|
Date: 1/14/2008 11:02 am · Subject: Re: Calendar Template Help · Rating: -8
The empty loops did the trick. Would you mind explaining a bit more about Template::Toolkit? I don't see the optioin and a site search doesn't reveal much. Thanks. --- (Edited on 1/14/2008 11:02 am [GMT-0600] by philadev) --- |
| Back to Top |
Rate [ | ]
|
|
colink
|
Date: 1/14/2008 11:58 am · Subject: Re: Calendar Template Help · Rating: -11
Template::Toolkit is another templating engine. WebGUI has the ability to use HTML::Template, HTML::Template::Expr, and Template::Toolkit as engines. I'm surprised no one has made a wiki article about this already:
The templating sytax is different, and the variable names are a little different due to the different syntax (use _ instead of .), but the templating language is much more powerful. Those are the upsides. The downsides is that it may be slower than HTML::Template, and I haven't actually tested Template::Toolkit to see if it suffers from the same bug as HTML::Template. It may, and may have other bugs as well. --- (Edited on 1/14/2008 11:58 am [GMT-0600] by colink) --- |
| Back to Top |
Rate [ | ]
|
|
Klaus
|
Date: 1/14/2008 12:08 pm · Subject: Re: Calendar Template Help · Rating: -8
Would you mind explaining a bit more about Template::Toolkit? I don't see the optioin and a site search doesn't reveal much. You can use additional template engines in WebGUI. You have to install it, add it to the webgui.conf file for the site, restart WebGUI and then set the Template Type in the options for the style template. The default is HTML::Template Klaus --- (Edited on 14-January-2008 19:08 [GMT+0100] by Klaus) --- |
| Back to Top |
Rate [ | ]
|
|
philadev
|
Date: 1/14/2008 12:51 pm · Subject: Re: Calendar Template Help · Rating: 6
Thank you both. I'm pretty suprised to find out that there is more than one template language available for use with WebGUI, opens up a whole new world really. I'll look into to this.
Thanks again, Nate --- (Edited on 1/14/2008 12:51 pm [GMT-0600] by philadev) --- |
| Back to Top |
Rate [ | ]
|
|
Trex
|
Date: 3/13/2010 11:35 pm · Subject: Re: Calendar Template Help · Rating: -1
I just had the exact same problem for the exact same reason! I was trying to create a mini-month calendar view, and was using the <tmpl_if events> condition without calling the loop within the condition. I wish I'd seen this thread before trying to figure out why my template was not working! I actually figured out the problem and solution on my own, but this thread would have saved me some time, if I'd found it sooner. To help save others time and headaches, I've updated the main wiki page on the template language to include this information. --- (Edited on 2010-03-13 11:35 pm [GMT-0600] by Trex) --- |
| Back to Top |
Rate [ | ]
|