Recent Topics

1 Jun 12, 2006 02:37    

Hello Crowd, I got something to work which may be of use for others, too. The way I did it is not strict XHTML and uses tables but maybe it offers inspiration to people looking for something similar.

What + why:
I want/ed to have a consistent look across my site driven with b2evo but still have different background and / or ID image loading per blog without having to replicate the skin umpteen times (just to swap images).

At the time of this posting you can see it in effect at
http://www.alexandermaiwald.de/pri/index.php/all (no background, no logo)
http://www.alexandermaiwald.de/pri/index.php/a (background + logo "a")
http://www.alexandermaiwald.de/pri/index.php/b (background + logo "b")
This is all the same skin (alpha stadim, nevermind the rest of the layout), just loading different images according to blog (short) name. Switch between blogs to see what it does.

How?
Background:
The main table calls as a background image of the naming convention "bgtop-[stub_of_blog].jpg". If you wish to display a background for a blog, just drop a graphic (here: best around 1280x240px) labeled accordingly into the folder of this skin. If no image is provided, area remains tranparent to background.
In _main.php use a table opening like:

<table border="2" cellpadding="15" class="maintable" background="bgtop-<?php blog_list_iteminfo( 'stub', 'htmlbody'); ?>.jpg" style="background-repeat: no-repeat; align: left; vertical-align:top"> ..... (etc.) 

Logo or ID image:
In the skin at above url, the top left cell contains a minitable which calls a background image of the naming convention "logo-[stub-of-blog].gif". If you wish to display a logo or ID image for a blog, just drop a graphic (here: best around 160x160px) labeled accordingly into the folder of this skin. If no image is provided, area remains tranparent to background. Use a table opening like

<table width="160" height="160">
<td background="logo-<?php blog_list_iteminfo( 'stub', 'htmlbody'); ?>.gif" style="background-repeat: no-repeat">  ..... (etc.) 


Should you wish to use one site logo throughout all of your blogs using the same skin, just put a static path to your site logo, duh :)

Why use table( cell)s at all?
Because if no image is provided I wanted no "broken image" icon display/ed, just the "naked" skin showing ;). The only way I know to do that is background images for tables. I tried to accomplish the same using CSS but couldn't get it to work.

So, above approach may not be the latest and slickest, but it does the job.
That's it. Hope somebody finds it as useful as I do ;-P

Best, 'lex


Form is loading...