integration with site_map.module

NikLP - April 24, 2007 - 11:12
Project:Sitemap
Component:Code
Category:feature request
Priority:normal
Assigned:stella
Status:closed
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

stella - April 24, 2007 - 11:14
Assigned to:Anonymous» 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?

#2

NancyDru - April 24, 2007 - 13:26

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

stella - April 24, 2007 - 13:40

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

NikLP - April 25, 2007 - 11:18

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

stella - April 27, 2007 - 15:00

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

NikLP - April 27, 2007 - 15:56

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

stella - April 27, 2007 - 15:58

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

stella - June 1, 2007 - 10:48
Project:Frequently Asked Questions» Site map
Version:5.x-2.2» HEAD

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

#9

frjo - June 2, 2007 - 04:24

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

frjo - June 4, 2007 - 13:44
Project:Site map» Frequently Asked Questions
Version:HEAD» HEAD

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

stella - June 5, 2007 - 11: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

stella - June 5, 2007 - 11:15
Project:Frequently Asked Questions» Sitemap
Version:HEAD»

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

#13

NikLP - June 5, 2007 - 13:23

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

stella - July 16, 2007 - 12:15

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

stella - October 22, 2007 - 15:15
Status:active» fixed

Flag appears to be there now. Thanks.

Cheers,
Stella

#16

Anonymous - November 12, 2007 - 22:41
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.