the wildcard capability is nice but what i really want in some cases is for some helptip to apply to more than 1 path (and the paths aren't similar enough for wildcards).

FYI, i am using this module on http://groups.drupal.org/group among other pages.

CommentFileSizeAuthor
#3 patch_116.txt3.71 KBdgtlmoon

Comments

Dave Cohen’s picture

Agreed this would be nice. I would work in it, time permitting, but I'm not sure when that will be. I invite others to take this on, in the meantime.

Care must be taken to ensure the query in helptip_block ($op == 'view') is efficient. So to implement this feature may require allowing that same nid to appear in multiple rows of the helptip table. That is, change the primary key from (nid) to (nid, path).

For an interface, user could type a comma-separated list of paths where they currently type a single path. But the module would have to parse this and store each path in its own row.

Glad to hear the module is getting used!

Dave Cohen’s picture

Thinking about this more...

Alternately, the path match algorithm could change to be the same as what is used in block_list(). This would be consistant with an existing interface, which is a plus. However it requires iterating through all the helptips looking for a match, where now a single database query does it for us. I don't want helptip to slow down page views, especially where no helptip is shown.

Opinions are welcome.

dgtlmoon’s picture

StatusFileSize
new3.71 KB

The block.modules method aint too bad - it just checks each block specified to see if it matches the path, as the assumption is you wont have 1000 blocks, so i used to the same approach.

attached my patch to helptip.module from latest cvs, hope this helps!

dgtlmoon’s picture

hehe wierd, almost 1 full year since the last post!

Dave Cohen’s picture

I'm torn because this patch has some pros:

  • allows multiple paths
  • uses interface familiar to those who administer blocks

But also some cons:

  • breaks backward compatibility

Also, its unclear to me which is superior, the complicated query that helptip uses today, or the regexp iteration in this patch. If anyone knows the performance implications of these approaches, please let me know.

So if this patch concerns you, please chime in with a +1 or -1 and we'll see if its worth committing. Or... perhaps a patch that does not break compatibility would be best.