Create hook for topics

e2thex - April 3, 2009 - 20:24
Project:Advanced help
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

It would be nice if there was a hook in advanced help that let topics be injected in ways other then use of the ini file and the help folder. This way other module developers provide alternative ways injecting help content, be it from a remote source or maybe from content in the database.

#1

e2thex - April 7, 2009 - 15:22

I am posting a patch that adds hook_advanced_help_topics

it should return an array of topics with the name as its key. each array must have
a title, and path (the location of the content, may be a external url or a drupal path) and has the options of
'weight'
'parent'
'popup width'
'line break'
'navigation'
'css'
so it might return

array(
  'base_topic' => array(
    'title' => 'Base Topic',
    'path' => 'node/10/format_as_help',
  ),
  'sub_topic' => array(
    'title' => 'Sub Topic'
    'path' => 'node/11/format_as_help',
    'parent' =>'base_topic'
)

These will then (hopefully) be topics in the advanced help system.

AttachmentSize
advanced_help-423188.patch 3.36 KB

#2

e2thex - April 15, 2009 - 21:43

I add some comment to the patch. if there is anything else I should do let me know

AttachmentSize
advanced_help-423188.patch 3.36 KB

#3

robertDouglass - April 18, 2009 - 12:02

The patch might be very helpful, but in the meantime, you can also use the HelpInject module to inject in a non-obtrusive way. http://drupal.org/project/helpinject

Perhaps with this hook the HelpInject module will become simpler?

#4

e2thex - April 24, 2009 - 19:40

Yes help inject is pretty cool and it would have let us get the topics we wanted , but I was hoping to do the same idea but keep it all in nodes, so that I would not have to export and install, when ever they change the help.

I built a module to take advantage of the patch (a little proof of concept, which allows nodes to be help topics, and then another one to insert the topic into forms. The first one I like the second one I do not. But it looks like help inject does that really well, so there might be some overlap that could be worked out. I wrote a post about what I was trying to do here about it. I would love to hear if you think some of it could be integrated in helpinject or if there was some way for them to work together.

the module is up Advanced Help Topic Nodes

#5

robertDouglass - April 25, 2009 - 05:44

Just for clarification - you can leave your help in your book nodes when using Help Inject. If you don't need to export the help you don't have to. But that's off topic here.

#6

bmoreinis - September 4, 2009 - 16:01

I found that I was getting Schema errors around the declaration of default values for the two text fields. Deleting

'default' => '';

from both the name and parent declarations in advanced_help_topic_nodes.install solved that.

We'll see if it creates any other difficulties.

 
 

Drupal is a registered trademark of Dries Buytaert.