(Solved) Calendar and Page Layout Clashing.

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
Andrew Prior
Forum Members
Forum Members
Posts: 247
Joined: Sun Oct 28, 2007 4:14 am

(Solved) Calendar and Page Layout Clashing.

Post by Andrew Prior »

The page under consideration is here.http://mtisa.myownserver.net/~urbannet/ ... e=calendar
You can see that the left column is being forced below the calendar. If you click on one of the More links in the calendar you will see the correct layout of the page.

This has followed an update of the core to 1.11.9 and CGCalendar t0 1.14.3 I had to update some entries in my calendar templates from

Code: Select all

{$month_names[$month]}
to

Code: Select all

{$date|date_format:'%B'}
, (Thankyou Forum) but otherwise templates are unchanged.

As far as I can see the page layout is only upset when CGCalendar is using a list template. If I use the normal layout like you have for a monthly printed calendar, all is fine. But as soon as I use any template which involves a list; eg anyone of the bloglist templates, or any

Code: Select all

display="*list"
of any kind; eg display="upcominglist", the layout is mucked up.

I have played with the table size, but this makes no different and the problem occurs even if I do not use my table template to display the year list.

Can anyone see what might be happening?
Many thanks. Andrew

The code which inserts the calendar is

Code: Select all

{cms_module module="CGCalendar" display="yearlist" year="2015" listtemplate="urban_calendar_yearlist" detailpage="calendar"} 
The urban_calendar_yearlist template code is

Code: Select all

<div class="calendar-list">

<h1>{$year}{if isset($day) && $day > 0} {/if}{if isset($month) && $month > 0}{$month_names[$month]}{/if}</h1>
{* if isset($navigation)}
{ if isset($navigation.prev)}<span class="calendar-prev"><a href="  {$navigation.prev}">Last Year</a></span>{/if} &nbsp; &nbsp;{if isset($navigation.next)}<span class="calendar-next"><a href="{$navigation.next}">Next Year</a></span>{/if}
{/if *}
{* previous year is {$lang.prev} next year is {$lang.next} *}
<table border="1" cellpadding="2">
<tbody>
<tr>
<td style="width: 10em;"align="left" valign="top"> Date  </td>
<td style="width: 18em;" align="left" valign="top">Title</td>
<td style="width: 28em;"align="left" valign="top">Summary</td>
</tr>
</tbody>
</table>

{foreach from=$events key=key item=event}
 <div class="calendar-event">{assign var=month_number value=$event.event_date_start|date_format:"%m"}
 {assign var=end_month_number value=$event.event_date_end|date_format:"%m"}
 {if $event.event_date_start == $event.event_date_end || $event.event_date_end == 0}

<table border="1" cellpadding="2">



<tbody>
<tr>
<td style="width: 10em;"align="left" valign="top" > <span class="calendar-date-title">{$lang.date}: </span>{$event.event_date_start|date_format:'%e %B'}  {$thedate|date_format:'%B'} {$event.event_date_start|date_format:"%Y"}</td>
<td style="width: 18em;" align="left" valign="top"> <b>{$event.event_title}</b>  </td>
<td style="width: 28em;" align="left" valign="top"> {$event.event_summary}  <a href="{$event.url}">{$mod->Lang('cal_more')}</a></td>
</tr>
</tbody>
</table>
  {else}
   {if $event.event_date_start|date_format:"%d%m%Y" == $event.event_date_end|date_format:"%d%m%Y"}
     <div class="calendar-date-from"><span class="calendar-date-title">{$lang.date}: </span>{$event.event_date_start|date_format:"%e"} {$date|date_format:'%B'}  {$event.event_date_start|date_format:"%Y %H:%M"} {$lang.to} {$event.event_date_end|date_format:"%H:%M"}</div>
 {else}
     <div class="calendar-date-from"><span class="calendar-date-title">{$lang.date}: </span>{$event.event_date_start|date_format:"%e"} {$thedate|date_format:'%B'}  {$event.event_date_start|date_format:"%Y %H:%M"} {$lang.to} {$event.event_date_end|date_format:"%d"} {$thedate|date_format:'%B'}  {$event.event_date_end|date_format:"%Y %H:%M"}</div>
   
   {/if}
 {/if}
 {if $event.event_summary !="" && ($event.event_details =="" ||  $event.event_details == "<br />")}
   <div class="calendar-summary"><span class="calendar-summary-title">{$lang.summary}: </span>{$event.event_summary}
 {/if}
{/foreach}
</div>
Last edited by Andrew Prior on Thu Jan 29, 2015 12:06 pm, edited 1 time in total.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Calendar and Page Layout Clashing.

Post by velden »

First make sure your html validates. It's kind of a mess now:

http://validator.w3.org/check?uri=http% ... oup=0&ss=1

Seems like your not closing some divs or at least in the wrong place.
Andrew Prior
Forum Members
Forum Members
Posts: 247
Joined: Sun Oct 28, 2007 4:14 am

Re: Calendar and Page Layout Clashing.

Post by Andrew Prior »

Crikey! A mess indeed. I have found on extra </div> in the sample template for lists(!?) and removing that means any list template and any use of displaylist in the calender parameters now works.

The validator now registers a different list of errors, but I'm not making a lot of sense of them. Seems like a < or > is missing somewhere, but I can't find that.

I'm guessing there is something in the logic of the calendar template
Andrew Prior
Forum Members
Forum Members
Posts: 247
Joined: Sun Oct 28, 2007 4:14 am

Re: Calendar and Page Layout Clashing.

Post by Andrew Prior »

Finally. A

Code: Select all

<div>
in the wrong place. Done!
Post Reply

Return to “The Lounge”