How to customise calendar items for Events and News


i've been able customise calendar i'm trying differentiate between event item , news item. both items provide class="events" isn't useful show difference between 2 types of items on calendar.

 

is there way around show event items yellow background , news items blue background. can't find other properties within setup separate two.

 

any appreciated.

 

cheers.

there's no way out-of-the-box event , news calendar.  best bet use javascript/jquery add class depending on url of item.  typically, events start url of /bookingretrieve.aspx , news items have url starts base url setup news posts ("announcements" or "news" etc.).  so, since cannot change url prefix of events can news module, we'll check links on in calendar , if start "/bookingretrieve.aspx" we'll give table cell class events , if not, we'll give class news can use css target it.

 

here's javascript should put in between script tags after module rendered on page:

 

(function($) {

     var links = $(".module-calendar a.event");

      links.each(function() {

          var url = $(this).attr("href");

          var parenttd = $(this).parents("td");


          if (url.match("bookingretrieve.aspx")) {

               parenttd.addclass("event");

          } else {

               parenttd.addclass("news");

          }

     }); 

})(jquery);

 

that jquery script should add classes td element holds links news or event.  once in place can add css screen.css file target new classes added:

 

table.module-calendar td.event {

     background: lightyellow;

}

table.module-calendar td.event span {

     background: yellow;

}

table.module-calendar td.news {

     background: blue;

}

table.module-calendar td.news span {

     background: lightblue;

}

 

you can, of course update colors more specific base css colors , not want once javascript adds classes can target css rules td or spans within them or else in td.



More discussions in How to - HTML / CSS / JavaScript


adobe

Comments

Popular posts from this blog

Thread: gpg: Conflicting Commands

Adobe Acrobat Pro , Terminal Server Use

when i try using AE CC 3d camera tracker after the first step it says "Analysis solve failed." help?