The user should have the option to choose whether the help they are injecting is expanded help, displayed on a separate page, or if it is the in-line tip type of help.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | helpinject_inline.patch | 17 KB | crea |
The user should have the option to choose whether the help they are injecting is expanded help, displayed on a separate page, or if it is the in-line tip type of help.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | helpinject_inline.patch | 17 KB | crea |
Comments
Comment #1
robertdouglass commentedSome thoughts. First, I can imagine storing non-node help text for two cases: the hook_help part, and for overriding form elements' #description attributes.
The disadvantage of this type of text (managed by the helpinject module) is that you can't have someone else with fewer privileges edit it. The beauty of the node based system is that the community authors can write the documentation and an administrator can manage the injecting (since you have to access parts of the system that should be off limits to most people).
Node based help also has the promise of being translatable and working with Advanced Help's multi-lingual content strategy. The help texts managed by helpinject won't have this and you'll basically be limited to one language. Shoving these texts into t() strings is possible, but not recommended.
Comment #2
dman commentedkeep the storage node-based, sure!
We can however choose to *show* it inline (normal help zone), or click-to. I'm thinking teaser inline with click-to->more. Very Drupaly.
More UI widgets :-/
Comment #3
robertdouglass commented@dman - ok, good food for thought. I'm off for 4 days - will chew it over, and code when back =)
Comment #4
swopit commentedSubscribed
Comment #5
tallsimon commentedthis issue was also raised in http://drupal.org/node/426974
is this a current feature? I have been using cooltips which gives the inline option, but would like to switch to this module as it is more flexible.
Comment #6
crea commentedSubscribing.
This is indeed very logical expected move, to have this module serve as replacement for all inline help texts. Simple example: I want to have content submission guidelines both inline, and in hierarchy of nodes (in our case, in book pages) , so a user can learn how to use the site both during process of using and by visiting help section. Then there's additional headache when you update help nodes you also need to update inline text, because they are separate :(
Also, in general, if help text is short enough, forcing user to make additional click is very stupid move, when you could just display it inline. So let's consider it usability problem.
Comment #7
tallsimon commentedAny progress on this? Has work on this module slowed recently? How can I help?
Comment #8
robertdouglass commentedProgress is slow at the moment. Help is welcome. We need patches, or people who are willing to sponsor them.
Comment #9
3dloco commentedsubscribe
Comment #10
crea commentedAttaching big patch implementing this feature. Upgrade path is provided so patch should not break anything afaik.
To install:
Copy help.png from the Advanced Help module directory to the HelpInject module directory.
Run update.php.
Summary of changes
Some minor bugs fixed
New permission "view advanced help inline"
Injection modes stored in new table column
Popup icon only
Inline teaser only
Inline body only
Inline teaser and popup icon
Inline body and popup icon (may be unneeded, but could be useful in rare cases)
Nodes are inserted using theme('node'..) function
To show only text without titles and all that stuff, which is what I believe most users will want, one will need to have custom node template. For example, my help node template that I used for tests checks $teaser variable and shows bare $content in teaser mode and everything in full body mode.
This part maybe needs improvement, but it's simplest thing that I could implement.
Support of "read more" context.
In "inline + popup" modes, popup icon works basically in "read more" context, meaning "show me more help on this topic". Theme functions included in the patch support this. Patch uses own icon for this (borrowed from Advanced Help). Provided CSS also differs from original one from Advanced Help (read below).
"read more" icon is inserted right into the help node
I borrowed some code from "read more tweak" project, so we can for example insert our icon inline to the last paragraph tag of the node. Help icon is themed using "inline-block" display property so it is displayed inline despite having also some block properties. Because "a" tag is naturally inline, it should work for all major browsers including IE but please test it and report if you encounter any problems.
Optional help node caching, lazier loading of nodes
Using of nodes for all help can harm performance without caching: imagine rendering very big form when there are 50 or so fields: HelpInject then needs to load every help node to display it inline. To speed it up, I implemented node caching (like in Advanced Cache module). It can be disabled in case there's another node caching already enabled (e.g. Advanced Cache) or there are problems with cached nodes.
Note that originally HelpInject was loading every help node just to use it's title as link title. I maked it configuration option. With this patch HelpInject loads help node only when it's displayed inline or "use node titles in link titles" option was configured.
Question of reliance on Advanced Help
Because this feature uses our own nodes system, there's now question on relationship between HelpInject and Advanced Help. If one uses HelpInject in node mode, there's only one thing he needs from Advanced Help: CSS and an icon. Also, afaik help exported to html can't be displayed inline, because it's done by Advanced Help module.
Because this patch implements own icons anyway, I suggest next steps:
Comment #11
crea commentedAttaching..
Comment #12
robertdouglass commentedOh wow! A patch! That doesn't come along too often, so, thanks =)
There's a lot of interesting stuff in here, and I'll look more carefully after my immediately upcoming travel, but right off I'm going to say -1 for the node caching. Either there's a general way to node caching (advcache like you mentioned), or we don't do it. It certainly doesn't belong in this module, imo. Can I ask a big favor, and get a reroll without that part?
Comment #13
crea commentedCan you elaborate why is it bad ? Consider following points:
1) Advanced Cache requires patching core. OTOH, this patch only includes own wrapper for node_load() so it doesn't need patching.
2) Advanced Cache works globally, and can bring other problems specific to different modules. This caching works only for help nodes inside HelpInject module, isolating area of possible effect/problems.
3) Help nodes can be very heavy in terms of SQL, containing lots of CCK fields etc. As said in my example above, the need to load 50 heavy nodes from database on each form can make this module unacceptable solution.
4) Help nodes generally are same for all users.
5) We cache per combination of roles anyway.
6) We cache not html (which can be highly personalized) but node objects which usually don't differ.
7) This caching can be disabled in the UI in several clicks anyway. Wrapper will then call node_load().
8) Disabled by default.
Overall, if we can make this feature of HelpInject perform faster, I see no reason to make it slower. Sure, you can ask users to install Advanced Cache and patch core, but that will mean less users will want to use this module, test it, provide bug reports etc.
Comment #14
crea commentedDisregarding node caching, this still needs overall review from different people
Comment #15
crea commentedAny updates ?
Comment #16
tallsimon commentedthank you crea I would love to test but don't have time to set up a system for applying patches. could you attach a zip of the module with the patch applied so I can test it please?
thank you
simon
Comment #17
dman commented:-(
Your "time" is not more valuable than creas time, so that's not a very polite justification for not using the correct tool for the job.
Step 1: Download "patch" for your OS.
Step 2: Type 'patch' or the path to the executable you downloaded.
- you are set up. See the handbook for the rest.
Comment #18
tallsimon commentedI seem to have offended, I wanted to help in a way which is within my experience and capacity and try a patch I would like to use, but never mind. I thought it would be quite quick for someone who has already applied the patch to zip and upload it.
Comment #19
crea commentedThis turned out very inefficient. Node loading seems to be a bad idea and there are too many queries to fetch help in forms.
@tallsimon
Learning to use patch is much better long-term solution than asking for a zip every time.