content.tpl

Skinning and designing Serendipity (CSS, HTML, Smarty)
Post Reply
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

content.tpl

Post by yellowled »

Two questions about this part of the default content.tpl:

Code: Select all

{if $searchresult_tooShort}
    <h3 class="serendipity_date">{$CONST.QUICKSEARCH}</h3>
    <div class="serendipity_search serendipity_search_tooshort">{$content_message}</div>
{elseif $searchresult_error}
    <h3 class="serendipity_date">{$CONST.QUICKSEARCH}</h3>
    <div class="serendipity_search serendipity_search_error">{$content_message}</div>
{elseif $searchresult_noEntries}
    <h3 class="serendipity_date">{$CONST.QUICKSEARCH}</h3>
    <div class="serendipity_search serendipity_search_noentries">{$content_message}</div>
{elseif $searchresult_results}
    <h3 class="serendipity_date">{$CONST.QUICKSEARCH}</h3>
    <div class="serendipity_search serendipity_search_results">{$content_message}</div>
{else}
    <div class="serendipity_content_message">{$content_message}</div>
{/if}
1. As far as I have worked with s9y so far, {$content_message} is always empty if no search has been done. That means that the last part will always emit an empty div. Are there actually cases where it is not empty apart from the various search result cases before?

2. If one would not need the individual classes for the various search results, would it cause any issues to shorten the code above like this?

Code: Select all

{if $searchresult_tooShort or $searchresult_error or $searchresult_noEntries or $searchresult_results}
    <dl>
        <dt>{$CONST.QUICKSEARCH}</dt>
        <dd>{$content_message}</dd>
    </dl>
{else}
{/if}
YL
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: content.tpl

Post by garvinhicking »

Hi!

1. Yes, Plugins may use this.

2. Yes, that's okay.

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 »

YL - if your only concern is emitting an empty div, why not just make that last one an {elseif $content_message} ? You can still do your definition list structure.... but at least you will not be emitting an empty container.
=Don=
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Post by yellowled »

Don Chambers wrote:YL - if your only concern is emitting an empty div, why not just make that last one an {elseif $content_message} ?
Because that didn't even cross my mind :-) Very smart, though. Thanks.

YL
Post Reply