Help needed with a few small CSS adjustments

Skinning and designing Serendipity (CSS, HTML, Smarty)
Post Reply
robintw
Regular
Posts: 10
Joined: Sat Jul 31, 2004 12:41 am

Help needed with a few small CSS adjustments

Post by robintw »

Hi,

I've created my own theme, well modified one of the existing ones, to make s9y fit nicely into my website. What I've done so far can be found at http://robinwilson.homelinux.com/NewWebsite/blog.php.

I've managed to adjust most things in the style.css file to make it work - partly through trial and error (although I do have some experience with CSS).

There are just a few questions I want to ask:

1) I would like to make the title at the top "A Year in the life of a YINI students" plain black, and preferably not a link. I can't seem to see if that is possible, but if it isn't then presumably I can use a text-decoration: none; to get rid of the underline. The problem is I'm not sure exactly where to put that, and the colouring commands in the CSS file. Where should they go?

2) Is it possible to change the background colour of the "August 06" bit of the calendar? At the moment it is white, and that shows up rather against my website's background.

3) How should I go about making the actual body text of each blog post not indented? It's not disasterous if this can't be implemented - but I'd prefer the left margins to all line up.

Just one other, slightly different, question. I have this linked into a normal php page on my website using the simple method outlined http://www.s9y.org/123.html. If I change the configuration of s9y to make blahblah/NewWebsite/blog.php the main address of my blog, will it allow me to browse the archives and everything through that page?

Thanks in advance,

Robin
d_cee
Regular
Posts: 603
Joined: Wed Jan 18, 2006 6:32 pm
Location: UK
Contact:

Post by d_cee »

Hi robintw

I was going to take a look but the link is dead

Dave
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post by carl_galloway »

Robin, unfortunately your blog has some errors, I was able to access your blog using this url, but it looks like you're trying to embed your serendipity into your existing website and your stylesheet is missing all of the Serendipity specific style names.

Could you give us a little more background of what you're hoping to achieve, we'll happily help you with customising your template once we know more.

Cheers

Carl
robintw
Regular
Posts: 10
Joined: Sat Jul 31, 2004 12:41 am

Post by robintw »

Hi,

I was having a bit of a play around last night, so I think I might have sorted the problem you're talking about no - so if you want you can try it again at http://robinwilson.homelinux.com/NewWebsite/blog.php.

I'm trying to get s9y to fit in with my main website, by setting it to embedded: yes and then mucking around with the stylesheets to get it to fit. I've taken the stylesheets from one of the themes, and put them in my main site stylesheet, and I think that's what I'm supposed to have done.

Please correct me if I'm wrong!

Robin
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post by carl_galloway »

ok I see what you're doing now. BTW, your link still doesn't work because the final period (.) isn't required. Anyway, I can now see your blog as intended.

Also, your embedding hasn't worked correctly. Its true that your blog is now visible inside your blog landing page, but as soon as you click any of the links the user is taken directly to Serendipity and then of course the styling is missing. You should search these forums for embedding info.

1a. The title color/underline. In your stylesheet, edit the homelink1 style.

Code: Select all

a.homelink1, a.homelink1:hover, 
a.homelink1:link, a.homelink1:visited,
#serendipity_banner h1 
{color:#000000; text-decoration:none; }
1b. Removing the title link, this is tricky, and I can't give you a specific answer about which file to edit until you've successfully embedded your blog. Once you have though, edit index.tpl form the template folder and remove the link code from the <h1> so it reads.

Code: Select all

<h1>{$head_title|@default:$blogTitle}</h1>
2. The calendar header, in your stylesheet, edit

Code: Select all

td.serendipity_calendarHeader a:link,
td.serendipity_calendarHeader a:visited,
td.serendipity_calendarHeader a:hover {
background-color:#YOURCOLOR;
}
3. Indenting your entries, simply remove any margin-left or padding left; from .serendipity_entry in your stylesheet.

Your last question is related to embedding. If you still need help with embedding, if the documentation hasn't helped, then we need one of the programmers to help.

Cheers, and good luck
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

Hmmmmm. Maybe I'm starting to understand this at last...

Embedding Serendipity into an existing page just by calling it in the page's HTML/PHP is simple. Setting the "embed" configuration in Serendipity causes it to skip styles and the HTML <HEAD> and <BODY>; your wepage has to take care of that. But Serendipity will still call its templates, and still produce sidebar contents.

That should all work properly, although I can't see your blog in the website (perhaps recent changes have modified the situation since Carl posted).

The problem is going to come along with the other thing Carl mentioned: Serendipity builds links to itself, not to other applications. But Garvin thinks of everything, and he thought of this, as well! You can change the URL Serendipity builds by changing the "indexFile" embedding option.

You can't just use any old wrapper file, though. You need to call your original web page (to provide the HTML <HEAD>, <BODY>, and style), and also call Serendipity (to get the blog output). Let's call the script wrapper.php. In your case, you want it to call blog.php to create all the data for the HTML page, like your custom menu. Your blog.php will be responsible for outputting the $blog_data variable. An example of such a wrapper is here, and in your case it will look like this ($DEITY, I hope I've got this right):

Code: Select all

<?php
// wrapper.php
// Assuming you've got blog.php in /NewWebsite/, and Serendipity
// installed in /NewWebsite/serendipity/.
// Put the Serendipity content in a variable (must be called first!)
chdir('serendipity');
ob_start();
require 'index.php';
$blog_data = ob_get_contents();
ob_end_clean();
chdir('..');

// Now we include our normal content building file.
// This one has to make use of your $blog_data variable to print
// the content where appropriate!
require 'blog.php';
?>
Make sure Serendipity is set to "embed", "indexFile" is set to "/NewWebsite/wrapper.php", and /NewWebite/blog.php calls "<?php print($blog_data); ?>" wherever you want the blog to show up. Serendipity's links will now point to http://yourdomain/NewWebsite/wrapper.php?whatever instead of directly to Serendipity, which will actually call both Serendipity and your existing website formatting!

Wow! This isn't as difficult as I originally thought! Things have been a little confused because we've been calling two different scripts a "wrapper"! If this works for you, I'm totally rewriting the tutorial on the main website. Again.
Judebert
---
Website | Wishlist | PayPal
Post Reply