On open/hide settings, when a user open an answer add a css class on the Q/A block.
Thus this enable the ability to show the user which answers has already be consulted.

Comments

stella’s picture

Status: Active » Closed (won't fix)

I'm totally sure I follow what you're requesting. If I understand it correctly, you want me to add a css class to the questions on the faq page if the user has already read that question/answer node page. To be honest, I think the browser should handle it for you with the a:visited state, so I'm not going to add such a css class.

Anonymous’s picture

Title: Add CSS class to allow styling of read/unread state for question » Save open state for question
Status: Active » Closed (won't fix)

Yes, browser can do that. But a:visited state do not allow to access the <a> tag parents. In this case some javascript/jQuery action is needed to access the parent. That's why I opened this ticket to add this javascript action in the module.

stella’s picture

I still don't understand your use case well enough to add this, not that I can see how to reliably - the user may have visited the faq node directly and there wouldn't be any knowledge of that on the faq page.

Anonymous’s picture

Ok, here are the practical case : http://sizemybike.com/faq

Customer of the site want to have a different style when a FAQ has been read.

For a non-expanded QA, here is the HTML code :
<div class="faq-question-answer">...

For an expanded QA, here is the HTML code :
<div class="faq-question-answer expanded">...

All I want to do is add the info indicating the QA has been opened. For example by adding viewed CSS class (or any better word) :
<div class="faq-question-answer viewed">...

With this info a specific CSS style can be applied to the whole

.

I know how to implement it but my goal is to share it to the community.

stella’s picture

Status: Closed (won't fix) » Active

I'll consider it, but may not get time to work on it before the release I'm planning on doing next week. If you do have a patch already done, then I'm more than happy to review.

verta’s picture

Title: Save open state for question » Add CSS class to allow styling of read/unread state for question

Revised title to try to frame issue, feel free to revise further if this does not describe it correctly.

stella’s picture

Title: Save open state for question » Add CSS class to allow styling of read/unread state for question
Status: Closed (won't fix) » Fixed

Added in a faq-viewed class. Note this only applies to faq nodes that have been expanded when using the 'Clicking on question opens/hides answer under question' layout. If the user views a faq node page, or navigates away or refreshes the faq page, then this context is lost and the user will have to expand the question again in order for the class to be applied.

stella’s picture

Released in 6.x-1.12.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.