As of version 3.9, the Publisher supports creation of dynamic calendar templates, meaning that the template will fit all years and different national preferences. This is achieved by placing special placeholders into the text shape, which will be later replaced with appropriate day, week and year numbers.
Font and color settings can be applied to the placeholders just as to the any text, and will be preserved during replacement.
When the user chooses a product with these placeholders, he will get the following dialog:
First, you need to add a TextSubstitutions parameter to each calender product inside the products.xml. Example:
<PRODUCT id="dm050001" active="1" selected="0" groupid="dm050">
<LongName>Calendar A5 14,8 cm x 21,0 cm</LongName>
<ShortName>14,8 cm x 21,0 cm (A5 portrait)</ShortName>
<FormatWidth>14,8 cm</FormatWidth>
<FormatHeight>21,0 cm</FormatHeight>
<ImageFile>images\dx050.jpg</ImageFile>
<Description format="text/html">...</Description>
<BasePrice>7590</BasePrice>
<VAT>1900</VAT>
<StatusMsg>Calendar A5 14,8 cm x 21,0 cm</StatusMsg>
<EasyMode />
<ExpertMode>aGradient,aTexture</ExpertMode>
<HiddenMode>aGroup,aUnGroup</HiddenMode>
<LayoutFile>layout_dm050001.dtp</LayoutFile>
<TemplateFile></TemplateFile>
<TextSubstitutions>calendar</TextSubstitutions>
<CHUNKS>
<CHUNK title="content">
<Fixed>0</Fixed>
<BasePageCount>13</BasePageCount>
<MaxPageCount>13</MaxPageCount>
<UploadFormat>PDF</UploadFormat>
</CHUNK>
</CHUNKS>
</PRODUCT>
To enable calendar rendering for a product layout in the design mode, you need to define it for each text shape separately. This can be achieved by toggling the calendar button in the text edit dialog:
Available placeholders
{year}
|
Will be replaced by the year which the user enters in the dialog after selecting the product, e.g 2016.
|
{month:X}
|
Indicates the month, to which the day cells {cXrY} are related. This placeholder is mandatory.
This placeholder can be placed anywhere in the text shape and will be removed in the final product.
|
{weekstart:X}
|
Indicates the first day of the week. Can be {weekstart:1} for European-style calendars (Monday is considered the first day of the week), or {weekstart:7} (Sunday) for North American calendars. If you omit this placeholder, the default week start will be 1.
This placeholder can be placed anywhere in the text shape and will be removed in the final product.
|
{wX}
|
Week number, where X is a week of the month from 1 to 6. This placeholder will be later replaced by appropriate number of the week of the year, for example {w1} in December of 2016 will be replaced by 48, the 48th week of the year.
If you don't want to display week numbers, then don't insert the week placeholders.
|
{cXrY}
|
Cell (day) of the month, where X (column) is the day of the week from 1 to 7 and Y (row) is the week of the month from 1 to 6.
|
Example
Below is an example of the calendar-enabled text shape for the month of December:
{w1}
|
{c1r1}
|
{c2r1}
|
{c3r1}
|
{c4r1}
|
{c5r1}
|
{c6r1}
|
{c7r1}
|
{w2}
|
{c1r2}
|
{c2r2}
|
{c3r2}
|
{c4r2}
|
{c5r2}
|
{c6r2}
|
{c7r2}
|
{w3}
|
{c1r3}
|
{c2r3}
|
{c3r3}
|
{c4r3}
|
{c5r3}
|
{c6r3}
|
{c7r3}
|
{w4}
|
{c1r4}
|
{c2r4}
|
{c3r4}
|
{c4r4}
|
{c5r4}
|
{c6r4}
|
{c7r4}
|
{w5}
|
{c1r5}
|
{c2r5}
|
{c3r5}
|
{c4r5}
|
{c5r5}
|
{c6r5}
|
{c7r5}
|
{w6}
|
{c1r6}
|
{c2r6}
|
{c3r6}
|
{c4r6}
|
{c5r6}
|
{c6r6}
|
{c7r6}
|
{weekstart:1}
|
{month:12}
|
|
|
|
|
|
|
In the year 2016 calendar, this will be rendered as:
|
You can use the dynamic calendar feature to create static calendar layouts, if you want to add holidays and special events like birthdays. For this you need to:
• | Start the Publisher as a user (no design mode) and create a custom calendar from your dynamic calendar layout. |
• | Add custom dates to this calendar, and store this project as a replacement for the dynamic layout file, which is included in the next setup creation. |
|
|