Page 1 of 1

Editing HTML?

Posted: Thu Apr 19, 2007 10:16 pm
by cybertongue
Sorry if this has already been addressed elsewhere, but I was unable to find any specific information.

I'm wondering if there is any way to access and edit the HTML code for the site, specifically, headers and footers. I'd like to add some banners and AdSense code to my site but haven't been able to figure out how to go about doing that, other than insert it into one of my blog entries.

If the only place I can do that is in an entry, how do I go about making an entry sticky so that it doesn't rotate down the page as new entries are added?


Thanks in advance! :)

Re: Editing HTML?

Posted: Fri Apr 20, 2007 1:01 am
by yellowled
cybertongue wrote:Sorry if this has already been addressed elsewhere, but I was unable to find any specific information.
http://www.s9y.org/44.html#A13
cybertongue wrote:I'm wondering if there is any way to access and edit the HTML code for the site, specifically, headers and footers. I'd like to add some banners and AdSense code to my site but haven't been able to figure out how to go about doing that, other than insert it into one of my blog entries.
You have to edit the .tpl files in the folder of the template you're using. See above for detailed information. Basically, those files determine the HTML output of s9y. I can give more detailed examples tomorrow when I'm back at my home machine, or someone else may fill in.
cybertongue wrote:If the only place I can do that is in an entry, how do I go about making an entry sticky so that it doesn't rotate down the page as new entries are added?
It's not the only place, but anyway this can be done using the ... hrm, I'm German, and sometimes I can't for the life of me remember the English plugin names ... serendipity_event_entryproperties, that's it. This add the sticky entries feature. Plugin ships with the s9y zipfile ... I think. Damn, I should get to bed soon :wink:

YL

Posted: Fri Apr 20, 2007 5:15 am
by cybertongue
Thank you for taking the time to reply, and yes, you did help. :)

Posted: Fri Apr 20, 2007 11:22 am
by yellowled
cybertongue wrote:Thank you for taking the time to reply, and yes, you did help. :)
Let's get you started, shall we? So here's the example I promised. By the way, did I mention there's always the possibility to use the HTML Nugget sidebar plugin to integrate HTML into the sidebars? :)

Okay, let's assume you're working with the reigning default template 'carl_contest', and you want to add a banner between the serendipity banner on top of the page and the actual content. This has to be changed in the file index.tpl, so let's take a look at that code:

Code: Select all

<div id="wrap">
<div id="serendipity_banner"><a id="topofpage"></a>
    <h1><a class="homelink1" href="{$serendipityBaseURL}">{$head_title|@default:$blogTitle|truncate:80:" ..."}</a></h1>
    <h2><a class="homelink2" href="{$serendipityBaseURL}">{$head_subtitle|@default:$blogDescription}</a></h2>
</div>

<table id="mainpane">
So we have a wrapper div holding everything else together, a div for the s9y banner and a table - urks - holding content and sidebar columns. Now we want to add banner space inbetween, so we edit the index.tpl like this:

Code: Select all

<div id="wrap">
<div id="serendipity_banner"><a id="topofpage"></a>
    <h1><a class="homelink1" href="{$serendipityBaseURL}">{$head_title|@default:$blogTitle|truncate:80:" ..."}</a></h1>
    <h2><a class="homelink2" href="{$serendipityBaseURL}">{$head_subtitle|@default:$blogDescription}</a></h2>
</div>

<div id="bannerspace">
<!-- enter your content here -->
</div>

<table id="mainpane">
Throw in some CSS (which I assume you're firm with) and you're done :)

YL