Macros PDF Print E-mail
Waiting for google calendar...
{gCalMarkup _eventMonth}/{gCalMarkup _eventDay} {gCalMarkup _eventTitle}

While gCalMarkup is easy to use for these simple examples, the templates can become quite complex.  Some of the Joomla! editors (software, not people) don't deal with HTML very well and may alter the templates, potentially breaking them.  gCalMarkup does it's best to tolerate these Joomla! editor idiosyncrasies, but it can't always do so.  The templates may also be accidentally broken by article editors (people) that are not familiar with HTML or don't realize their purpose.

For this reason gCalMarkup has a macro capability.  Templates and tagged HTML may be defined in the Joomla! administrator as a macro with only a macro reference appearing in the articles.  This serves the dual purpose of simplifying the addition of a calendar to an article, as well as preventing accidental changes.

The following is the definition of a macro containing the template for the previous Multiple Events example.

  1. {gCalDefine macro id="template1"
  2.   <table style="border:3px double #135cae; border-collapse:collapse; float: right; width:25%;">
  3.     <tbody id="{gCalMarkup _id}.main">
  4.       <tr style="background-color: #feeab5">
  5.         <td>Waiting for google calendar...</td>
  6.       </tr>
  7.     </tbody>
  8.   </table>

  9.   <div id="{gCalMarkup _id}.mainTemplate.container">
  10.     <table>
  11.       <tbody id="{gCalMarkup _id}.mainTemplate">
  12.         <tr style="background-color: #feeab5">
  13.           <td>{gCalMarkup _eventMonth}/{gCalMarkup _eventDay}</td>
  14.           <td>{gCalMarkup _eventTitle}</td>
  15.         </tr>
  16.       </tbody>
  17.     </table>
  18.   </div>

  19.   {gCalDefine calendar id="f13"; key="n3kquhu5eqnd9u629gf7uphds7g9i2qe%40import.calendar.google.com"; maxDays="1000"}
  20. }

The macro contains everything needed to create the Multiple Events example including the HTML for the table, the template, and the calendar definition (notice that a macro definition can contain nested gCalDefine commands).

Only the following line is required in the actual Joomla article:

  1. {gCalMarkup macro id="template1"}

Notice that the id in the gCalDefine macro command must match the id in the gCalMarkup macro command (be careful not to confuse gCalDefine with gCalMarkup).

Last Updated on Friday, 23 October 2009 17:29
 
Symmetric Designs and gCalMarkup are not affiliated with or endorsed by the Joomla Project or Open Source Matters. The Joomla logo is used under a limited license granted by Open Source Matters, the trademark holder in the United States and other countries. gCalMarkup is not supported or warranted by the Joomla Project or Open Source Matters.