SID-01275: INCLUDE in every topic of a web
| Status: |
Answered |
TWiki version: |
5.1.0 |
Perl version: |
|
| Category: |
CategoryTemplates |
Server OS: |
|
Last update: |
14 years ago |
I need to have some code such as a ratingplugin code at the end of every page/topic of a WEB. Apart from creating a topic with the code and using an INCLUDE in every topic, is there any global way to do this?
--
RonMascarenhas - 2011-09-19
Discussion and Answer
Simple solution: Create a WebTopicEditTemplate in your web and add the INCLUDE(s) you need. That way, every time a topic is created it will be based on that template, thus has an INCLUDE.
If you want to hide the INCLUDE you can define a custom view template, activate it in the WebTopicEditTemplate with a VIEW_TEMPLATE topic preferences setting. Details in
TWikiTemplates. FYI, the user profile pages use this approach to show the user profile at the top of the page: Custom view template
Main.UserViewTemplate, user profile template topic
Main.NewUserTemplate.
--
PeterThoeny - 2011-09-19
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.