SID-00233: PublishWebPlugin installed - How do I publish our TWiki
| Status: |
Answered |
TWiki version: |
4.1.1 |
Perl version: |
5.8.8 |
| Category: |
PublishWebPlugin |
Server OS: |
LINUX 2.6.18-8 |
Last update: |
14 years ago |
So I'm struggling with TWiki (all around) and the
PublishWebPlugin. I've never managed a TWiki and given our complex environment, getting to the point where the Plugin ran was a task in and of itself.
But now when I read the page associated with the
PublishWebPlugin, it was just another hill to climb and more frustration.
My guess is some configuration file holds preference information. As I tried making this all work I noticed a file that was called
WebPreferences.txt. Is this the file where where I set preferences for this plugin?
The "Variables" section in the docs needs some examples. The simple reason is I've never managed a TWiki. So whatever tribal knowledge is par for the course in my case simply isn't (in my brain).
In short, I simply want to see a static HTML version of our TWiki. Where do I fill this information in? Where are the "webs" enumerated such that I can tell this plugin (via a configuration file) what to publish?
To me right now it is still fairly nebulous on how to get this thing to work and a bright red button that reads "Publish TWiki" would be a nice start.
--
MarioPacheco - 30 Mar 2009
Discussion and Answer
The steps are described in the "Plugin Installation Instructions" section of
PublishWebPlugin. Basically you need to configure the plugin in:
-
twiki/lib/TWiki/Plugins/PublishWebPlugin.pm to set the publish directory
- Create new TWiki web for website publishing, say
Publish (which is the default set in the Plugin Settings section of this plugin). The plugin supports only one web for publishing.
- No bright red button is needed to publish pages because an html page is generated each time you save a topic in the Publish web.
With this basic setup you should be able to publish wiki pages, provided the permissions in your htdoc root directory are OK. The default publish skin is set with the PUBLISHSKIN plugin setting, so you will get pages generated with the (somewhat ugly) pring skin.
The idea is to create your own skin so that you get the look you need. A skin can be as simple as an HTML template placed in
twiki/templates that has a
%TEXT% variable as a placeholder for page content. Here is an example
twiki/templates/view.mywebsite.tmpl without any styles just to show you the basics:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="%LANG%" lang="%LANG%">
<head>
<title> %PUBLISHWEB{"nicetopic"}% < %PUBLISH_SITENAME%</title>
<meta http-equiv="Content-Type" content="text/html; charset=%CHARSET%" />
<meta name="generator" content="http://twiki.org/cgi-bin/view/Plugins/PublishWebPlugin" />
</head>
<body bgcolor="#ffffff">
<table border="0" cellspacing="5" cellpadding="0" width="100%"><tr><td>
<a href="%PUBLISH_LOGOURL%"><img src="%PUBLISH_LOGOIMG%" alt="%PUBLISH_LOGOALT%" title="%PUBLISH_LOGOALT%" border="0" /></a>
</td><td>
<font size="2">
%PUBLISH_TOPLINKS%
<hr />
</font>
<font size="1">
You are here: %PUBLISHWEB{"breadcrumb"}% %PUBLISHWEB{"nicetopic"}%
</font>
</td></tr></table>
<div id="content">
%TEXT%
</div>
<table border="0" cellspacing="5" cellpadding="0" width="100%"><tr><td align="center">
<font size="2">
%GRAY% %WEBCOPYRIGHT% %ENDCOLOR%
</font>
</td></tr></table>
</body>
</html>
Each time someone saves a page in the Publish web, this template is used to generate the static html page; the
%TEXT% in the template is replaced with the wiki page content of the page being saved. In the
WebPreferences of your Publish web you need to define other variables used in the template, such as PUBLISH_LOGOURL, PUBLISH_LOGOIMG, PUBLISH_LOGOALT, PUBLISH_LOGOALT, PUBLISH_TOPLINKS. You can introduce variables as needed.
See
http://www.twiki.net/
as an example website where all content is generated out of the corporate Intranet TWiki using this plugin.
--
PeterThoeny - 31 Mar 2009
How we can use this plugin generate HTML for the subweb?
--
WisanPrasongsook - 2011-07-03
Publishing sub-webs is currently not supported.
I invite you to
get involved with the community. If you contribute you are more likely to get community support.
--
PeterThoeny - 2011-07-03
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.