[SOLVED] - Calendario: passare $event.title all'attributo "title" del tag <a>

La discussione sul CMS Made Simple in italiano.

Moderator: magallo

Post Reply
mox
Forum Members
Forum Members
Posts: 113
Joined: Wed Feb 08, 2006 2:32 pm

[SOLVED] - Calendario: passare $event.title all'attributo "title" del tag <a>

Post by mox »

Ciao a tutti,
ho un problema con  il calendario.
Ho bisogno di attivare il popup al passaggio del mouse sulla data dove c'è un evento; quello che normalmente è gestito dall'attributo title del tag .
Il mio calendario mostra solo le date, senza niente altro; per questo attivare la funzione è importante.
Uno screenshot:
Image

Il mio template:

Code: Select all

{strip}
<table class="calendar" id="cal-showc">
{if $compact_view neq 1}
<caption class="calendar-month"><span class="calendar-prev"><a href="{$navigation.prev}">{cms_module module="TruetypeText" style="03frecce" text="<"}</a></span><span class="mese-anno"> {cms_module module="TruetypeText" style="02titcal" text=$month_names[$month]} {cms_module module="TruetypeText" style="02titcal" text=$year} </span><span class="calendar-next"><a href="{$navigation.next}">{cms_module module="TruetypeText" style="03frecce" text=">"}</a></span></caption>
{/if}
<tbody><tr class="n_giorni">

{foreach from=$day_names item=day key=key}
<th abbr="{$day}">{$day_short_names[$key]}</th>
{/foreach}</tr>

<tr class="date">
{* initial empty days *}
{if $first_of_month_weekday_number > 0}
<td colspan="{$first_of_month_weekday_number}"> </td>
{/if}

{* iterate over the days of this month *}
{assign var=weekday value=$first_of_month_weekday_number}

{foreach from=$days item=day key=key}
{if $weekday == 7}
	{assign var=weekday value=0}
</tr>
<tr class="date">
{/if}


<td {if isset($day.events.0) && isset($day.class)} class="giorno-evento"{/if} {if isset($day.class)}class="{$day.class}"{/if} {if isset($day.events.0)} class="event"{/if}>
{if isset($day.events.0)}<a href="{$day.url}" title="{$event.title}]">{$key}</a>

{else}{$key}{/if}
</td>
{math assign=weekday equation="x + 1" x=$weekday}
{/foreach}

{* remaining empty days *}
{if $weekday != 7}
<td colspan="{math equation="7-x" x=$weekday}"> </td>
{/if}


</tr>
</tbody></table>

{/strip}
Ho provato a inserire, primo o dopo, un ciclo {foreach} annidato per intercettare il titolo evento:

Code: Select all

[...]
{foreach from=$day.events item=event}
{foreach from=$days item=day key=key}
{if $weekday == 7}
	{assign var=weekday value=0}
</tr>
<tr class="date">
{/if}


<td {if isset($day.events.0) && isset($day.class)} class="giorno-evento"{/if} {if isset($day.class)}class="{$day.class}"{/if} {if isset($day.events.0)} class="event"{/if}>
{if isset($day.events.0)}<a href="{$day.url}" title="{$event.title}">{$key}</a>

{else}{$key}{/if}
</td>
{math assign=weekday equation="x + 1" x=$weekday}
{/foreach}
{/foreach}
[..]
Ma come output ho soltanto una "S".
Non capisco
dove sbaglio?

Grazie
MoX



=======================

Ok, ho risolto.
Praticamente, ispezionando il template di default, ho isolato il ciclo {foreach} di gestione dei titoli e sommario evento e l'ho inserito direttamente dentro a title, così:

Code: Select all

<a href="{$day.url}" title="{if $summaries == true}{foreach from=$day.events item=event}{$event.event_title}{/foreach}{/if}">{$key}</a>
Byz
MoX
Last edited by mox on Fri Feb 05, 2010 5:00 pm, edited 1 time in total.
Post Reply

Return to “Italian - Italiano”