Calendar help part 2
Posted: Tue Mar 14, 2006 4:48 pm
I managed to get the calendarr to show- but now i get a messed up format. Any idea how to fix this?
[attachment deleted by admin]
[attachment deleted by admin]
Content management as it is meant to be
https://forum.cmsmadesimple.org/
Code: Select all
#cmscal {
width: 98%;
border: 4px double #385C72;
margin: auto
}
#cmscal .calendar-prev {
font-size: 1.6em;
}
#cmscal .calendar-month {
font-weight: bold;
}
#cmscal .calendar-next {
font-size: 1.6em;
}
#cmscal td {
width: 14%;
border: 1px solid #ddd;
margin: 0;
padding: 4px;
background-color: #ececec;
}
#cmscal .calendar-today{color: red; font-weight:bold;}
#cmscal th {
border-bottom: 2px double #999;
color: #385C72;
}
#cmscal tr {
vertical-align: top;
}
#cmscal ul {
margin: 0;
padding: 0;
list-style: none
}
#cmscal li { border-bottom: 1px dotted #bbb;}
#cmscal a, #cmscal a:link, #cmscal a:visited {
font-size: .8em;
color: blue;
text-decoration: none;
}
.calendar-date-from {font-size: 120%; font-weight: bold; padding: 5px 0; color: #007700;}
.calendar-summary{padding: 0 0 5px 0; color: #bb0000;}
hmm... I thought this was in module's help page. Maybe in less detail though.mrk wrote: Thanks I needed this!![]()
Reduce padding, it must help.How can I get the days in the upper left corner? and to get the day boxes not to stretch wehn a even is in?
Code: Select all
{cms_module module='Calendar' table_id='big'}
Code: Select all
/* make all links red */
.calendar tr td a
{
color: red;
}
/* highlight "today" for the small calendar */
.calendar-today
{
font-weight: bold;
}
/* display the "upcominglist" as one line per entry (assuming table_id='cal-upcominglist') */
#cal-upcominglist .calendar-date-title
,#cal-upcominglist .calendar-summary-title
{
display: none;
}
#cal-upcominglist h2
,#cal-upcominglist .calendar-date
,#cal-upcominglist .calendar-summary
{
display: inline;
margin-right: 5px;
}
/* tidy up text sizes for lists */
#cal-list h1, #cal-upcominglist h1
{
color: red;
font-size: 120%;
}
#cal-list h2, cal-upcominglist h2
{
font-size: 110%;
}
/** large calendar rules (assuming table_id='big') **/
/* border on for #big */
#big{
margin: 0px;
border-collapse: collapse;
border: 1px solid black;
}
/* nice squares for the #big table */
#big th
{
border: 1px solid black;
padding: 3px;
width: 75px;
}
#big td {
border: 1px solid black;
vertical-align: top;
padding: 3px;
height: 75px;
width: 75px;
}
/* format summaries nicely in #big */
#big ul
{
margin: 0px;
padding: 0px;
padding-left: 5px;
}
#big li
{
list-style-type: none;
padding: 0px;
margin: 0px;
}
/* background colours for #big */
#big td
{
background-color: silver;
}
#big .calendar-day
{
background-color: #80ff80;
}
#big .calendar-today
{
font-weight: normal;
background-color: #8080ff;
}
.calendar-event .calendar-date-title,
.calendar-event .calendar-summary-title,
.calendar-event .calendar-details-title
{
display: none;
}
Code: Select all
{strip}
<table class="calendar" id="{$table_id}">
{if $compact_view neq 1}
<caption class="calendar-month">
<span class="calendar-prev"><a href="{$navigation.prev}">«</a></span>
{$month_names[$month]} {$year}
<span class="calendar-next"><a href="{$navigation.next}">»</a></span>
</caption>
{/if}
<tbody><tr>
{foreach from=$day_names item=day key=key}
<th abbr="{$day}">{$day_short_names[$key]}</th>
{/foreach}</tr>
<tr>
{* initial empty days *}
{if $first_of_month_weekday_number > 0}
<td colspan="{$first_of_month_weekday_number}" class="calendar-empty"> </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>
{/if}
{* current day *}
{if $day.class}
<td class="{$day.class}">
{* events *}
{elseif $day.events.0}
<td class="calendar-events">
{* weekend *}
{elseif $weekday == 5 or $weekday == 6}
<td class="calendar-weekend">
{* weekday *}
{else}
<td class="calendar-day">
{/if}
{if $day.events.0}<a href="{$day.url}">{$key}</a>
{if $summaries == true}
<ul>
{foreach from=$day.events item=event}
<li><a href="{$event.url}">{$event.event_title}</a></li>
{/foreach}
</ul>
{/if}
{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}" class="calendar-empty"> </td>
{/if}
</tr>
</tbody></table>
{/strip}
Code: Select all
/* make all links red */
.calendar tr td a
{
color: white
}
/* highlight "today" for the small calendar */
.calendar-today
{
font-weight: bold;
}
/* display the "upcominglist" as one line per entry (assuming table_id='cal-upcominglist') */
#cal-upcominglist .calendar-date-title
,#cal-upcominglist .calendar-summary-title
{
display: none;
}
#cal-upcominglist h2
,#cal-upcominglist .calendar-date
,#cal-upcominglist .calendar-summary
{
display: inline;
margin-right: 5px;
}
/* tidy up text sizes for lists */
#cal-list h1, #cal-upcominglist h1
{
color: red;
font-size: 120%;
}
#cal-list h2, cal-upcominglist h2
{
font-size: 110%;
}
/** large calendar rules (assuming table_id='big') **/
/* border on for #big */
#big{
margin: 0px;
border-collapse: collapse;
border: 1px solid black;
}
#big .calendar-link
{
float: left;
}
/* nice squares for the #big table */
#big th
{
border: 1px solid black;
padding: 3px;
width: 75px;
}
#big td {
border: 1px solid black;
vertical-align: top;
padding: 3px;
height: 75px;
width: 75px;
}
/* format summaries nicely in #big */
#big ul
{
margin: 0px;
padding: 0px;
padding-left: 5px;
}
#big li
{
list-style-type: none;
padding: 0px;
margin: 0px;
}
/* background colours for #big */
#big th
{
color: white;
background-color: #475675;
}
#big .calendar-empty
{
background-color: LightGray;
}
#big .calendar-today
{
font-weight: normal;
color: white;
background-color: #FF7F47;
}
#big .calendar-events
{
background-color: #D44026;
}
#big .calendar-weekend
{
background-color: #BFEFFF;
}
#big .calendar-day
{
background-color: white;
}
.calendar-event .calendar-date-title,
.calendar-event .calendar-summary-title,
.calendar-event .calendar-details-title
{
display: none;
}
.calendar-upcominglist
{
margin-bottom: 25px;
}
.calendar-event .calendar-summary
{
margin-bottom: 10px;
}
Hi amygdela,amygdela wrote: But now i'm having problems with the prettylinks and this calendar.
jeffunk wrote: Hi,
Here's a picture of what my calendar looks like, just for reference.
What Greg means by
"associate the calendar css file with the template"
is that you need to tell cmsms to use the new css file that you just created. To do this:
1. login to the admin utility
2. Go to Layout --> Stylesheets
3. Click add new stylesheet call it "calendar"
4. Paste in Gregs work
5. Then go to Layout --> Templates
6. Find the template that you are using for the sheet with the calendar on it
7. Click the CSS button on the right
8. Find your new stylesheet
9. Click the Add button and go and have a look at the calendar page, you should notice some changes!
Good luck, Jeff