Textpattern Forum

You are not logged in. Register | Login | Help

#711 2011-06-02 16:43:09

progre55
Member
Registered: 2006-05-02
Posts: 642

Re: smd_calendar: complete schedule / event / calendar / diary

Stef:

Thanks for all your assistance with my issues. I figured out a work around solution. I am going with a large calendar that fills the space and a custom form to put the event/description inside of the day. This loioks sharp, cuts down a step for the end user & overcomes my issue (ok one of my many issues)

Thanks again for your asistance.

progre55

Offline

#712 2011-06-20 18:52:04

pafruu
Member
From: New Brunswick, Canada
Registered: 2010-01-14
Posts: 65

Re: smd_calendar: complete schedule / event / calendar / diary

Hello, I’ve been using this plugin for a while now and I’ve stumbled upon a situation to which I do not know the answer.

I am currently using the calendar for a baseball team in the area, and they are asking me if it is possible to change the events background colors. Currently I only have one color and I am using two categories for the events: HomeGame and AwayGame.

Is there a way to assign a different event color for each event category?

Is it a CSS issue?

Please let me know

Last edited by pafruu (2011-06-20 20:29:29)


I try, and I try, and I try…. and sometimes I achieve

Offline

#713 2011-06-20 20:12:11

Els
Admin
From: The Netherlands
Registered: 2004-06-06
Posts: 7,388
Website

Re: smd_calendar: complete schedule / event / calendar / diary

Hi pafruu, if I’m not mistaken the plugin adds class="your-category-name" to the table cells by default. So you could add something like

td.homegame {background-color: blue;}
td.awaygame {background-color: red;}

to your stylesheet.


<txp:Els /> ;)
Tag Reference | Unexpected behaviour? Check the tag trace | Still no clue? Check the names of your custom fields

Offline

#714 2011-06-20 20:30:50

pafruu
Member
From: New Brunswick, Canada
Registered: 2010-01-14
Posts: 65

Re: smd_calendar: complete schedule / event / calendar / diary

Just noticed That I didnt specify that I want to change the color of the event specifically.

If I am right, what you are suggesting, Els, changes the color of the cell right?


I try, and I try, and I try…. and sometimes I achieve

Offline

#715 2011-06-20 20:58:14

Els
Admin
From: The Netherlands
Registered: 2004-06-06
Posts: 7,388
Website

Re: smd_calendar: complete schedule / event / calendar / diary

Yes, that’s right, I assumed you needed the cell’s background colour. But I guess you can wrap your event tags in a <span class="<txp:category1 />"> and style td span.homegame and td span.awaygame?


<txp:Els /> ;)
Tag Reference | Unexpected behaviour? Check the tag trace | Still no clue? Check the names of your custom fields

Offline

#716 2011-06-20 21:03:08

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,916
Website

Re: smd_calendar: complete schedule / event / calendar / diary

pafruu wrote:

I want to change the color of the event specifically.

Els is right that the category is added by default to each cell and event (see the classlevels ad eventclasses attributes). Except, I uhhh, can’t get them to work properly right now which is either me being:

a) completely stupid with using my own tags
b) completely stupid in the latest version of the plugin

Either way I’m testing a few things and will get back to you.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

#717 2011-06-20 21:14:52

Els
Admin
From: The Netherlands
Registered: 2004-06-06
Posts: 7,388
Website

Re: smd_calendar: complete schedule / event / calendar / diary

Stef, I’m not getting an eventclass either. I assumed that is because I’m using an eventform, could that be it?


<txp:Els /> ;)
Tag Reference | Unexpected behaviour? Check the tag trace | Still no clue? Check the names of your custom fields

Offline

#718 2011-06-20 21:19:53

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,916
Website

Re: smd_calendar: complete schedule / event / calendar / diary

Els wrote:

Stef, I’m not getting an eventclass either. I assumed that is because I’m using an eventform, could that be it?

I thought so too at first, but I’ve tried a vanilla tag (using the default output) and it’s still not showing any event classes. I’ve put some extra debug output into the plugin and it’s showing me that the event classes are being detected and catalogued correctly, but are being destroyed before they’re logged against the event itself. Can’t for the life of me see why.

Special retardo-coder-goggles *on*


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

#719 2011-06-20 22:08:10

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,916
Website

Re: smd_calendar: complete schedule / event / calendar / diary

Well, I was being dim. I was unable to figure out why there were no category event classes showing up… when none of my events actually had a Category1 or Category2 set. *slap*

But nonetheless I’ve released a bugfix version 0.52 which addresses a minor annoyance whereby some classes had spurious spaces before them, e.g. class=" some_class">. That no longer happens.

Regardless of whether you use the stock output or a container (though cellforms will need building manually) you’ll get the category names — plus classprefix — assigned to each event in a large calendar for you to styles as you see fit, e.g:

span.homegame {background-color: blue;}
span.awaygame {background-color: red;}

(since each event is inside a span by default). fwiw, small calendars aren’t wired that way so you won’t get this functionality.

Please let me know if you don’t experience this and post your tag/container code so I can see if the plugin still needs tazing into shape or if I can help adjust your tags to accomplish what you want.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

#720 2011-06-20 22:14:56

Els
Admin
From: The Netherlands
Registered: 2004-06-06
Posts: 7,388
Website

Re: smd_calendar: complete schedule / event / calendar / diary

Bloke wrote:

(though cellforms will need building manually)

Yes, that makes sense.

Yet another on-the-fly fix :) Thanks, I had noticed these spaces, but assumed it was something I did ;)


<txp:Els /> ;)
Tag Reference | Unexpected behaviour? Check the tag trace | Still no clue? Check the names of your custom fields

Offline

Board footer

Powered by FluxBB