Page 1 of 1
Change output of serendipity_printSidebar
Posted: Tue Feb 13, 2007 9:17 pm
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!!!

Posted: Tue Feb 13, 2007 10:29 pm
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?
Posted: Tue Feb 13, 2007 11:33 pm
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???

Posted: Wed Feb 14, 2007 9:44 am
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

Posted: Wed Feb 14, 2007 6:04 pm
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.