Posted: Fri Mar 02, 2007 2:59 am
I cannot endorse the background color through the transparent portion for reasons I already stated - does not work well on non-rectangular images, and seriously limits the color options. I envision scenarios where I might want to do some fairly substantial graphic swaps, and this method cannot accomplish that. That being said, the options, at present, are few. The idea of hiding the foreground image, and replacing it with a background image, look more promising, but not without challenges. I think it might be easier to get some TPL's working for the offending plugins even if that takes awhile.
Meanwhile, I've been working on the assignment of additional variables through the selection of another one. Garvin has been a huge help here with my ignorance. Here is where I am and is only v1.1>. The first code bit is for config.inc.php, the remaining is as noted:
First, I offer the colorset choice:Then we set additional variables:
I am not yet fully committed to my defaults. Color changes obviously necessary for a given purpose. Not sure whether to make a colorset default, or to have basic "back.gif, forward.gif, xml.gif", etc. One thing is certain - I intend to slice up my css file so that the colorset options are in their own css, and the core is in style.css. I had been mis-led by a few of the themes into how this was supposed to work, as well as how {TEMPLATE_PATH} does not work in a linked stylesheet, but now, thanks go Garvin, I understand it. Here is that conversation: http://board.s9y.org/viewtopic.php?t=9094 The xml issue is still an unknown even though I am setting a variable with a value and not really using it just yet. The rest is as follows. In Index.tpl, using Dave's coffe cup 3 theme as an example, this code:
should be completely replaceable by this:
Using the arrows in plugin_calendar.tpl (note: I had already removed the style= stuff and am styling that directly in css):
This:
Becomes this:
Same goes for the forward arrow. I am also using the arrow entries.tpl instead of "prev page" and "next page" - apparantly, I am the only one who thought that was a good idea so far!
It works beautifully!!!
That is today's contribution.. works for me, if it can work for anyone else, great! I personally think BulletProof should include a colorset option just to demonstrate how it is done. Does not have to be anything fancy - perhaps just a background color or 2. Does not even have to include this latest code - just the initial array if necessary.
Meanwhile, I've been working on the assignment of additional variables through the selection of another one. Garvin has been a huge help here with my ignorance. Here is where I am and is only v1.1>. The first code bit is for config.inc.php, the remaining is as noted:
First, I offer the colorset choice:
Code: Select all
array(
'var' => 'colorset',
'title' => 'Color Set',
'description' => 'Select the color set you want to use',
'type' => 'select',
'default' => 'ltgrey',
'select_values' => array('ltgrey' => 'Light_Grey', 'blue' => 'Blue', 'brown' => 'Brown')
),
Code: Select all
$defaults = array();
$current_vars = serendipity_loadThemeOptions($defaults);
switch ($current_vars['colorset']){
case 'ltgrey':
$serendipity['smarty']->assign(array(
'template_stylesheet' => 'ltgrey_style.css',
'template_back_arrow' => 'img/ltgrey_back.gif',
'template_forward_arrow' => 'img/ltgrey_forward.gif',
'template_xml_icon' => 'img/ltgrey_xml.gif'));
break;
case 'blue':
$serendipity['smarty']->assign(array(
'template_stylesheet' => 'blue_style.css',
'template_back_arrow' => 'img/blue_back.gif',
'template_forward_arrow' => 'img/blue_forward.gif',
'template_xml_icon' => 'img/blue_xml.gif'));
break;
case 'brown':
$serendipity['smarty']->assign(array(
'template_stylesheet' => 'brown_style.css',
'template_back_arrow' => 'img/brown_back.gif',
'template_forward_arrow' => 'img/brown_forward.gif',
'template_xml_icon' => 'img/brown_xml.gif'));
break;
default:
$serendipity['smarty']->assign(array(
'template_stylesheet' => 'ltgrey_style.css',
'template_back_arrow' => 'img/ltgrey_back.gif',
'template_forward_arrow' => 'img/ltgrey_forward.gif',
'template_xml_icon' => 'img/ltgrey_xml.gif'));
}Code: Select all
{if $template_option.colorset == 'blue'}
<link rel="stylesheet" type="text/css" href="{serendipity_getFile file="blue.css"}" />
{elseif $template_option.colorset == 'cappuccino'}
<link rel="stylesheet" type="text/css" href="{serendipity_getFile file="cappuccino.css"}" />
{elseif $template_option.colorset == 'espresso'}
<link rel="stylesheet" type="text/css" href="{serendipity_getFile file="espresso.css"}" />
{else}
<!-- ****** Change default Colorset here ****** -->
<link rel="stylesheet" type="text/css" href="{serendipity_getFile file="blue.css"}" />
{/if}
Code: Select all
<link rel="stylesheet" type="text/css" href="{serendipity_getFile file=$template_stylesheet}" />This:
Code: Select all
<a title="{$CONST.BACK}" href="{$plugin_calendar_head.uri_previous}"><img alt="{$CONST.BACK}" src="{serendipity_getFile file="img/back.gif"}" /></a>Code: Select all
<a title="{$CONST.BACK}" href="{$plugin_calendar_head.uri_previous}"><img alt="{$CONST.BACK}" src="{serendipity_getFile file=$template_back_arrow}" /></a>That is today's contribution.. works for me, if it can work for anyone else, great! I personally think BulletProof should include a colorset option just to demonstrate how it is done. Does not have to be anything fancy - perhaps just a background color or 2. Does not even have to include this latest code - just the initial array if necessary.