Anyway we can somehow get together with the site_map maintainer and offer a hook or something that will spew a list of questions into the sitemap?

I think that would be really useful - potentially not that difficult either?

Comments

stella’s picture

Assigned: Unassigned » stella

I'm not that familiar with the sitemap module - gonna go download it now though. So would you mind providing more details on how you imagine it should work?

nancydru’s picture

Sitemap already picks up the categories. It doesn't look to me like it (Sitemap) was ever really intended to drill down below a page level (certainly the search engines wouldn't want it to). But, since the questions/answers are individual nodes, I would see this as a request for Sitemap, not FAQ.

stella’s picture

nancyw, it is actually a feature request for both modules, first for the faq module, and following on from that, for the site_map module.

The faq module needs to provide function(s) that the site_map module can use to list the FAQ nodes. That way the code required to support the faq nodes in the site_map module can be kept to a minimum, which makes it easier to maintain, since they shouldn't have to do a new release of their module every time I modify the faq module. So first the faq module needs to have additional functions added to it. Once that's done, the maintainer of the site_map module should only need to make a small change to call the necessary function(s) and display the data returned.

NikLP - I'd like to hear more about what you would like displayed. At the moment, I'm thinking of a function that will return a list of the FAQ questions and links to their nodes. The questions would be returned in the order as determined by their configured weights. However, if categories are used, then it may need to return the list of questions per category, or maybe it should just return links to the categorised faq pages.

Regards,
Stella

niklp’s picture

I agree that there is potentially work to be done on both modules. I think the best idea for this side of the fence is to return a weighted list of nodes if there are no categories, and return a (weighted?) list of categories if there are. I guess potentially you could drill down and return a nested list of the whole lot (as an option), but this might be overkill for the sitemap?

The reason that I ask is that I recently developed a site which used CCK/Book modules for the FAQ, and this of course is picked up by the site_map.module.

stella’s picture

Added two new functions to the module in CVS:

* faq_get_faq_list() - returns a list of weighted FAQ nodes. However if categories are enabled, it just returns the FAQ categories.
* faq_get_terms() - returns a list of FAQ categories.

These will be included in the next release.

niklp’s picture

Legend...

Has anyone over at site_map made any noise about this yet? I can't remember if I cross posted this there or not...

stella’s picture

The maintainer said he'd be happy to add it. However I have to release it first, but a release is dependant on another issue being fixed.

stella’s picture

Project: Frequently Asked Questions » Site map
Version: 5.x-2.2 » master

FAQ part released in faq-5.x-2.3.

Two new functions have been added which can be used by the site_map module:

  • faq_get_faq_list() - returns a list of weighted FAQ nodes. However if categories are enabled, it just returns the FAQ categories.
  • faq_get_terms() - returns a list of FAQ categories.

Cheers,
Stella

frjo’s picture

I have committed a solution to HEAD but I have not tested it. If you use the FAQ module please try it out and report back any issues here.

frjo’s picture

Project: Site map » Frequently Asked Questions

I just committed a patch that adds a hook_site_map() to the site map module. I believe something like this in the faq module should work. This I a more flexibel solution than my first attempt above.

/**
 * Implementation of hook_site_map().
 */
function faq_site_map() {
  $title = variable_get('faq_title', t('Frequently Asked Questions'));
  $output = faq_get_faq_list();
  return theme('box', $title, $output);
}
stella’s picture

Would it be possible to add a checkbox to the sitemap configuration screen that enables / disables the FAQ display in the generated sitemap?

Stella

stella’s picture

Project: Frequently Asked Questions » Sitemap
Version: master »

I've added the hook to the faq module in CVS.

niklp’s picture

Further to this, is there a relatively simple way that sitemap can expose a general hook that *multiple* modules can hook into? And then have a list of checkboxes that can be selectively switched per module hook?

Not sure if this is possible or viable, but sounds like a plan...

stella’s picture

Hook added to faq module now released in faq-5.x-2.4.

Would it be possible to add a checkbox to the sitemap configuration screen that enables / disables the FAQ display in the generated sitemap?

Cheers,
Stella

stella’s picture

Status: Active » Fixed

Flag appears to be there now. Thanks.

Cheers,
Stella

Anonymous’s picture

Status: Fixed » Closed (fixed)

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