Difference between revisions of "Site schemes"

From Dreamwidth Notes
Jump to: navigation, search
(another git link update)
m (added Foundation to needs-update flag)
 
Line 2: Line 2:
 
[[Category: Dreamwidth Installation]]
 
[[Category: Dreamwidth Installation]]
  
{{Update|text=Need to update for the half-move to Template Toolkit.  <code>$LJHOME/schemes</code> contains those.}}
+
{{Update|text=Need to update for the half-move to Template Toolkit and for that matter for Foundation.  <code>$LJHOME/schemes</code> contains those.}}
  
 
Site schemes are [[BML]] templates that specify how your site should look and feel. They live in the [https://github.com/dreamwidth/dw-free/blob/develop/cgi-bin/bml/scheme/ cgi-bin/bml/scheme] directory, although any images and CSS files they require need to be in the htdocs directory (usually in htdocs/img/schemename and htdocs/src/schemename).  
 
Site schemes are [[BML]] templates that specify how your site should look and feel. They live in the [https://github.com/dreamwidth/dw-free/blob/develop/cgi-bin/bml/scheme/ cgi-bin/bml/scheme] directory, although any images and CSS files they require need to be in the htdocs directory (usually in htdocs/img/schemename and htdocs/src/schemename).  

Latest revision as of 12:38, 1 August 2014


Needs Update: Need to update for the half-move to Template Toolkit and for that matter for Foundation. $LJHOME/schemes contains those.

Site schemes are BML templates that specify how your site should look and feel. They live in the cgi-bin/bml/scheme directory, although any images and CSS files they require need to be in the htdocs directory (usually in htdocs/img/schemename and htdocs/src/schemename).

Each site scheme consists of a .look file that should be a child of the global.look file. If you want to create a local version of a scheme -- to use your own site's logo, for instance -- you can do that by creating a schemename-local.look file and setting the first line to be:

_parent=>schemename.look

You can then put specific BML blocks into that file to override the blocks in the parent scheme. For instance, to change the logo, you might want to do:

logo<=
<?_code
{
    my $imgprefix = $LJ::IS_SSL ? $LJ::SSLIMGPREFIX : $LJ::IMGPREFIX;
    return "<a href='$LJ::SITEROOT/'><img src='$imgprefix/filename.png' 
        alt='$LJ::SITENAMESHORT' /></a>";
}
_code?>
<=logo

Once you create a site scheme, it can be used immediately by adding ?usescheme=schemename to the end of URLs, but that's probably not enough for your purposes. To enable it as selectable in the Display category of the Manage Accounts page, you need to create a file called cgi-bin/DW/Hooks/SiteScheme.pm and put the site schemes you want to enable in there. You can see an example in the dw-nonfree code (but since it's dw-nonfree, you need to write your own with your own list of site schemes): cgi-bin/DW/Hooks/SiteScheme.pm.