--- Ted Stern <[EMAIL PROTECTED]> wrote:

> I appreciate the recommendation to use CSS, and the page header and
> footer, but all of these recommendations slightly miss the point:
> 
> I want to put the "Restricted" mark on some pages, not all.  So I'm
> thinking of some kind of per-page #pragma.  I don't think
> wikiconfig.py would be the right place for that.
> 
> As for CSS, I am a complete newbie.  How does one apply a CSS on a
> per-page basis?  How does one apply a theme on a per-page basis and
> not across the entire wiki?
> 
> Ted

You apply themes and CSS across an entire wiki.  The trick is to make
your restricted pages special.

You were on the right track with pragma. Try something like this:

Mark your restricted pages with a pragma:
  #pragma specialpage on

Then you have to modify your theme.  Add a startPage method to override
the default.  This is not marked as a public method, so you should
check the method  in site-packages/MoinMoin/theme/__init__.py every
time you upgrade Moin to see if it changed.  (I don't see an easy
alternative: adding a div at the end header and closing it at the start
of the footer looks messy)  For 1.5.8, the method with mods should look
something like this:

    def startPage(self):
        """ Start page div with page language and direction
        
        @rtype: unicode
        @return: page div with language and direction attribtues
        """
        specialpage = self.request.getPragma('specialpage')
        if specialpage == 'on':
            return u'<div class="myspecialpage" id="page"%s>\n' %
self.content_lang_attr()
        return u'<div id="page"%s>\n' % self.content_lang_attr()

The above tests for the presence of "#pragma specialpage on" and, if
present, adds a CSS classname of myspecialpage to the div that
surrounds the entire page content.  

Finally, you have to modify your theme screen.css or print.css to do
something useful with the myspecialpage class.

div.myspecialpage {background: url(...../pink.png) repeat;}

None of the above was tested, good luck.

Roger


       
____________________________________________________________________________________
Boardwalk for $500? In 2007? Ha! Play Monopoly Here and Now (it's updated for 
today's economy) at Yahoo! Games.
http://get.games.yahoo.com/proddesc?gamekey=monopolyherenow  

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Moin-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/moin-user

Reply via email to