Tags:
create new tag
, view all tags
It would be good to have a function hook in the standard templates to allow plugins to add functions (links and buttons).

At the moment I don't know of a simple way to do this. Maybe there is, and all that's needed is a documentation fix.

From a plugin author's perspective, I don't care where the buttons I add appear; that should be up to the skin. But I want to be able to add the kinds of functions:

  1. Forms processed by Javascript, such as a form to specify an action to be added to the textarea on the edit screen
  2. Buttons above, below, left and right of the edit text pane (htmlarea style)
  3. Bottom bar links (view screen)

A reasonable starting point would be a hook in the view and edit templates, such as %PLUGINHOOK%, that was available for plugins to process.

Oh heck, do plugins ever get to see the templates before they are emitted....??

-- CrawfordCurrie - 11 Oct 2004

Maybe there should be a %PLUGINTEMPLATE{...}% variable that would insert custom template stuff for all plugins that want to insert content in the template at a specific location.

prefixing each location with the template name you could have:

  • %PLUGINTEMPLATE{editTextAreaAbove}%
  • %PLUGINTEMPLATE{editTextAreaBelow}%
  • %PLUGINTEMPLATE{editTextAreaLeft}%
  • %PLUGINTEMPLATE{editTextAreaRight}%
  • %PLUGINTEMPLATE{twikiLinks}% - for inserting links in the <head> section to Javascript and CSS files
  • %PLUGINTEMPLATE{twikiLinks}%
  • %PLUGINTEMPLATE{viewLinks}%
  • %PLUGINTEMPLATE{rdiffLinks}% - This would be useful for linking to css to hide CommentPlugin input boxes that have been deleted in the topic.

Maybe this would be a way to do user stylesheet inclusion?

One thing I'd like to see this used for is user javascript inclusion so that a users custom javascript is only linked if that user is viewing the page, and not if someone else views the users home topic, which is how the current PatternSkin CSS works. Take a look at my home topic and you should see the nav bar on the right. This is acceptable for CSS, if annoying, but wouldn't be very secure for JavaScript.

-- SamHasler - 11 Oct 2004

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2005-02-14 - SamHasler
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.