Change output of serendipity_printSidebar

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:

Change output of serendipity_printSidebar

Post by Don Chambers »

Sidebar content is rendered from the serendipity_printSidebar function (assuming "function" is the proper term - I'm not a programmer).

It produces:

Code: Select all

<div class="serendipitySideBarItem (plus whatever plugin class)">
<div class="serendipitySideBarTitle" (plus whatever plugin class)">
<div class="serendipitySideBarContent">
whatever content is produced by the plugin
</div></div></div>
I need to get some divs before, after and between some of this stuff. How do I do that?

I'm working on a theme that, IMHO, will offer a LOT of flexibility as it relates to theme graphics. I'm also anxious to get this figured out!!! :)
=Don=
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

Found it - sidebar.tpl located in the /default-php/ folder. Am I correct in assuming that, if a version of this file exists in my theme folder, it will be used in place of the default?

Also, what is proper procedure. I want to add several other DIVs to what is already there. Should I feel free to change the class ID's already used so they more closely resemble what I am about to add, or keep those already in use?
=Don=
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

This isn't working. The sidebar.tpl is php:

Code: Select all

<?php if ($GLOBALS['tpl']['is_raw_mode']): ?>
<div id="serendipity<?= $GLOBALS['tpl']['pluginside'] ?>SideBar">
<?php endif; ?>
<?php foreach($GLOBALS['tpl']['plugindata'] AS $item): ?>
    <div class="serendipitySideBarItem container_<?= $item['class'] ?>">
        <?php if ($item.title != ''): ?><h3 class="serendipitySideBarTitle <?= $item['class'] ?>"><?= $item['title'] ?></h3><?php endif; ?>
        <div class="serendipitySideBarContent"><?= $item['content'] ?></div>
    </div>
<?php endforeach; ?>
<?php if ($GLOBALS['tpl']['is_raw_mode']): ?>
</div>
<?php endif; ?>
HELP!!!!

EDIT - It gets even worse!!!! I thought this would work, so I placed a copy of this file in my theme directory and added the <divs> I wanted.

When I saw it was not working, I deleted the file. However, it is as if the file is still there!!! When I view my source, the output is identical to the changes I made, but the file does not exist!!!!

What the heck is going on??? :evil:
=Don=
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Do not use or change anything in the 'default-php' directory. It'S for developers only. You should maybe actually delete the default-php directory so that you will not confuse it with any other files.

Use the file in the 'Default' directory for modification! sidebar.tpl is the right file :)
# 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 »

Thanks Garvin. I found the right one but forgot to post a message. Also corrected the problem of the lingering effects by deleting the appropriate file from the templates_c folder.
=Don=
Post Reply