Config of Themes - further explanation needed

Skinning and designing Serendipity (CSS, HTML, Smarty)
Post Reply
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Config of Themes - further explanation needed

Post by Don Chambers »

I have read the info here: http://www.s9y.org/137.html, but could use a little more elaboration for types boolean and radio. What would the array statements look like, and what would the corresponding smarty expressions be.

I'm thinking that a radio button would be best for my particular need as it is a simple yes/no question.

Thanks!!
=Don=
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Config of Themes - further explanation needed

Post by garvinhicking »

Hi!

For Boolean:

Code: Select all

$template_config = array(
    array(
        'var'           => 'colorset',
        'title'         => 'Color Set',
        'description'   => 'Enter the color set you want to use for this site',
        'type'          => 'boolean',
        'default'       => 'true',
    )
);
For radio:

Code: Select all

$template_config = array(
    array(
        'var'           => 'colorset',
        'title'         => 'Color Set',
        'description'   => 'Enter the color set you want to use for this site',
        'type'          => 'radio',
        'default'       => 'set1',
        'radio_per_row' => 3,
        'radio' => array('value' => array('set1', 'set2', 'set3', 'set4'),
                                'desc'  => array('Set 1', 'Set 2', 'Set 3', 'Set 4')
    )
);
HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Config of Themes - further explanation needed

Post by yellowled »

Owen Stubbs wrote:I'm thinking that a radio button would be best for my particular need as it is a simple yes/no question.
I can at least help out with radio button code. I have used this in my yl15 template to determine whether additional text should inserted into the page footer. Here's the code (from config.inc.php):

Code: Select all

    array(
        'var'           => 'footer_text',
        'name'          => FOOTER_TEXT,
        'description'   => FOOTER_TEXT_DESC,
        'type'          => 'text',
        'default'       => ' ',
    ),
    array(
        'var'           => 'footer_text_toggle',
        'name'          => USE_FOOTER_TEXT,
        'description'   => USE_FOOTER_TEXT_DESC,
        'type'          => 'radio',
        'radio'         => array('value' => array('true', 'false'),
                                 'desc'  => array(FT_POS, FT_NEG)),
        'default'       => 'false'
    ),
So the first array is for a textarea in which the additional text can be typed. The second array produces the radio box which determines whether to actually insert that text into the footer. Those words in capitals are variables which can be set using the various lang_*.inc.php files (described further on that URL you already found).

Hope this helps,
YL
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Post by yellowled »

.oO( Gee, Garvin's fast ... :wink: )
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

Thanks guys.

@ Garvin - should that radio_per_row be 4 in your example?

@YL - mine was also for something in the footer. In my case, it was whether or not to show nav links. I was also thinking about placing a user editable "copyright message" there. I'm not sure about a copyright/disclaimer "field" unique to a theme though - I think s9y should have that particular field in the core.
=Don=
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi Owen!

Since serendipity is BSD license, it's in our full spirit to not put copyright notices in there. So a core config field for this will never happen. At least not with me in the same boat. *g*

I believe in theme designers getting credit for their theme in their own template files, though. :)

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

garvinhicking wrote:Hi Owen!

Since serendipity is BSD license, it's in our full spirit to not put copyright notices in there. So a core config field for this will never happen. At least not with me in the same boat. *g*

I believe in theme designers getting credit for their theme in their own template files, though. :)

Best regards,
Garvin
I didn't mean a s9y copyright, I was referring to a user message... Like "Content on this site is copyrighted by me", or a disclaimer "Advice provided by this site is not to be taken seriuosly".

I agree about the template author though. Having the info there makes it possible for others to contact the author if they want a custom revision. Probably does not hurt the author's google rank either! :D
=Don=
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!
I didn't mean a s9y copyright, I was referring to a user message... Like "Content on this site is copyrighted by me", or a disclaimer "Advice provided by this site is not to be taken seriuosly".
Ah, okay. That is something more profane then, I understand.

I must admit though that I feel this is much more appropriate for users to add into their theme index.tpl files?

If we were to support a customizable 'disclaimer', every single theme would need to be updated to support that new option. I suppose that is way too much overhead for that singular usage?

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

garvinhicking wrote:Hi!
I didn't mean a s9y copyright, I was referring to a user message... Like "Content on this site is copyrighted by me", or a disclaimer "Advice provided by this site is not to be taken seriuosly".
Ah, okay. That is something more profane then, I understand.

I must admit though that I feel this is much more appropriate for users to add into their theme index.tpl files?

If we were to support a customizable 'disclaimer', every single theme would need to be updated to support that new option. I suppose that is way too much overhead for that singular usage?

Best regards,
Garvin
If it were contained solely in the theme, then a user would need to change that text if they changed their theme. While I agree there are plenty of themes out there that would not have this functionality, the same can be said of any of the new features of the theme configurator, as well as many of the new smarty variables.

I'm certainly not begging for a disclaimer field, I just happen to think it would be a nice addition since so many sites want to display something at the page bottom, and the only way to presently do that is by modifying index.tpl, OR if a theme designer puts it uniquely into their theme. Seems it would be easier for designers to place something like {$sitedisclaimer} if/where they wanted it rather than to have to define it in their config.inc.php, which would not allow the text to carry over from one theme to another, or possibly from one version of a theme to a new one (maybe).
=Don=
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

I think the only workable approach is to make new serendipity 1.1 themes support that disclaimer field :-)

So you'd need to convince template authors that this config option is a usable thing, and that template authors decide on a common term to use for that option? :)

Adding a global theme config option could be added later, when some themes all support $template_config.theme_disclaimer, for instance? Adding support for that before templates support it would be weird. But this tends to have the chicken-egg problem. :)

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply