Hi there,

I am using advanced_help to provide some help content to my users. I have build a small block which content depends on the page visited, and I am providing both help on specific topic (using the theme function provided theme('advanced_help_topic', $module, $topic);

But so far, I am unable to provide the most generic link: i.e. a link to the index of the module advanced help. Obviously it is feasible because such index is generated and a link is provided on the global help index page, but I do not see an easy way to do it for my own purpose.

If I specify a $topic, I get a link on that topic only. It would be great if when there is no $topic that the link returned is the link of the index of module's help.

Cheers,

Sylvain

ps: obviously I can add a direct link in my block, but it would make more sense to be able to do it using only mechanism provided by advanced_help.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

lambic’s picture

FileSize
2.04 KB

Here's a quick stab at a patch

lambic’s picture

Status: Active » Needs review
spouilly’s picture

Thanks Lambic, it is a step in the right direction ... but not quite there yet. I have some comments:

1. When there is no topic, the link generated point to the general "advanced help" index (admin/advanced_help), whereas it would make more sense to have a link to the module "advanced help" index (admin/advanced_help/module_name).

Maybe the following convention would be helpful for the theme function:

if (!topic){
  if (!module) {
    // if no module and no topic have been specified, let's display the general index
    return l($text, 'admin/advanced_help', $attributes);
  } else {
    // only the module name is available, let's display the module advanced help index
    return l($text, 'admin/advanced_help/'.$module, $attributes);
  }
}

2. The way you modified the theme function, actually breaks the theme function ... it no longer display the help icon next to the subject (because you return immediately with the index link, rather than setting the proper css for the link). It should go through the end of the theme function where the css/popup code is added.

spouilly’s picture

Status: Needs review » Needs work
lambic’s picture

FileSize
3.12 KB

Another patch. I'm hard-coding default height/width for the popup, which should probably be done through variables but it'll do for now.

spouilly’s picture

Status: Needs work » Reviewed & tested by the community

Ok, I tested the last patch, and it works as expected thanks a lot ...

and yes, you are correct, being able to configure the popup through some variables would be helpful ;-)

Sylvain

gisle’s picture

Version: 7.x-1.0-beta1 » 7.x-1.x-dev
Issue summary: View changes
Status: Reviewed & tested by the community » Postponed (maintainer needs more info)
FileSize
3.56 KB

I've rerolled the patch in #5 for the latest 7.x-1-x snapshot (attached) and tried to review it.

However; I must admit don't understand what problem this patch is supposed to solve. In addition, it looks like the hard-coded default height/width for the popup may break existing pop-ups.

Please expand on the use-case for this, or create a sandbox with a small demo showing how to use the added functionality it provides.

gisle’s picture

Status: Postponed (maintainer needs more info) » Needs review
FileSize
5.29 KB

Created a new patch to do this (unrelated to previous patches).

Example code that themes a link to the index is in sub-module Help example.

Please review.

  • gisle committed fc02514 on 7.x-1.x
    Issue #1280514 by gisle: Added feature to theme a link to the index page
    
gisle’s picture

Assigned: Unassigned » gisle
Status: Needs review » Fixed

This is now part of Advanced help 7.x-1.5.

Status: Fixed » Closed (fixed)

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