Confiforms Calendar view - change background colour of calendar event title field
Asked by JN:

Hi,

Can you tell me if it's possible to display different colours (based on selecting say 1,2,3,4 from a drop down field in the main confiform) that then dictates to the background colour of the calendar event title field shown in the calendar view?

Thanks

Jonathan


Answers:
author: Alex Medved _ConfiForms_
body: Hi

This is totally possible, as with any other ConfiForms "view" - see <https://wiki.vertuna.com/display/CONFIFORMS/Visual+customisations+in+ConfiForms+views+based+on+the+data+stored+in+the+fields+with+CSS+rules>

(note the important warning block specifically for CalendarView on the bottom of the page)

Alex

comments: author: JN
body: Hi Alex,

Thanks for your prompt reply - I've been trying to get it to work without success in the calendar view so I added a table view with the same details and it works in that view - is there something I need to consider for the calendar view?

This is what I'm trying to achieve; I have a GroupingFieldName as Date, the "calendar even title" field is for example field1 which displays in the calendar view on the given date and is the field I want to have the text / background changed on and ideally I'd like the colours to be controlled by a field2 (dropdown with 5 options) - different colour for each option.

The idea then is when you select the respective option from the dropdown field2, it sets the colour displayed in the calendar of the entry in field1 after it's saved.

If you could advise if that's possible and how to go about it that would be appreciated

Thanks again,

Jonathan


author: Alex Medved _ConfiForms_
body: Hi Jonathan

Yes, that is totally possible and the link with an example I have shared earlier

Hard to tell what did not worked out for you as you have not shared really what you have done

You are asking
> is there something I need to consider for the calendar view?

Well, there is.. and it was mentioned in my previous answer
> (note the important warning block specifically for CalendarView on the bottom of the page)

Here is a demo <http://recordit.co/AqkNap7haA>

Hope that helps

Alex


author: JN
body: Hi Alex,

Yes I saw that warning but I don't really understand what they mean by " use the same field you're using for grouping"? does that limit me in terms of what I'm trying to do?

I'm using the "Date" field for grouping but it's not the field I want to display in the calendar or use to define the colours?

I followed the example which is quite straight forward and it works for the table view but not the calendar view - bar the above I also used the "!important" parameter but it hasn't made a difference?

Thanks

Jonathan


author: Alex Medved _ConfiForms_
body: Have you seen my screencast, I have recorded for you?

That shows you what does it mean to have the same field as for "grouping"... Basically the same field you set for grouping you need to specify in CSS rules

Alex


author: JN
body: I missed it sorry - got it now. I'll review and have a go - thanks again for your help


author: JN
body: I think I've got this to work now - I was using a dropdown field and referencing the Label not the ID

Thanks again for the help


author: Alex Medved _ConfiForms_
body: You can reference ID or LABEL, anything you like and what is more convenient to you. It all depends on the value you want to check against.

Alex


Tags: calendar

confiforms