Adding "Recent Entries" to another page on my site

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
toves
Regular
Posts: 24
Joined: Tue Mar 07, 2006 1:40 pm

Adding "Recent Entries" to another page on my site

Post by toves »

Hi All,

As per the title, I currently have my blog here: http://www.10yetis.co.uk/yetiblog

and on our home page ( http://www.10yetis.co.uk ) I am currently manually adding "recent entries" which I also have on the left hand side part of the blog.

Is there a way I can add that part from the blog to my home page so that I don't have to manually update all the time?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Adding "Recent Entries" to another page on my

Post by garvinhicking »

Hi!

Actually, there are several ways to achieve this: http://www.s9y.org/forums/viewtopic.php ... 2A+backend

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/
toves
Regular
Posts: 24
Joined: Tue Mar 07, 2006 1:40 pm

Post by toves »

Hi Garvin :)

I have downloaded

http://spartacus.s9y.org/cvs/additional ... ackend.zip

it's not too clear where I upload it to?
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post by carl_galloway »

Hi Toves,

Unzip the file, then upload the resulting folder to your plugins folder. After that, simply go to the plugins screen in the s9y admin suite and scroll down to install event plugin. you should see it appear in that list.

Cheers

Carl
toves
Regular
Posts: 24
Joined: Tue Mar 07, 2006 1:40 pm

Post by toves »

Thanks Carl,

I'm being thick :)

I have put the following in my index.html page:

<script src="yetiblog/plugins/backend?category=s9y&num=30&order=DESC&date=1&dateformat=d.m.Y&time=1&timeformat=H:i&point=*"></script>

I changed the name of the folder to recent_entries and uploaded it to the plugins directory.

I installed it in the admin interface, and left everything as default.

It's not showing up, any ideas?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Since you don't run URL rewriting, your URL must more look like this:

http://www.10yetis.co.uk/yetiblog/index ... H:i&point=*

However I get a blank page with that. Did you make sure that you configured the plugin to use the "backend" name for the URL?

Also please put the plugin file into a folder "serendipity_event_backend". Always use the name of the plugin PHP file as the base folder name (without ".php"). You will need to re-install the plugin after you rename a folder...

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/
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post by carl_galloway »

As far as I know, changing the plugin folder name can often (if not always) break the plugin, the reason I think is because the folder name and plugin name havr to be identical because serendipity uses the plugin name to create the path it needs to find the plugin files. Could you try renaming it back to the original and test that, if that works, it will at least get you started. Unfortunately when it comes to supporting plugins I'm very much the novice.

DAMN, Garvin beat me to it, I thought he'd logged off, just ignore my ramblings
toves
Regular
Posts: 24
Joined: Tue Mar 07, 2006 1:40 pm

Post by toves »

thanks guys, that's it :)

I'm almost there, just need to style it - any idea how I can insert a line break between each entry to break it up a bit?
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post by carl_galloway »

It looks like you've already got some spacing between your recent posts, but in the event that you want more, there are already two <br /> between each entry, so in your main site stylesheet, add the following;

Code: Select all

.small_box br {line-height:1.5;}
You will notice that my small box has an underscore, and yours in fact doesn't, you may wish to add this to your own so that this change works for you. CSS doesn't allow a single style name to be made up of tow or more words without some way of joining them such as a hyphen or underscore. A space effectively starts a new html tag, class or id.

My snippet above will give more spacing than you currently have, then simply play with the line-heights to get it just the way you want it. You can also use px, pt, or em in the line-height if this will maintain a standard across your template.
Last edited by carl_galloway on Sat Nov 04, 2006 5:34 pm, edited 1 time in total.
toves
Regular
Posts: 24
Joined: Tue Mar 07, 2006 1:40 pm

Post by toves »

Thanks Carl :)

I think you're look the version I manually edit?

the version i'm playing about with is here:

http://10yetis-co-uk.satpreprop.helmcontrolpanel.net/

I've tried adding the following line into "serendipity_event_backend.php"

$linebreak = ('\n');

and adding &linebreak to my string, but still no luck.

I can adjust line height of the box class, but then it adjusts it for all lines rather than a break between each entry.
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post by carl_galloway »

Sorry Toves, I edited my entry, while you were reading it, and then when I saved it you already replied, sorry about that.

But to answer your question, by placing the br after the small_box in your stylesheet you are telling the browser to only adjust the lineheight of the br, not the text.

I'll take a look at your other code now, and then reply again, so don't go offline
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post by carl_galloway »

That is really strange, I guess by inserting it within a <script> tag its losing all its formatting. My version of hte rentent entries plugin has a single <br /> instead of the two that your manual version has, and looking at your test page it is being recognised, so perhaps add an additional <br /> to this line of serendipity_plugin_recententries.php

Code: Select all

                echo '<a href="' . $entryLink . '" title="' . htmlspecialchars($entry['title']) . '">' . $entry['title'] . '</a><br />'
                     . '<div class="serendipitySideBarDate">'
                     . htmlspecialchars(serendipity_strftime($dateformat, $entry['timestamp']))
                     . '</div><br />';
which is at the very bottom of the file.
toves
Regular
Posts: 24
Joined: Tue Mar 07, 2006 1:40 pm

Post by toves »

You're a star :)

All fixed, many thanks :D
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post by carl_galloway »

No problem at all, this has been a learning curve for me too. BTW, great to see the 10 yetis business looking successful. Its been a while since I visited your site and it looks very different in positive ways. How are you getting on with promoting the site, if I remember correctly we sorta kinda vaguely talked about comparing notes.
toves
Regular
Posts: 24
Joined: Tue Mar 07, 2006 1:40 pm

Post by toves »

Yes that's right, good memory!

10 Yetis is going well, I redesigned the site recently and changed the blog to fit in with this. I think I was going to somehow let other people use it as a theme but then realised that my code was really messy and would do the blog quite a diservice :D

My understanding of css has improved now though so I think I'll have a go at doing one, as a thanks to you guys for being so helpful :D
Post Reply