integration with site_map.module
NikLP - April 24, 2007 - 11:12
| Project: | Sitemap |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | stella |
| Status: | closed |
Jump to:
Description
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?

#1
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?
#2
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.
#3
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
#4
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.
#5
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.
#6
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...
#7
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.
#8
FAQ part released in faq-5.x-2.3.
Two new functions have been added which can be used by the site_map module:
Cheers,
Stella
#9
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.
#10
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);
}
#11
Would it be possible to add a checkbox to the sitemap configuration screen that enables / disables the FAQ display in the generated sitemap?
Stella
#12
I've added the hook to the faq module in CVS.
#13
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...
#14
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
#15
Flag appears to be there now. Thanks.
Cheers,
Stella
#16
Automatically closed -- issue fixed for two weeks with no activity.