September 17, 2007

Show Recent Posts 2, a RapidWeaver snippet

RapidWeaver snippet
The "Show Recent Posts 2" snippet is a cute little implementation of SimplePie RSS parser designed with RapidWeaver in mind. "Show Recent Posts 2" allows you to do just that, show your most recent blog posts on any other page (aside from you blog page of course), while maintaining some of your blogs original formating. This version also includes the function for controlling the length of the posts. "Show Recent Posts 2" can be used in your main content area, in your sidebar, or where ever you think it would fit.


Y
ou can get a copy here:
showrecentposts2.zip

20 comments:

Bert Van Wassenhove said...

I can't get this snippet to work, this is what I get:

'; echo '
'; echo ''; echo $item->get_title() . ''; echo '
'; echo '
' . $item->get_date('j M Y') . '
'; echo '
'; echo shortdesc($item->get_description(), 150); echo ''; echo 'Lees verder.' . ''; echo '

Adam Merrifield said...

You haven't followed all the directions. Also, it can't be previewed in RapidWeaver, only live on a web server.

Bert Van Wassenhove said...

Well, if you can tell me where I went wrong ... I'll pay you a beer:
http://www.flyingdutchman.info/index.html

Adam Merrifield said...

Yes you didn't mark your code with "Format > Ignore Formatting"

Bert Van Wassenhove said...

Sorry, no beer.

I tried both using HTML (sidebar) and Styled with 'Ignrore Formatting'. Both don't work.

I tested the server config, that's OK. And the simplepie.inc file is on the server too ...

B.

Adam Merrifield said...

Tell me I'm wrong all you like, ;) but I can tell by looking at the source code that RapidWeaver is treating it like rich text and and not PHP code. Otherwise I wouldn't see the PHP code there. You need to make sure you paste it in as plain text and make sure formatting is turned off.

David Kaspi said...

I have the same problem as Bert.
The Page I use is HTML so I guess it should work , but it doesn't.
I'm very curious how this got solved, because I see on Bert's link that it's working there.

Adam Merrifield said...

@David, do you have a link?

David Kaspi said...

Hi Adam,
It's http://www.kaspi.tv
I applied it to the page called 'samenvatting'.
And a page calle 'test', a styled text page.
Made an invisible cache page (styled text page).
And the 'samenvatting' page is is a HTML page.
Changed the index to php, but that doesn't seem to do anything.

David Kaspi said...

I also applied it to the homepage, a stacks page, that also has the RSS stack applied. It works, but that looks to much like a Google ad to me..:)
Maybe it has to do with the cache page, in your manual, you write it should be 'inline' with the page. What do you mean by that?

Adam Merrifield said...

@David it looks like everything is fine on your end, you just haven't specified a proper feed URL. Follow the exact (I can't stress "exact" enough) directions, step-by-step, as they really are the only directions I can provide.

David Kaspi said...

Hi Adam, thanks for your quick reply. Because in the snippet the URL ends with .php, I thought my feed address wasn't correct, because it ends with .xml.
I thought, I'd try it first with the standard feed you provided.
I've entered the correct URL and on the HTML page it seems to work (yippeee), but the styled text still looks the same.
Is there any way I can include the pictures too?

Adam Merrifield said...

@David as I have mentioned in earlier comments, you need to paste the code in as plain text (see RapidWeaver Edit menu) and you need to mark it as "Ignore Formatting" (see RapidWeaver Format menu).

David Kaspi said...

Hello Adam, after a few hours of trying, still no result.
You were right the first time,I just checked Clear formatting, so there I went wrong.
But now my styled text page is completely blank, even no theme, and the background of my homepage is disappeared causing my extra content container to look funy.
The harder it gets, the more I'm determined to solve this. Especially the feed looks fantastic on

http://simplepie.org/demo/?feed=http%3A%2F%2Fwww.kaspi.tv%2Fblog%2Ffiles%2Fblog.xml

Seems it's gonna be a loong night.. (I live in Amsterdam, The Netherlands)

I followed all the instructions; Pasted the text as plane style.
The background of the Edit window is red, indicating that Formatting is Ignored.

http://www.kaspi.tv
and
http://www.kaspi.tv/styledtext

both have the simplepie.inc in the assets window of the Page Info

I just switched from iWeb to Rapidweaver, and this is my fist big web-project, so kind of new to all of this coding.
The rest of my site was quite easy, but I don't seem to get my head wrapped around this one.

Anonymous said...

Not sure if this helps, but I get the same problem with contact form.
Strange code in my input fields.
The index I've changed to .php.

David Kaspi said...

that was me, the Anonymous.
sorry, forgot to fill in my name

David Kaspi said...

Hi Adam,
It seems that I got it finally to work.
Is there any way that I also can display the pictures in the list?

Adam Merrifield said...

@David pictures are stripped out due to the fact that code required to display images would completely take up the character count and more.

Pete Skewes said...

Hi Adam,

I've read the instructions, and the comments here, but I'm having troubles. What have I done wrong?

http://www.vincentiasailingclub.com.au/index1.html

I have the cache page as a child of this page

Adam Merrifield said...

php only works on pages with a php extension.