21278 Posts in 5728 Topics by 2599 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 2128 Views |
-
Embedding Google Calendar to site

5 March 2009 at 1:32pm
I'm trying to embed a Google Calendar to my site but the HTML Editor keeps stripping out the <iframe>. I saw some old posts in the archives about this, but don't have a clue what I'm doing with the TinyMCE. Also, Double-A-Ron has an archive about creating a new page type (CalendarPage) and inserting this code in the "class CalendarPage_Controller extends Page_Controller" section of CalendarPage.php:
public function getGCalHTML()
{
$html = '<iframe src="http://www.google.com/calendar/embed?showCalendars=0&height=600&wkst=1&bgcolor=%233366ff&src=orphanhope%40gmail.com&color=%232952A3&ctz=Africa%2FJohannesburg" style=" border:solid 1px #777 " width="800" height="600" frameborder="0" scrolling="no"></iframe>'return $html;
}But when I do this, I get a parse error for that last line that says "return $html;"
Any help would be appreciated. Thanks!
~ James -
Re: Embedding Google Calendar to site

5 March 2009 at 3:13pm
I've had the some issue, with iframes and onClicks. Silverstripe is being to cleaver and brutally pulling these out. Kind of forces the admin to think of a more compliant way to implement these things.
you're missing a closing semi-colon at the the end of the $html variable, It worked a treat after that.
Hope that helps
-
Re: Embedding Google Calendar to site

5 March 2009 at 3:37pm
Bambii7 thanks for the help!
So should it read like this:
return $html;;
} -
Re: Embedding Google Calendar to site

5 March 2009 at 4:06pm
Um more like
public function getGCalHTML()
{
$html = '<iframe src="http://www.google.com/calendar/embed?showCalendars=0&height=600&wkst=1&bgcolor=%233366ff&src=orphanhope%40gmail.com&color=%232952A3&ctz=Africa%2FJohannesburg" style=" border:solid 1px #777 " width="800" height="600" frameborder="0" scrolling="no"></iframe>';return $html;
}php needs know when you're done defining a statement or variable. It's pretty mush a full stop after a sentace.
$html = 'stuff to print';
The semi-colon at the end of that variable tells php it's the end of that statement. -
Re: Embedding Google Calendar to site

5 March 2009 at 7:51pm
Bambii7 - thank you! That worked perfectly.
~ James
| 2128 Views | ||
|
Page:
1
|
Go to Top |


