How do I change the font look for....

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
DragonFly
Regular
Posts: 30
Joined: Thu Jan 19, 2006 1:55 pm
Contact:

How do I change the font look for....

Post by DragonFly »

How do I change the look of the font for 'Continue Reading...' in the extended entry section?
DragonFly
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: How do I change the font look for....

Post by garvinhicking »

By editing your entries.tpl file, and giving the link a unique CSS ID/class so that you can style it via CSS.

Serendipity 1.0-beta2 has this unique ID/class builtin...

HTH,
Garvin
# 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/
DragonFly
Regular
Posts: 30
Joined: Thu Jan 19, 2006 1:55 pm
Contact:

I don't seem to have an entries.tpl file

Post by DragonFly »

After looking at some of the other templates in file manager, I found that I don't seem to have one of those entries.tpl files like the others.

Can this be?
DragonFly
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post by carl_galloway »

Dragonfly, the entries.tpl file can be different for every theme, this is because designers may wish to alter the way the default entry is displayed.

Depending on which theme you're using and whether it includes additional or non-standard styles you may be able to simply copy the entries.tpl from another theme into the theme you're using. You will then also need to adjust your stylesheet to get the effect you're looking for.

Carl
DragonFly
Regular
Posts: 30
Joined: Thu Jan 19, 2006 1:55 pm
Contact:

Extended Entry Issue

Post by DragonFly »

Being a newbie to all of this, I'm liable to mess up my website but good if I go tinkering with certain aspects of the template without strict supervision.

I'd like to know what the minimum code requirement would be for use in my template in order to alter the look of "Continue Reading..."

Can I get away with just this?


{if $entry.is_extended}
<div class="serendipity_entry_extended"><a id="extended"></a>{$entry.extended}</div>
{/if}

{if $entry.has_extended and not $is_single_entry and not $entry.is_extended}
<br /><a href="{$entry.link}#extended">{$CONST.VIEW_EXTENDED_ENTRY|@sprintf:$entry.title}</a><br /><br />
{/if}


And what would I have to alter in the above for it to function properly in my template?

I have another question, but I dare not ask it until I get clear with this.
DragonFly
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post by carl_galloway »

Dragonfly, unfortunately what you've changed isn't going to help you very much. All that does is add a couple of line breaks, but doesn't actually change the font. I'm assuming you want to change the color or perhaps the positioning, so the first thing you need to do is put in some html that you can actually change in your stylesheet. So, wrap a paragraph <p> around your 'continue reading' link, on its own a <p></p> will automatically add the line breaks anyway. Ok, now that they're in place, you need to add a class to them so that in your stylesheet you can not adjust the font, color, line-height, margins, borders and a lot more. Replace your caode with this;

Code: Select all

{if $entry.is_extended}
<div class="serendipity_entry_extended"><a id="extended"></a>{$entry.extended}</div>
{/if}

{if $entry.has_extended and not $is_single_entry and not $entry.is_extended}
<p class="continue_reading"><a href="{$entry.link}#extended">{$CONST.VIEW_EXTENDED_ENTRY|@sprintf:$entry.title}</a></p>
{/if}
Now open your stylesheet, 'style.css' in your theme folder, and add this;

Code: Select all

.continue_reading {
color: orange; 
} 
Save your stylesheet and look at your theme in your browser again. Your 'continue reading' link should now be orange, or some vague impersonation of orange.

Now that you know how to change the link you could experiment with different styles.

On another point, don't be too afraid of playing around with your template files, just make a backup before you start playing. You can't damage your database by messing up your theme, and if it gets really messy just replace the files with your backup.

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

Post by carl_galloway »

Another option if you don't want to use a paragraph is a <span> around the 'continue reading';

Code: Select all

<span class="continue_reading"><a href="{$entry.link}#extended">{$CONST.VIEW_EXTENDED_ENTRY|@sprintf:$entry.title}</a></span>
Either way will work for you except that your browser will apply different defaults to the spacing of a span than it would for a paragraph.

Carl
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

Glad to see you're moving right along, DragonFly.

Carl's absolutely correct, as is Garvin. The only clarification I wanted to add was: if your theme has no <whatever>.tpl, the one from templates/default will be used instead. You can modify it directly if you wish; if you use the <span> tag, it shouldn't effect the rendering of other themes.

The other obvious option is to copy the templates/default/<whatever>.tpl file to your directory and modify it there. Then it can't effect other themes. (Not that your blog uses any other themes.)
Judebert
---
Website | Wishlist | PayPal
DragonFly
Regular
Posts: 30
Joined: Thu Jan 19, 2006 1:55 pm
Contact:

Regarding the 'continue reading' topic.

Post by DragonFly »

Thanks guys,

I will get to work on this just as soon as I can.

I'm on the verge of closing on the house I'm in right now.

The buyers pulled a fast one and shaved off (10) much needed days from my moving schedule, and I'm having to move at cartoon speed now.

Will get back to you as soon as I stop running into myself.
DragonFly
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

Well, you should've known when the seller's agent wore her ACME uniform. :lol:
Judebert
---
Website | Wishlist | PayPal
DragonFly
Regular
Posts: 30
Joined: Thu Jan 19, 2006 1:55 pm
Contact:

Thanks Judebert

Post by DragonFly »

Thank you Judebert.

I need a laugh about now. :(

Talk to you later.
DragonFly :wink:
DragonFly
Post Reply