Page 1 of 1

Structured Blogging

Posted: Sat May 13, 2006 5:48 pm
by sir17
Hi all,
I love Serendipity and am running my blog as well as several other projects on it.
I was introduced to structured blogging / microformats recently, and might spend time on helping with the standards. I'm convinced this is gonna take off soon. See http://www.structuredblogging.org/.
So there are plugins for Wordpress and MT so far and I thought it would be great to have this for Serendipity too. I'm not the greatest developer and don't have much spare time at the moment, so I was wondering how hard it would be to take these open source scripts and integrate them into Serendipity. Just wanted to put it out there and see if other people are sharing my thoughts and if someone might be interested in taking this on.

Cheers,
Chris

Posted: Sun May 14, 2006 12:10 am
by azel
I think it sounds pretty neat. Maybe some of the code gurus around here will tackle it. :D

Posted: Sun May 14, 2006 2:56 pm
by garvinhicking
Yes, we've had this some time ago:

http://www.s9y.org/forums/viewtopic.php ... d+blogging

Since then I have not yet looked again at the WP code, but at that time it was a nightmare I was refusing to adapt.

Basically, s9y is all ready for it, and plugins should be portable to s9y and work there easier than in WP. I'm willing to help any developer on this who wants to have a go at it, and will answer any question regarding that and try to help as good as possible. But I can't do it myself, my time schedule is too loaded right now.

Best regards,
Garvin

Let's get to work

Posted: Tue Jul 11, 2006 12:46 pm
by mattsches
I've also been thinking about adding some microformats functionality - especially hReview - to my blog, but I'm still uncertain how to approach this. Maybe with an optional popup window where I can enter the review info? I would appreciate any input on this.

For a start, I decided to add basic hcard and/or XFN features to my link list/blogroll which turned out to be really simple. I changed two lines in serendipity_plugin_linklist.php and extended the XML that is fed to the plugin with two custom attributes. Now my links look something like this (in reality, I haven't met Garvin; this is just an example; and it's not yet in my live blog):

Code: Select all

<li class="menuitem vcard">
<a class="link url fn" rel="friend met" href="http://www.supergarv.de/"  target="_self" title="Garvin Hicking">Garvin Hicking</a>
</li>
So, if anyone is interested in this ...?

- Mattsches

Re: Let's get to work

Posted: Tue Jul 11, 2006 12:51 pm
by garvinhicking
Hi!

I personally would not favour a popup solution, but more "collapsing" field in the "Extended Properties" section when creating an entry?

Basically, much like the freetag-plugin, only with more fields?
So, if anyone is interested in this ...?
Definitely! Pleas send patches/code :)

Best regards,
Garvin

Re: Let's get to work

Posted: Tue Jul 11, 2006 2:22 pm
by mattsches
garvinhicking wrote:I personally would not favour a popup solution, but more "collapsing" field in the "Extended Properties" section when creating an entry?

Basically, much like the freetag-plugin, only with more fields?
Sounds reasonable ... I will experiment with your approach.

One more idea is that I'd like to put editable templates for several microformats into the plugin folder. That's because I initially used the hReview Creator for my first steps but wasn't satisfied with the generated code. So if we use templates with placeholders, users would have a greater degree of freedom.

I'll keep you updated with my progress, and also will be glad to send you patches as soon as I'm happy with my changes...:wink:

- Mattsches

Re: Let's get to work

Posted: Tue Jul 11, 2006 2:46 pm
by garvinhicking
Hi!

That sounds great, keep it coming :)

Best regards,
Garvin

hCard patch and usage

Posted: Mon Jul 17, 2006 12:28 pm
by mattsches
So, as I said I made a simple patch for adding basic hcard data to s9y_event_linklist. This method only works with the two CSS-based link lists, though. DTree is not yet supported: We could ask the dtree maintainers to add hCard support, but OTOH I'm not sure if it makes sense anyway because the JS won't get parsed by search engines or applications, right?

Here's the patch for serendipity_event_linklist.php:

Code: Select all

