Problem:
I have a website that is a reference website for a series of books. It
has spoilers for the books all over the place. New readers of the series
would like to visit the site but avoid spoilers. Most of these spoilers
are in list items.
Solution:
What I'd like to do is to have a Settings page that contains checkboxes
for each book in the series. Checking or unchecking a book sets the
cookie value for that book. I would also like a CSS class for each book
and have that CSS class change based on the cookie value for that book.
The value would change from "display" to 'hidden" based on that value.
Example:
There's a checkbox for the book "The Eye of the World" and that changes
the value of the "teotw" cookie and one for "The Dragon Reborn" that
changes the values of the "tdr" cookie. The raw HTML might look like this:
<li class="teotw">Here's something that happened to Rand (TEotW,Ch4)</li>
<li class="tdr">Here's something else that happened to Rand (TDR,Ch25)</li>
Questions:
1. Is there any way to set the CSS class of individual list items?
Right now, I just see "*" and "#" for list items, with no way to add
a CSS class to it. This might kill the whole idea right here.
2. I've followed the instructions to create a form using FormOutput,
etc, and it looks like I'll need to create some plugin, like
SpoilerPlugin, to handle the form submission by taking the checkbox
values and setting the appropriate cookies. Does this sound correct?
3. Is there a better way to do this in JSPWiki, or is it just not possible?
Thanks,
Gary
--
Gary Kephart
Facebook: gary.kephart
Twitter: @garykephart
"The penalty that good men pay for not being interested in politics is to be
governed by lesser men." -- Plato.