Thank you again for yesterday: to me, coding my first site with Grav has becomed exciting: I am amazed to be able to code what I code and now I look foward to have nearly everything the way I want, which is exceptionnal if you consider my technical level!
I’d like to ask something that is still technically out of my range.
I would like to have, let’s say for convenience, changing colors in some places for each visit to my site.
For instance, today, first visit, this button is red
but tomorrow, second visit and its may be blue.
Color would change in a range of predefined set colors in css.
In theory, that is probably possible with the session cookie as for the language setting, no?
But how would you do that?
(hoping the question is not to hard)
precision: I am with the antimatter theme modified by a mytheme layer as in the example of learn.getgrav.org…
it’s not difficult, but will require you to write a simple custom plugin that looks for that specific parameter and then sets it on the session. Also you probably want to store the state of the session variable in Twig as a variable so you can reference it from there if needed.
I see … a plugin … right now, it’s out of range of possible, but I have the point and I’ll keep that in mind for later …
Once you have this variable in Twig, do you use it with the random method that appeared somewhere in learn.getgrav.org?
Thank you very much for that answer
I remember a part of learn.getgrav.org is about plugins and how to write them…