How to Add a Widget?

137 views
Skip to first unread message

MJ Wong

unread,
Dec 18, 2016, 11:09:22 PM12/18/16
to MediaWiki Widgets
Hello,

I have followed the installation instructions successfully and now have the Widgets namespace.  The part I am stuck on is how do I install each individual widget?  From what I understand, I have to create a page in the Widget namespace for each widget and paste some code on that page.  Where do I get that code?  I am trying to install the Google Calendar widget but the source code I am given to paste is the following..

<noinclude>
This widget allows you to add '''[http://www.google.com/calendar/embedhelper Google Calendar]''' widget to your wiki page.

It was originally created by [https://www.mediawiki.org/wiki/User:Sergey_Chernyshev Sergey Chernyshev] for [http://www.techpresentations.org/Conferences#Current_.26_Upcoming_conferences upcoming conference calendar] on TechPresentations.org

== Using this widget ==
For information on how to use this widget, see [https://www.mediawikiwidgets.org/Google_Calendar widget description page on MediaWikiWidgets.org].

== Copy to your site ==
To use this widget on your site, just install [https://www.mediawiki.org/wiki/Extension:Widgets MediaWiki Widgets extension] and copy the [{{fullurl:{{FULLPAGENAME}}|action=edit}} full source code] of this page to your wiki as page '''{{FULLPAGENAME}}'''.
</noinclude><includeonly><iframe src="//www.google.com/calendar/<!--{if isset($app)}-->hosted/<!--{$app|escape:'urlpathinfo'}-->/<!--{/if}-->embed?<!--{if isset($title)}-->title=<!--{$title|escape:'urlpathinfo'}-->&amp;<!--{/if}--><!--{if isset($pvttk)}-->pvttk=<!--{$pvttk|escape:'urlpathinfo'}-->&amp;<!--{/if}--><!--{if is_array($id)}--><!--{foreach from=$id item=i}-->src=<!--{$i|escape:'urlpathinfo'}-->&amp;<!--{/foreach}--><!--{else}-->src=<!--{$id|escape:'urlpathinfo'}-->&amp;<!--{/if}--><!--{if is_array($color)}--><!--{foreach from=$color item=c}-->color=%23<!--{$c|escape:'urlpathinfo'}-->&amp;<!--{/foreach}--><!--{else}-->color=%23<!--{$color|escape:'urlpathinfo'}-->&amp;<!--{/if}-->height=<!--{$height|escape:'urlpathinfo'|default:600}-->&amp;showTitle=<!--{if isset($showtitle) and not $showtitle}-->0<!--{else}-->1<!--{/if}-->&amp;showNav=<!--{if isset($shownav) and not $shownav}-->0<!--{else}-->1<!--{/if}-->&amp;showDate=<!--{if isset($showdate) and not $showdate}-->0<!--{else}-->1<!--{/if}-->&amp;showTabs=<!--{if isset($showtabs) and not $showtabs}-->0<!--{else}-->1<!--{/if}-->&amp;showCalendars=<!--{if isset($showcals) and not $showcals}-->0<!--{else}-->1<!--{/if}-->&amp;showPrint=<!--{if isset($showprint) and not $showprint}-->0<!--{else}-->1<!--{/if}-->&amp;showTz=<!--{if isset($showtz) and not $showtz}-->0<!--{else}-->1<!--{/if}-->&amp;wkst=<!--{$weekstart|escape:'urlpathinfo'|default:1}-->&amp;hl=<!--{$lang|escape:'urlpathinfo'|default:en}-->&amp;mode=<!--{$view|escape:'urlpathinfo'|default:MONTH}-->&amp;<!--{if isset($dates)}-->dates=<!--{$dates|escape:'urlpathinfo'}-->&amp;<!--{/if}--><!--{if isset($timezone)}-->ctz=<!--{$timezone|escape:'urlpathinfo'}-->&amp;<!--{/if}--><!--{if isset($bgcolor)}-->bgcolor=%23<!--{$bgcolor|escape:'urlpathinfo'}--><!--{/if}-->" width="<!--{$width|escape:'html'|default:'100%'}-->" height="<!--{$height|escape:'html'|default:600}-->" frameborder="0" scrolling="no"<!--{if isset($border)}--> style="border: solid 1px #777"<!--{/if}--><!--{if isset($style)}--> style="<!--{$style|escape:'html'}-->"<!--{/if}-->></iframe></includeonly>

That just creates a nice looking about page.  I've spent the last 45 minutes trying to search and find instructions but I couldn't find anything.

Thank you very much in advance for your assistance.

Sergey Chernyshev

unread,
Dec 18, 2016, 11:15:42 PM12/18/16
to mediawik...@googlegroups.com
Now when you copied the code you have into http://www.yourwiki.com/Widget:Google_Calendar you can use the code like this on regular pages of your wiki to include the calendars:

{{#widget:Google Calendar
|id=p2m2av9dhrh4n...@group.calendar.google.com
|color=2952A3
|id=u...@holiday.calendar.google.com
|color=B1440E
|title=NYCResistor, US Holidays
}}

(sample code copied from here: https://www.mediawikiwidgets.org/Google_Calendar)

Hope this helps.

        Sergey


--
Sergey Chernyshev
http://www.sergeychernyshev.com/

--
You received this message because you are subscribed to the Google Groups "MediaWiki Widgets" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mediawiki-widgets+unsubscribe@googlegroups.com.
To post to this group, send email to mediawiki-widgets@googlegroups.com.
Visit this group at https://groups.google.com/group/mediawiki-widgets.
For more options, visit https://groups.google.com/d/optout.

MJ Wong

unread,
Dec 20, 2016, 10:18:55 AM12/20/16
to MediaWiki Widgets
Hi Sergey,

Thanks for the help.

When I use the same code or my own calendar id i get an error message that says, 'Fatal exception of type "Error"'.

Matt


On Sunday, December 18, 2016 at 11:15:42 PM UTC-5, Sergey Chernyshev wrote:
Now when you copied the code you have into http://www.yourwiki.com/Widget:Google_Calendar you can use the code like this on regular pages of your wiki to include the calendars:

To unsubscribe from this group and stop receiving emails from it, send an email to mediawiki-widg...@googlegroups.com.
To post to this group, send email to mediawik...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages