Hey there--
I've read a few bits from searching about this, but either they're old, don't apply to my theme (a phpTemplate-based one) or don't actually give me enough information to implement. So apologies for repeating a topic that's come up a few times before.
Basically, that damn "more information about formatting options" filter tip is driving my users crazy. They write an entire blog post, hit the button just to check something, and lose everything they've done. I *need* to get it to open in a separate window.
I understand that I can change this in my theme instead of modifying the filter.module, but don't know where I would specify it or how I'd call it. Any help would be much appreciated.
Thanks!
Dan
Comments
theme function
line 448 of filter.module:
use the existing function, line 913:
as the basis for the theme override: http://drupal.org/node/55126
Actually looks like the only thing you need to do is regenerate $extra to include target = _bank, or whatever.
See docs for the l function
---
Work: BioRAFT
what am I doing wrong?
I've created the template.php file, which consists of the following code:
But going to my site with that file in the theme folder returns a blank page.
Just having the file contain:
allows the site to load no problem. So what am I doing wrong with that replacement?
Thanks!
need full function
You need to copy the full function into your template.php, and then re-define the link. what you have in the function definition won't work- that just sets a default value.
---
Work: BioRAFT
Half way there
OK, I've pulled the full function in, and the blank page no longer shows up every time (YES!!). I've changed the extra to include the target, and that also returned a valid page (YES!!)
But I'm not sure how to "re-define the link" Because doing all the above, still doesn't open the link in a new window (NOOOO!!)
Thanks for bearing with me, by the way, I'm new to this theming concept--much more secure in an all-CSS/HTML environment, but recognize the need to learn this too.
Here's the code as it now stands in my template.php file. One probably totally dumb question: I know I have to change the "theme_" part of that replacement to the template name. But should it be phptemplate, or my ACTUAL template name (in the code posted below, it's phptemplate, but I've tried it both ways and while both return a valid page, neither open in a new window).
hmmm, I was wrong
replacing "theme" with either "phptemplate" or "mytheme" can work- the latter is only necessary or useful if phptemplate itself has already defined a theme function with that name.
Oki looking at the function above- it becomes obvious eventually that the value $extra is never used. So, it seems I steered you in somewhat the wrong direction. The function that's adding the filter tips link to the node form is probably actually this one:
function filter_form
Do you want the filter tips link at all? What I would suggest for the sake of immediate gratification is to hack the module and change:
to
or even
To do this right (i.e. so you don't have to re-hack when you upgrade to a forthcoming Drupal 4.7.3), I think you'd have to either make a tiny module that has a hook_form_alter function to change this value, or rewrite theme_node_form (a pain).
Actually another (best?) option would be to file a bug/feature issue against filter.module to suggest that the module should be changed so it's something like:
As it is now, changing that little peice is unnecessarily hard.
---
Work: BioRAFT
I keep feeling extraordinarily dumb
Can you break this down a little more simply? I *do* want the ability for my users to look at the tips page so they can get a good handle on what codes they can and can't use (I'm restricting the HTML), so I don't want to lose it completely. And I don't really want to hack the code itself because of upgrades and all. Also, I think this is as good a place as any to get my hands dirty with the template.php snippets anyway. So is it possible to do what your suggesting within the template.php file instead of the filter.module file?
Keep in mind that I'm on a tiny bike with very big training wheels right now.
I'm only 2 steps ahead
I'm only two steps ahead of you in terms of understanding all this ;-)
I think probably the easiest way to do this (barring the improvement to the module I suggested) is to use hook_form_alter via a (tiny) custom module.
See:
http://api.drupal.org/apis/4.7/form_alter
http://api.drupal.org/api/4.7/file/forms_api.html
and this handbook page (that's still in moderation) as a starting point:
http://drupal.org/node/70906
Essentially the entire job of this little module would be to change the value of #extra in this form, in parallel with how the code referenced above changes the value for the node body. you could do it just for blogs, or for any node form.
Again, you could also try to do it at the theme level by re-writing theme_node_form. The goal would be to just reproduce the existing code but stick in an extra command to alter that one form element before it gets rendered.
I filed an issue: http://drupal.org/node/72797
Please add you comments/suggestions there.
---
Work: BioRAFT
issue with patch for HEAD
see: http://drupal.org/node/72797
---
Work: BioRAFT
Just put something like this
Just put something like this in your template.php file:
I haven't tried it, but I think you could use the hovertips module to display your own filter tips in a tooltip that displays inside the node edit page.