Using conditional formatting would be easy for something like days of the week with monday as blue, tuesday as green, etc. since there are only 7 days in the week and you could create 7 conditionals with 7 colors. The day number of the month would require 31 different colors, doable but not by me. Days of the year 365 colors, etc. The problem could be simplified using odd and even day numbers so that you only need two colors and this is probably betteer since who can remember what light shadown green with a yellow tint means.
Start with a calc for odd even and see if that works for you. Or one for day of the week (1-7).
If you are using 12 some of the templates automaticaly alternate the colors of the list rows so investigating the css in the template might help.
Thanks Jack, some ideas there that I hadn't thought of.
"If you are using 12 some of the templates automatically alternate the colors of the list rows" - FM11 (and maybe earlier) has as 'standard' the option to fill alternate portal rows with a different fill.
Sorbuster: Unfortunately, I'm tryping to group multiple rows together, not alternate rows. E.g. the first 3 rows might be the same colour, the next 2 another colour and the last another colour. The number of rows per 'group' is not fixed.
I understand that, and Jack's ideas are very interesting. I was only adding to Jack's comment: "If you are using 12 some of the templates automatically alternate the colors of the list rows"
To group by quantity create a calculated field that produces a grouping number or use a number field and enter your own number for the group. Sort the portal by the number field to produce
and so on.
Now use your conditional coloring based on the number. You could set it for just a few colors using
mod(nbr;3) = 0 color
mod(nbr;3) = 1 color
mod(nbr;3)= 2 color
nbr = 1 color
nbr = 2 color
Rereading the request I see the problem. Portal rows can be set to alternate the color on an odd/even basis. You want to change the row color when the date changes in the portal row field not on any numbering schema.
The problem is how to determine that one date matches or is different from the date in the previous row PLUS how to determine what color to use which gives us two problems to consider.
A trigger might be used to store check the date field against $$_date and set the result into the flag field. Your color would be based on the flag field.
If the date field = $$_date the flag field = 1 and no color change
if the date field not $$_date then set the flag field to 0 and $$_date to date field
How will this will work in a portal? What are the problem? Did I supply all of the idea? How will it affect performance with a lot of records in the portal?
Thanks again Jack. Was just coming back here to describe the solution I wrote and it pretty much matches yours :-)
Had to add a button + script to add the grouping number to existing records, and I now call that script whenever the field that determines the grouping is exited.
The end result makes a big difference in the readibility of the portal.
I used 4 colours. Could have gotten away with just 2, but 4 proved easiest on the eye.