87,88c87,88
<                     $propbag->add('default', '<dir name="PHP">'."\n".'  <dir name="Official PHP Sites">'."\n".'    <link name="PHP" link="http://php.net/" />'."\n".'    <link name="Zend" link="http://zend.com/" />'."\n".'  </dir>'."\n".'  <link name="Serendipity" link="http://s9y.org/" />'."\n".'</dir>'."\n\n".'<dir name="Friends">'."\n".'  <link name="Garvin Hicking" link="http://www.supergarv.de/" />'."\n\n".' <link name="Matthew Groeninger" link="http://www.theledge.net/" />'."\n\n".'</dir>'."\n\n".'<link name="OXYGEN Web Solutions" link="http://oxygenws.com/" />');
<                     $propbag->add('lang_direction', 'ltr'); 
---
>                     $propbag->add('default', '<dir name="PHP">'."\n".'  <dir name="Official PHP Sites">'."\n".'    <link name="PHP" link="http://php.net/" />'."\n".'    <link name="Zend" link="http://zend.com/" />'."\n".'  </dir>'."\n".'  <link name="Serendipity" link="http://s9y.org/" />'."\n".'</dir>'."\n\n".'<dir name="Friends">'."\n".'  <link name="Garvin Hicking" link="http://www.supergarv.de/" hcard="fn" rel="friend" />'."\n\n".' <link name="Matthew Groeninger" link="http://www.theledge.net/" hcard="fn" rel="friend" />'."\n\n".'</dir>'."\n\n".'<link name="OXYGEN Web Solutions" link="http://oxygenws.com/" />');
>                     $propbag->add('lang_direction', 'ltr');
387c387
<                         $basic_array = array('linkloc'=>$this->decode($struct[$i]['attributes']['LINK']),'name'=>$this->decode($struct[$i]['attributes']['NAME']),'descr'=>$this->decode($struct[$i]['attributes']['DESCR']),'level'=>$level_pass,'dirname'=>$dirname);
---
>                         $basic_array = array('linkloc'=>$this->decode($struct[$i]['attributes']['LINK']),'name'=>$this->decode($struct[$i]['attributes']['NAME']),'descr'=>$this->decode($struct[$i]['attributes']['DESCR']),'level'=>$level_pass,'dirname'=>$dirname,'hcard'=>$this->decode($struct[$i]['attributes']['HCARD']),'rel'=>$this->decode($struct[$i]['attributes']['REL']));
538,539c538,539
<             $strtemp .= '<li class="menuitem">';
<             $strtemp .= $image_string.$page_icon.'<a class="link" href="'.$link['linkloc'].'" '.$target_string.' title="'.$link['name'].'">'.$link['name'].'</a></li>'."\n";
---
>             $strtemp .= '<li class="menuitem'.(($link['hcard'])?' vcard':'').'">';
>             $strtemp .= $image_string.$page_icon.'<a class="link'.(($link['hcard'])?' url '.$link['hcard']:'').'" '.(($link['rel'])?'rel="'.$link['rel'].'"':'').' href="'.$link['linkloc'].'" '.$target_string.' title="'.$link['name'].'">'.$link['name'].'</a></li>'."\n";
Usage is simple, in the linklist options, just extend the entries like this:

Code: Select all

<link name="Garvin Hicking" hcard="fn" rel="friend" link="http://www.supergarv.de/" />
I hope I didn't forget anything ...
- Mattsches

Re: hCard patch and usage

Posted: Mon Jul 17, 2006 2:23 pm
by garvinhicking
Hi!

Applying this patch fails; could you make a unified diff ("-u") and store the patch on http://nopaste.php-q.net ?

Thanks a lot,
garvin

Posted: Mon Jul 17, 2006 2:33 pm
by mattsches
I just pasted the whole file to here, so will have to make the diff yourself, sorry. I don't have an adequate diff command right here on my Win box :(

Posted: Mon Jul 17, 2006 4:34 pm
by garvinhicking
Hi!

Thanks, committed.

Regards,
Garvin

Posted: Mon Sep 04, 2006 11:28 pm
by mattsches
There's now a microformats plugin that partially supports the standards set up by the structured blogging initiative. If you're interested in this, please follow this thread.