• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: [SOLVED] Calguy colour by category
PostPosted: Mon Jun 11, 2012 10:06 pm 
Offline
New Member

Joined: Tue Sep 06, 2011 10:01 pm
Posts: 4
Hi,
I know a similar question ahs been asked previously but I am struggling. I am using the code suggested on:
viewtopic.php?f=7&t=58434

yet for some reason, regardless of the category I assign an event to, they are all being given the class of 1. Am i misssing something really simple?


Last edited by themiliton on Mon Jun 18, 2012 4:22 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Calguy colour by category
PostPosted: Wed Jun 13, 2012 5:51 pm 
Offline
Administrator
Administrator
User avatar

Joined: Thu Mar 09, 2006 5:32 am
Posts: 11818
Location: Arizona
You need to give a more detailed explanation of what your doing and how your doing it, notice how they posted their whole template...

viewtopic.php?f=40&t=2661

_________________
Extensions » Modules/Tags click the name of the module/tag or Help to the right to get its parameters.
Right click and view source is a great way to see what you have to work with.
Check ver. CMSMS, PHP, server OS, in System Information page.
Default content http://multiintech.com/defaultcontent/
People are Wonderful
Business is Great
Life is Terrific
Ever wonder what happened to the Album module? Well it is alive and well.
http://album.multiintech.com/
Image


Top
 Profile  
 
 Post subject: Re: Calguy colour by category
PostPosted: Sun Jun 17, 2012 11:06 am 
Offline
New Member

Joined: Tue Sep 06, 2011 10:01 pm
Posts: 4
OK, sorry about my lack of detail.

I have different categories assigned to different events, and want to colour code by category, in a list of upcoming events.

My Calendar template for this is as follows:


{if isset($pastitems) && $pastitems == 1}
<h1>{$lang.past_events}</h1>
{else}
<div class="upcoming"></div>
<div class="header1">Upcoming Classes</div>
{/if}

{foreach from=$events key=key item=event}
<div class=classes><a href="{$event.url}"
{if isset($event.categories)}
class="{foreach from=$event.categories item=category}{$category.category_name} {/foreach}"
{/if}
>{$event.event_title}</a></div>
<div class="info">
{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}

{$event.event_date_start|date_format:"%e"} {$month_names[$month_number]} {$event.event_date_start|date_format:"%Y %H:%M"}
{else}
{if $event.event_date_start|date_format:"%d%m%Y" == $event.event_date_end|date_format:"%d%m%Y"}
{$event.event_date_start|date_format:"%e"} {$month_names[$month_number]} {$event.event_date_start|date_format:"%Y %H:%M"} {$lang.to} {$event.event_date_end|date_format:"%H:%M"}
{else}

{$event.event_date_start|date_format:"%e"} {$month_names[$month_number]} {$event.event_date_start|date_format:"%Y %H:%M"} {$lang.to} {$event.event_date_end|date_format:"%d"} {$month_names[$end_month_number]} {$event.event_date_end|date_format:"%Y %H:%M"}
{/if}
{/if}
</div>
{/foreach}

{if $return_url != ""}
<div class="calendar-returnlink">{$return_url}</div>
{/if}


Now my knowledge isn't great but from what I read on the previous page that I linked to, I thought this should apply a class with the category name (or id number, either is good), but instead, all elements are given the class of 1.

The html being produces is as follows:


<div class="upcoming"></div>
<div class="header1">Upcoming Classes</div>

<div class=classes><a href="http://mischiefmanagedsl.com/index.php?mact=CGCalendar,cntnt01,default,0&amp;cntnt01event_id=1723&amp;cntnt01display=event&amp;cntnt01detailpage=&amp;cntnt01return_id=58&amp;cntnt01returnid=58"
class="1 "
>Class2</a></div>
<div class="info">

18 June 2012 12:00
</div>
<div class=classes><a href="http://mischiefmanagedsl.com/index.php?mact=CGCalendar,cntnt01,default,0&amp;cntnt01event_id=2&amp;cntnt01display=event&amp;cntnt01detailpage=&amp;cntnt01return_id=58&amp;cntnt01returnid=58"
class="1 "
>Class1</a></div>
<div class="info">

20 June 2012 17:00
</div>
<div class=classes><a href="http://mischiefmanagedsl.com/index.php?mact=CGCalendar,cntnt01,default,0&amp;cntnt01event_id=1724&amp;cntnt01display=event&amp;cntnt01detailpage=&amp;cntnt01return_id=58&amp;cntnt01returnid=58"
class="1 "
>Class2</a></div>
<div class="info">

25 June 2012 12:00
</div>
<div class=classes><a href="http://mischiefmanagedsl.com/index.php?mact=CGCalendar,cntnt01,default,0&amp;cntnt01event_id=3&amp;cntnt01display=event&amp;cntnt01detailpage=&amp;cntnt01return_id=58&amp;cntnt01returnid=58"
class="1 "
>Class1</a></div>
<div class="info">

27 June 2012 17:00
</div>
<div class=classes><a href="http://mischiefmanagedsl.com/index.php?mact=CGCalendar,cntnt01,default,0&amp;cntnt01event_id=1725&amp;cntnt01display=event&amp;cntnt01detailpage=&amp;cntnt01return_id=58&amp;cntnt01returnid=58"
class="1 "
>Class2</a></div>
<div class="info">

2 July 2012 12:00
</div>



</div>



Thanks in advance for the help, and sorry about the previous lack of detail. If you need my actual site template or anything else, please let me know!


Top
 Profile  
 
 Post subject: Re: Calguy colour by category
PostPosted: Sun Jun 17, 2012 8:09 pm 
Offline
Administrator
Administrator
User avatar

Joined: Thu Mar 09, 2006 5:32 am
Posts: 11818
Location: Arizona
I spent a couple hours trying to get this to work and finally had to get calguy1000 to help, this will output the category of the event...

{assign var='tmp' value=$event.categories|@array_keys}{','|implode:$tmp}

_________________
Extensions » Modules/Tags click the name of the module/tag or Help to the right to get its parameters.
Right click and view source is a great way to see what you have to work with.
Check ver. CMSMS, PHP, server OS, in System Information page.
Default content http://multiintech.com/defaultcontent/
People are Wonderful
Business is Great
Life is Terrific
Ever wonder what happened to the Album module? Well it is alive and well.
http://album.multiintech.com/
Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Arvixe - A CMSMS Partner