Personally I think the FAQ Configuration Pages need to be revamped. Currently on the Questions Settings page I think we should show/hide the options that shouldn't be available for each Question display whether it be 'Questions inline' or 'Clicking on question opens/hides answer under question'.

An example of this would be the following.
When the Question display has been set to 'Clicking on question opens/hides answer under question' then the checkbox 'Disable question links to nodes' doesn't need to show.

The reason for this is because the Question link will never take you to the node. It will always hide/show the answer below the Question.

Of course if you need a link to take you to the node then simply check the following two checkboxes ('Use answer teaser' and 'Show node links').

Comments

stella’s picture

marking as D7 stable release blocker

stenjo’s picture

This is actually fairly easy.
For each form element you can add a property like this:

    '#states' => array(
      'visible' => array(':input[name="faq_show_expand_all"]' => array('checked' => TRUE)),
      ),

So that the field on 'Show node links' becomes:

  $form['faq_questions_misc']['faq_show_node_links'] = array(
    '#type' => 'checkbox',
    '#title' => t('Show node links'),
    '#description' => t('This enables the display of links under the answer text on the faq page.  Examples of these links include "Read more", "Add comment".'),
    '#default_value' => variable_get('faq_show_node_links', FALSE),
    '#states' => array(
      'visible' => array(':input[name="faq_show_expand_all"]' => array('checked' => TRUE)),
      ),

  );

More information on form states can be found under Form API, #states and also links from there.

Add the #states properties where you feel would be good and create a patch for Stella to apply and test :-)

stella’s picture

Status: Active » Fixed

Done! I've committed changes to use the FAPI #states and removed the existing custom javascript. Didn't know of that new feature in D7, thanks!

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