Page 1 of 2
Adding "Recent Entries" to another page on my site
Posted: Fri Nov 03, 2006 7:02 pm
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?
Re: Adding "Recent Entries" to another page on my
Posted: Fri Nov 03, 2006 7:07 pm
by garvinhicking
Hi!
Actually, there are several ways to achieve this:
http://www.s9y.org/forums/viewtopic.php ... 2A+backend
HTH,
Garvin
Posted: Fri Nov 03, 2006 7:28 pm
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?
Posted: Fri Nov 03, 2006 7:45 pm
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
Posted: Fri Nov 03, 2006 7:59 pm
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?
Posted: Fri Nov 03, 2006 8:12 pm
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
Posted: Fri Nov 03, 2006 8:19 pm
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
Posted: Sat Nov 04, 2006 4:31 pm
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?
Posted: Sat Nov 04, 2006 5:30 pm
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;
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.
Posted: Sat Nov 04, 2006 5:34 pm
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.
Posted: Sat Nov 04, 2006 5:39 pm
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
Posted: Sat Nov 04, 2006 5:59 pm
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.
Posted: Sat Nov 04, 2006 6:21 pm
by toves
You're a star
All fixed, many thanks

Posted: Sat Nov 04, 2006 6:25 pm
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.
Posted: Sat Nov 04, 2006 6:34 pm
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
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
