Hi Stella,
Your Frequently Asked Questions module is exactly what I needed for a project I'm working on, thank you! But I've run into a small problem.
I've installed & enabled the module, created a Taxonomy and Vocabulary to use with it, and created the questions and the answers for each vocabulary item. In the module's Settings, I've made the page layout be "Clicking on question takes user to answer further down the page", and the "Questions listing style" is "unordered". After adding questions and answers, I can display them as shown in the first screenshot. To do this, I used the following code:
<?php
//$faqitem: an integer which is passed to the page via the URL, with error-checking, etc.
$tid = $faqitem;
$term = taxonomy_get_term($tid);
// This prints the taxonomy term as the heading of that particular FAQ page
// e.g. "Directing Gifts" as shown in the first screenshot
print $term->name;
// Choose which set of Q&As to display
$faq_output = faq_page($faqitem);
// Display the Q&As
print $faq_output;
?>
However, I want to display them as shown in the second screenshot. Notice the styling that has been introduced (for the unordered questions, for the question that's shown above its corresponding answer, and for the answer itself), and the fact that the unordered list of questions at the top of the page is separated from the Q&A pairs by a horizontal faint gray line. The CSS styles already exist and work in other parts of the site.
The statement print $faq_output; (as shown in the code above) just outputs everything -- unordered questions, and Q&A pairs -- at once. So my question is: How can I get from screenshot 1 to screenshot 2?
Thanks in advance.
| Comment | File | Size | Author |
|---|---|---|---|
| FAQs - 02 After.png | 33.08 KB | EddieN120 | |
| FAQs - 01 Before.png | 36.74 KB | EddieN120 |
Comments
Comment #1
vikingew commentedIf I was you I'd trace back and look at where $faq_output get its content from, starting with
$faq_output = faq_page($faqitem);which mean I'd started to look inside
function faq_pageI don't have the final answer for you but probably it's a question of picking up the correct css classes somewhere.
Comment #2
stella commentedThe output of the faq module can all be overridden in the theme layer. Just copy the appropriate tpl.php file for your question listing style (probably faq-questions-top.tpl.php if uncategorised) from faq/includes/ directory to your theme and then modify the html as needed.