Tags:
create new tag
view all tags

Question

Is there any way a user who perhaps doesn't have write access to the WebPreferences can add an auxillary CSS to the HEAD section of the page? My intention is for an INCLUDE where inclusion of a style section in the body would be unsuitable as the INCLUDE could only be used once. Also it is not good practice in XHTML.

Environment

TWiki version: TWikiRelease04x02x00
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: WIN32
Web server: Apache
Perl version: 5.10
Client OS:  
Web Browser:  
Categories: Add-Ons

-- BrianTibbels - 25 Apr 2008

Answer

ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.

I did this in my site. Just add in your templates in the HEAD section a %CSS%, and then your users can define their CSS via declarations like

  • Set CSS = <style tyle='text/css'>...</style>

-- ColasNahaboo - 26 Apr 2008

This works ok for the topic you are woking on but fails if you use the set... in an %INCLUDE file. %CSS remains undefined. Is there a way of setting a variable in an include file? See TestSet

-- BrianTibbels - 28 Apr 2008

We have no formal way to do that yet, although ProcessAddToHeadAdds is getting defined now.

A kludgy way is to use a %CALC{$SET(name, value)}% in the topic, and a $GET() in the template's HEAD section. This works with INCLUDEs as well.

-- PeterThoeny - 29 Apr 2008

Change status to:
Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2008-04-29 - PeterThoeny
 
  • 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-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.