One of the most powerful feature of CalendarXP is the theme support. Themes are like clothes of the calendar and can be switched back and forth to create different looks in seconds. In addition to using the bundled high quality themes you may also customize your own to perfectly match the tone of your web page.
A theme defines all the customizable options that control the look&feel of the calendar, like colors, fonts, sizes and layout. A theme usually consists of 5 parts - don't be scared, it's actually quite simple to deal with them.
As a simplest example the "supermini" theme has only 3 parts - the supermini.js, supermini.css and a simple calendar tag.
More complicated examples like the "outlook" theme have more - outlook.js, outlook.css, plugins.js, button images and the calendar tags, as following:
<iframe width=152 height=163 name="gToday:outlook:agenda.js" id="gToday:outlook:agenda.js" src="ipopeng.htm" scrolling="no" frameborder="0" style="visibility:visible; z-index:999; position:absolute; left:-500px; top:0px;">
<LAYER name="gToday:outlook:agenda.js" src="npopeng.htm"> </LAYER>
</iframe>
Some extra functions are defined in the plugins.js
to emulate
the internal dropdown selector.
Generally, you'll need the following steps:
themes/outlook
dir and pick up the calendar tag(s)
from the outlook.htm.src="/myweb/engines/iflateng.htm"
./myweb/engines/
. If you place them somewhere else,
you'll have to specify the absolute web path in the name & id properties.gfPop.fPopCalendar()
function in the onclick events
of HTML tags so that it can be triggered by the user. Note: The location of the theme files are all relative to the engine file. It's not relative to the web page showing the calendar. Thus, you'd better use the absolute path when they are located in a place outside the engine directory to prevent confusion. A good sample could be:
<IFRAME width=102 height=100 name="gToday:/cal/themes/supermini:/cal/agenda/agenda.js" id="gToday:/cal/themes/supermini:/cal/agenda/agenda.js" src="ipopeng.htm" scrolling="no" frameborder="0" style="visibility:visible; z-index:999; position:absolute; left:-500px; top:0px;">
<LAYER name="gToday:/cal/themes/supermini:/cal/agenda/agenda.js" src="npopeng.htm"> </LAYER>
</IFRAME>
Now, it's quite easy to change the look of the calendar. In most cases, just change the "theme-name" in the name & id properties and copy the relevant files to the engine dir (or wherever you theme sits) will do. Please check out the HelloWorld tutorial for examples.
Trick - you may also get it switched by overwritten the current theme with files from another theme but using the current theme name. It could save you a lot of work since the calendar tags in your web page doesn't need to be changed. It's especially useful when you have many calendar pages in your project.
Although quite a few high quality themes have been provided with the release package, they wouldn't cover everybody's favor. So let's brief on how to customize it now.
A calendar comprises 3 sections - top, middle and bottom. They are actually 3 table cells in one vertical column.
We have a diagram here illustrating most CSS used in the theme-name.css
file, as following:
The theme-name.js
file is another major place to check. There
are more than 60 options in it. The file is self-documented and you may
go through and play with it simply with the Notepad. I won't cover all of
them, but only several important ones:
Other common options are:
var gBegin=gToday;
var gEnd=[2020,12,10];
gsNavPrev/gsNavNext
to create the month navigators. gsCalTitle
, and use the HTML code in gsNavPrev/gsNavNext
to create the month navigators.gsCalTitle
only.