develop a plugin for tumble blogging

1 view
Skip to first unread message

slogmen

unread,
Aug 29, 2009, 11:16:15 AM8/29/09
to habari-users
Hi all,

I'm currently trying to develop an plugin for basic tumble blogging
functionality. At this point the Plugin creates 2 new custom-content-
types:

- Links (with URL & Description)
- Quotes (Quote & Source)

I have some questions at this point. I'm thinking there are 2 possible
solutions to implement the content-types. I can create & store the
data in custom fields($post->info->url) or I use custom fields with
formUI and try to save the data well formated into the content field.
I'd prefer to use the first one because it feels a little bit cleaner,
what do you think about it?

Some more questions:
1) Is it right that i can't change the label for the content-
element? ($form->content->label = 'foo';)
2) How do I remove the silos from posting page with formUI?
3) I've implemented my own function to use content-type-specific
templates for the loop-output, is it right that there is no integrated
solution in habari?
4) Most important: How do I integrate my custom content type well in
the Atom-Feed?

So, I think that's all.
Thanks a lot!

Regards,
Thomas

mikelietz

unread,
Sep 1, 2009, 3:01:20 PM9/1/09
to habari-users
This is the easiest question, but, to remove the silos, in
action_form_publish:

$form->remove($form->silos);

Not sure about the others. Why do you want to change the label for the
content-element?

There is $form->content_type->value which can be tested against
Post::type( 'whatever' )

Take a look at this (older rev) of the unfinished plugin_directory
plugin, especially around action_form_publish in 239 and
action_publish_post in 347 for using info fields.

http://trac.habariproject.org/habari-extras/browser/plugins/plugin_directory/trunk/plugin_directory.plugin.php?rev=1683

Hope some of that helps!
mikelietz
Message has been deleted

Thomas Schrader

unread,
Sep 13, 2009, 11:10:11 AM9/13/09
to habari...@googlegroups.com
thanks @mikelietz, you helped me a lot!

The current Problem I'm trying to solve is to integrate my custom
posts into the mainfeed. I didn't found helpful informations in the
wiki and the api documentation. Can somebody help me?

Regards
Thomas

rick c

unread,
Sep 13, 2009, 10:28:26 PM9/13/09
to habari-users
You need to hook Plugins::filter('atom_get_collection_content_type',
$params['content_type']), which is called by the atom handler just
before getting the posts to show in the feed. You can use it to add
your custom content type to the content types shown in the feed.

Here's the code from the podcast plugin to add the podcast content
type to the atom feed:

public function filter_atom_get_collection_content_type
( $content_type )
{
$content_type = Utils::single_array( $content_type ); // if
$content_type is a string, convert it to an array
$content_type[] = Post::type( 'podcast' ); // add the custom content
type to the array of content types
return $content_type; // return the array to the atom handler
}

I hope this helps.

Rick

On Sep 13, 10:10 am, slogmen <slog...@gmail.com> wrote:
> thanks @mikelietz, yes you helped me a little bit!
>
> My main problem is to Integrate the custom posts well in the atom
> feed. I didn't found anything in wiki and api. Can somebody help me?
>
> Regards,
> Thomas
>
> On Sep 1, 9:01 pm, mikelietz <cod...@gmail.com> wrote:
>
> > This is the easiest question, but, to remove the silos, in
> > action_form_publish:
>
> > $form->remove($form->silos);
>
> > Not sure about the others. Why do you want to change the label for the
> > content-element?
>
> > There is $form->content_type->value which can be tested against
> > Post::type( 'whatever' )
>
> > Take a look at this (older rev) of the unfinished plugin_directory
> > plugin, especially around action_form_publish in 239 and
> > action_publish_post in 347 for using info fields.
>
> >http://trac.habariproject.org/habari-extras/browser/plugins/plugin_di...

slogmen

unread,
Sep 14, 2009, 3:11:11 PM9/14/09
to habari-users
Rick, thank you very much this helped me a lot! Feed integration works
now very well.

I will release a test version of this plugin in the near future. I
think i have to do some fine-tuning in the next time.

ts

unread,
Oct 5, 2009, 4:05:51 PM10/5/09
to habari-users
I'm interested in the progress of this plugin, are you still working
on it?

On Sep 14, 3:11 pm, slogmen <slog...@gmail.com> wrote:
> Rick, thank you very much this helped me a lot! Feed integration works
> now very well.
>
> I will release a test version of this plugin in the near future. I
> think i have to do some fine-tuning in the next time.
>
> On Sep 14, 4:28 am, rick c <rickcock...@gmail.com> wrote:
>
>
>
> > You need to hook Plugins::filter('atom_get_collection_content_type',
> > $params['content_type']), which is called by the atom handler just
> > before getting the posts to show in the feed. You can use it to add
> > your custom content type to the content types shown in the feed.
>
> > Here's the code from the podcast plugin to add the podcast content
> > type to the atom feed:
>
> >         public function filter_atom_get_collection_content_type
> > ( $content_type )
> >         {
> >                 $content_type = Utils::single_array( $content_type ); // if
> > $content_type is a string, convert it to an array
> >                 $content_type[] =Post::type( 'podcast' ); // add the custom content

slogmen

unread,
Oct 10, 2009, 9:06:11 AM10/10/09
to habari-users
Oh yeah, I'm still working on it. I will send you an test-version of
the plugin in the next days if you're interested.
Reply all
Reply to author
Forward
0 new messages