view
template. For pattern skin this file is /templates/view.pattern.tmpl
.
We describe two approaches to override this template: templates
directory
%TMPL:DEF{"topicactionbuttons"}%
, which is located in view.pattern.tmpl
.
The steps you would need: myskin
for now.
/templates
called view.myskin.tmpl
.
view.myskin.tmpl
you write: %TMPL:INCLUDE{"view"}% %TMPL:DEF{"top:toolbarbuttons"}%%TMPL:P{"more_link"}%%TMPL:END%
?cover=myskin
. You should see an effect now.
Test by appending* Set COVER = myskinor write* Set SKIN = myskin,pattern
?cover=myskin
to the url.
Template
, for instance BlogPostViewTemplate
.
Call this template by setting VIEW_TEMPLATE
:
* Set VIEW_TEMPLATE = BlogPostView
Template
extension now
templatetopic
: <input type="hidden" name="templatetopic" value="BlogPostViewTemplate" />
You can also test this by appending%TMPL:INCLUDE{"view"}% %TMPL:DEF{"top:toolbarbuttons"}%%TMPL:P{"more_link"}%%TMPL:END%
?template=PersonalInfoView
to the url.
view
script invokes the view
template:
view twiki css viewtopbar %SYSTEMWEB%.WebTopBar viewleftbar %WEB%.WebLeftBar viewtopicactionbuttons viewbottombar %SYSTEMWEB%.WebBottomBar
If set, the edit and attach buttons on top, and the topic action bar at the bottom are removed. There is a hard to find edit link for people who need to edit content: The topic revision info at the bottom has a dash before the WikiName that is turned into an edit link, such as:* Set READONLYSKINMODE = 1
Topic revision: r7 - 2011-05-18 - TWikiAdminUserPlease note that this is not a replacement for access control, use it in addition to TWikiAccessControl.
logo.gif
that is attached to each web's WebPreferences. There are 2 ways to change the logo in a web: Using logo.gif:* Set WEBLOGONAME = logo.gif * Set WEBLOGOIMG = %PUBURLPATH%/%BASEWEB%/%WEBPREFSTOPIC%/%WEBLOGONAME% * Set WEBLOGOURL = %SCRIPTURLPATH{"view"}%/%BASEWEB%/%HOMETOPIC% * Set WEBLOGOALT = Home
Using a new filename:
- Create a new image named
logo.gif
and attach it to the web's WebPreferences topic. PatternSkin's stylesheet assumes the logo is 40px high. More about that later.- You can also upload the image with FTP to
/pub/YourWeb/WebPreferences/
.- Copy the above instructions ("Redefine your custom variables") and insert your logo name.
- Attach whatever image and attach it to the web's WebPreferences topic. Then add to the WebPreferences (under Custom web preferences):
* Set WEBLOGONAME = your-logo-name.gif-or-png
- Copy the above instructions ("Redefine your custom variables") and insert your logo name.
WIKILOGOIMG
, WIKILOGOURL
and WIKILOGOALT
.
To change only the web logo image to site-wide, in Main.TWikiPreferences set:
* Set WEBLOGOIMG = %WIKILOGOIMG%
<input type="hidden" name="web" value="%BASEWEB%" />To search all webs, write:
To search a couple of webs, for instance the webs Main and TWiki, write:<input type="hidden" name="web" value="all" />
See also: Search variable<input type="hidden" name="web" value="Main,TWiki" />
Using style sheets:%TMPL:DEF{"topbardimensions"}% #patternTopBar, #patternClearHeaderCenter, #patternClearHeaderLeft, #patternClearHeaderRight, #patternTopBarContentsOuter { height:64px; /* top bar height; make room for header columns */ overflow:hidden; } %TMPL:END%And change the number from 64px to a different value.
Create a new stylesheet with above definition in it, attach it to a topic and point USERLAYOUTURL
to that topic attachment. See PatternSkinCssCookbook about creating custom styles.
WEBHEADERART
, defined in TWikiPreferences.
Redefine your custom variables in Main.TWikiPreferences (to keep TWikiPreferences intact):
You can also set* Set WEBHEADERART = %PUBURLPATH%/%SYSTEMWEB%/PatternSkin/TWiki_header.gif * Set WEBHEADERBGCOLOR = somehexcolor (no quotes, for example: #ffffff)
WEBHEADERART
per web, by defining the variable in the Web's WebPreferences.
WEBHEADERBGCOLOR
in Main.TWikiPreferences (to keep TWikiPreferences intact):
* Set WEBHEADERBGCOLOR = %WEBBGCOLOR%
%TMPL:INCLUDE{"page"}% %TMPL:INCLUDE{"viewtopbar"}% %TMPL:INCLUDE{"viewtoolbar"}% %TMPL:INCLUDE{"viewleftbar"}% %TMPL:INCLUDE{"viewrightbar"}% %TMPL:INCLUDE{"viewtopicactionbuttons"}% %TMPL:INCLUDE{"viewbottombar"}%Each included template draws a part of the screen.
%TMPL:INCLUDE{"viewtopbar"}%
to hide the top bar.
Another approach is to clear the contents of module topbar
with an empty definition. Using either a template or a topic template, write in your custom template:
Using style sheets:%TMPL:INCLUDE{"view"}% %TMPL:DEF{"topbar"}%%TMPL:END%and add:%TMPL:DEF{"topbardimensions"}%#patternTopBar, #patternClearHeaderCenter, #patternClearHeaderLeft, #patternClearHeaderRight, #patternTopBarContentsOuter { height:0px; }%TMPL:END%
%TMPL:INCLUDE{"viewleftbar"}%
to hide the left bar, or in a custom template clear it using
Using style sheets:%TMPL:DEF{"leftbar"}%%TMPL:END% %TMPL:DEF{"leftbardimensions"}%%TMPL:END%
%TMPL:DEF{"leftbardimensions"}%#patternOuter { margin-left:12em; } #patternLeftBar { width:12em; margin-left:-12em; }%TMPL:END%And change the number from 12em to a different value (3 occurrences).
top:toolbarbuttons
and topicaction
by writing:
In the user page of TWikiGuest, set the cover to%TMPL:INCLUDE{"view"}% %TMPL:DEF{"top:toolbarbuttons"}%%TMPL:END% %TMPL:DEF{"topicaction"}%%TMPL:END%
By default this topic is editable only by TWiki admins.* Set COVER = customer
viewtopicactionbuttons.tmpl
. The bottom history link is defined in DEF action_revisions
To hide that link, In a custom skin view template%TMPL:DEF{"topicactionbuttons"}% %TMPL:P{"action_activatable_edit_or_create"}% %TMPL:P{"action_activatable_attach"}% %TMPL:P{"action_printable"}% %TMPL:P{"action_revisions"}% %TMPL:P{"action_backlinks_simple"}% %TMPL:P{"action_raw_or_view"}% %TMPL:P{"action_activatable_raw_edit"}% %TMPL:P{"activatable_more"}% %TMPL:END%
view.myskin.tmpl
empty action_revisions
by replacing it with an empty string:
%TMPL:INCLUDE{"view"}% %TMPL:DEF{"action_revisions"}%%TMPL:END%
view.pattern.tmpl
is:
%TMPL:DEF{"top:toolbarbuttons"}%%TMPL:P{"activatable_edit_or_create"}%%TMPL:P{"activatable_attach"}%%TMPL:END%Create a new skin by creating a file
view.myskin.tmpl
in the templates
directory. Write in it:
View any topic with%TMPL:INCLUDE{"view"}% %TMPL:DEF{"top:toolbarbuttons"}%%TMPL:P{"history_history_link"}%%TMPL:END%
?skin=myskin,pattern
, or set the SKIN
variable to myskin,pattern
.
This will remove the Edit and Attach buttons, and place a History button at the top.
You will probably not just want to have the History button there. Other button include names are:
create_topic_link raw_edit_link view_topic_link activatable_attach activatable_edit_or_create more_link activatable_printable backlinks_web_link backlinks_all_link backlinks_link history_rdiff_link history_history_link raw_link
contentheader
and contentfooter
, both defined in view.pattern.tmpl
. These containers can contain text or html and are placed directly before and after the topic text.
Both modules are wrapped in CSS containers: contentheader
- wrapped in div
of class twikiContentHeader
contentfooter
- wrapped in div
of class twikiContentFooter
Use the same procedure for contents to be put after the topic text:%TMPL:INCLUDE{"view"}% %TMPL:DEF{"contentheader"}%This is the text before%TMPL:END%
%TMPL:INCLUDE{"view"}% %TMPL:DEF{"contentfooter"}%This is the text after%TMPL:END%
formtop
(form at the top) and formbottom
(form at the bottom). The default definition is:
You simply swap the bucket contents. Using either a template or a topic template, write in your custom template:%TMPL:DEF{"formtop"}%%TMPL:END% %TMPL:DEF{"formbottom"}%%TMPL:P{"form"}%%TMPL:END%
%TMPL:INCLUDE{"view"}% %TMPL:DEF{"formtop"}%%TMPL:P{"form"}%%TMPL:END% %TMPL:DEF{"formbottom"}%%TMPL:END%
templates/formtables.pattern.tmpl
to have this code:
%{ These templates define the form attached at the bottom of viewed page. }% %TMPL:DEF{"starttopicformwisty"}%%TWISTY{id="topicformlist" mode="div" remember="on" link="%MAKETEXT{"Form"}%" showimgleft="%ICONURLPATH{toggleopen}%" hideimgleft="%ICONURLPATH{toggleclose}%"}%%TMPL:END% %TMPL:DEF{"endtopicformwisty"}%%ENDTWISTY%%TMPL:END% %{ Start of form table }% %TMPL:DEF{FORM:display:header}%<div class="twikiForm">%TMPL:P{"starttopicformwisty"}% <table class='twikiFormTable' border='1'>%TMPL:P{FORM:display:header:headerrow}%%TMPL:END% %{ Header }% %TMPL:DEF{FORM:display:header:headerrow}%<tr><th class='twikiFormTableHRow twikiFirstCol' colspan='2'> [[%A_TITLE%]] </th></tr>%TMPL:END% %{ Each row }% %TMPL:DEF{FORM:display:row}%<tr valign='top'><td class='twikiFormTableRow twikiFirstCol' align='right'> %A_TITLE% </td><td> %A_VALUE% </td></tr>%TMPL:END% %{ Footer }% %TMPL:DEF{FORM:display:footer}%</table>%TMPL:P{FORM:display:footer:editlink}% %TMPL:P{"endtopicformwisty"}%</div><!-- /twikiForm -->%TMPL:END%To give the twisty toggle link the same style as the attachment twisty link, add this to pattern skin's
style.css
:
.twikiForm .twistyTrigger .twikiLinkLabel { font-size:122%; /* h4 size */ font-weight:bold; }
Copyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Linux® is the registered trademark of Linus Torvalds in the U.S. and other countries.
Microchip and others, are registered trademarks or trademarks of Microchip Technology Inc. and its subsidiaries.
Arm® and others are registered trademarks or trademarks of Arm Limited (or its affiliates). Other terms and product names may be trademarks of others.
Ideas, requests, contributions ? Connect to LinksToCommunities page.