[Home]WikiPatches/DivTags

UseModWiki | WikiPatches | RecentChanges | Preferences

The 1.0 release includes the following DIV tag classes: Hopefully this will be sufficient for most users. --CliffordAdams

Question: If I set the wikiheader background color, free links in the header (I have Front_Page instead of FrontPage?) get overridden with a background color from wikipagelink. How do I avoid this? Thanks --Wiki:BilKleb


This patch encloses the following section in classed DIV tags: Other sections such as preferences and the various admin pages should probably also get similar treatment.

The idea is that this makes applying CSS styles much easier, as BODY can now get zero margins without the wiki content being flush with the browser window.

This patch is invisible unless the CSS stylesheet has set properties for the following elements:


? Can you give 1 quick example of how to do the stylesheet please?

Well it depends on what you want to do! A normal page will be made up of:
  1. header
  2. div.wiki
  3. div.footer
So if you want diving lines, put top borders thus
 div.wiki, div.footer { border-top: solid 1px black; }


Patch

sub BrowsePage

Find the line:

 
 $fullHtml .= &WikiToHTML($Text{'text'});

Replace this line, and the rest of the BrowsePage sub with the following:

  # tarq wikidiv patch begin
  #$fullHtml .= &WikiToHTML($Text{'text'});
  # append Wiki text enclosed in div.wiki
  $fullHtml .= "<div class=\"wiki\">" . &WikiToHTML($Text{'text'}) . "</div>";
  # end 
  if (($id eq $RCName) || (T($RCName) eq $id) || (T($id) eq $RCName)) {
    $fullHtml .= "<div class=\"RC\">" ; # opens div.RC
    $fullHtml .="<hr>\n"  if (!&GetParam('embed', $EmbedWiki));
    print $fullHtml;
    &DoRc();
    # close div.rc and open div.footer
    print "</div><div class=\"footer\">";
    print "<hr>\n"  if (!&GetParam('embed', $EmbedWiki));
    print &GetFooterText($id, $goodRevision) . "</div>";
    return;
  }
  $fullHtml .= "<div class=\"footer\">"; # open div.footer
  $fullHtml .= "<hr>\n"  if (!&GetParam('embed', $EmbedWiki));
  $fullHtml .=  &GetFooterText($id, $goodRevision) . "</div>"; # close div.footer
  print $fullHtml;
  return  if ($showDiff || ($revision ne ''));  # Don't cache special version
  &UpdateHtmlCache($id, $fullHtml)  if $UseCache;
  # tarq wikidiv patch end

Remember to close the sub's } !!

sub DoEdit

Replace
  print &GetHeader('', &QuoteHtml($header), '') ;
with
  # tarq wikidiv patch: open div.edit
  print &GetHeader('', &QuoteHtml($header), '') . "<div class=\"edit\">" ;
and replace
  print &GetMinimumFooter();
with
  # tarq wikidiv patch
  print "</div>" . &GetMinimumFooter();

UseModWiki | WikiPatches | RecentChanges | Preferences
Edit text of this page | View other revisions | Search MetaWiki
Last edited October 4, 2007 11:46 pm by MarkusLude (diff)
Search: