Feature Request: Select Sidebar Items Per Template

Creating and modifying plugins.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi bdconnolly!

Sure, here's an example. Pay attention how I placed the IF-clauses with $staticpage_pagetitle throughout the page.

Just have a try with it, experiment and play with it, then I'm sure you'll get the idea :)

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
           "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
    <title>{$head_title|@default:$blogTitle} {if $head_subtitle} - {$head_subtitle}{/if}</title>
    <meta http-equiv="Content-Type" content="text/html; charset={$head_charset}" />
    <meta name="Powered-By" content="Serendipity v.{$head_version}" />
    <link rel="stylesheet" type="text/css" href="{$head_link_stylesheet}" />
    {if $staticpage_pagetitle == 'frontpage'}
    <!-- You may want an extra Stylesheet for your "frontpage" staticpage! -->
    <link rel="stylesheet" type="text/css" href="http://yourblog/templates/myfrontpage/style.css" />
    {/if}
    <link rel="alternate"  type="application/rss+xml" title="{$blogTitle} RSS feed" href="{$serendipityBaseURL}{$serendipityRewritePrefix}feeds/index.rss2" />
    <link rel="alternate"  type="application/x.atom+xml"  title="{$blogTitle} Atom feed"  href="{$serendipityBaseURL}{$serendipityRewritePrefix}feeds/atom.xml" />
{if $entry_id}
    <link rel="pingback" href="{$serendipityBaseURL}comment.php?type=pingback&entry_id={$entry_id}" />
{/if}

{serendipity_hookPlugin hook="frontend_header"}
</head>

<body>

{if $staticpage_pagetitle == 'frontpage'}
<!-- Staticpage "frontpage" called. Using different layout! -->
{else}
<!-- Default "frontpage" called. Using sidebar'ed layout! -->
    <div id="serendipity_banner">
        <h1><a class="homelink1" href="{$serendipityBaseURL}">{$head_title|@default:$blogTitle}</a></h1>
        <h2><a class="homelink2" href="{$serendipityBaseURL}">{$head_subtitle|@default:$blogDescription}</a></h2>
    </div>
    
    <table id="mainpane">
        <tr>
    {if $leftSidebarElements > 0}
            <td id="serendipityLeftSideBar" valign="top">{serendipity_printSidebar side="left"}</td>
    {/if}
            <td id="content" valign="top">
            <!-- Customized Categories! -->
            {serendipity_fetchPrintEntries category="4711"}
            </td>
    {if $rightSidebarElements > 0}
            <td id="serendipityRightSideBar" valign="top">{serendipity_printSidebar side="right"}</td>
    {/if}
        </tr>
    </table>
{/if}

{$raw_data}
{serendipity_hookPlugin hook="frontend_footer"}

</body>
</html>

# 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