Re: [habari-dev] Post image and summaries on index page

50 views
Skip to first unread message

Bryce Campbell

unread,
Apr 12, 2013, 10:37:02 PM4/12/13
to habar...@googlegroups.com

Why not look at your theme and edit that. Changing it to show excerpts would do pretty well. However, only one image will show.

On Apr 12, 2013 7:34 PM, <mratc...@mozilla.com> wrote:
My migration to Habari is going well but I am stuck when it comes to the index page.

This is what I want it to look like:
http://www.flailingmonkey.com/

But it looks like this:
http://beta.flailingmonkey.com/

So I guess I need an image field and a summary field for each post and from there it should be simple. I don't see how this can be done using the plugin mechanism but that may be because I have not used php for a long, long time. Does anybody have any pointers or know of any partial implementations, I really don't want to reinvent the wheel here.

--
--
To post to this group, send email to habar...@googlegroups.com
To unsubscribe from this group, send email to habari-dev-...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/habari-dev
---
You received this message because you are subscribed to the Google Groups "habari-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to habari-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Michael Bishop

unread,
Apr 12, 2013, 11:40:54 PM4/12/13
to habar...@googlegroups.com
First you might want to look at using the [Photology plugin](https://github.com/habari-extras/photology). I've not used it specifically, but looking at the help info, it should provide you with what you need to duplicate your WP theme, i.e., get a thumbnail of 1st image (might need to float it left in your custom markup) and then get the excerpt of the post. 

-- 
Michael Bishop
Sent with Sparrow

mratc...@mozilla.com

unread,
Apr 13, 2013, 9:30:57 AM4/13/13
to habar...@googlegroups.com
I am not sure if I understand correctly, let me rephrase my question:

Is it possible to add fields to the post form that I can then access from the theme. Of course, I could do this in /system/ but would prefer to do it in /user/.

Morgante Pell

unread,
Apr 13, 2013, 9:32:41 AM4/13/13
to habar...@googlegroups.com
Yes, it is definitely possible to modify the publish form with a plugin.


Best,
Morgante

Bryce Campbell

unread,
Apr 13, 2013, 12:11:57 PM4/13/13
to habar...@googlegroups.com

You don't really need any fields, except for the image. From what I see, it displays the first one or two paragraphs of each article and an image, which is the usually the first one. That style can be accomplished via CSS. As for the excerpt portion, I do have an example of that on github in my theme RDarkness. If you want fields though, have you tried the metaseo plugin? I have not tried that out myself though.

Chris J. Davis

unread,
Apr 13, 2013, 1:12:29 PM4/13/13
to habar...@googlegroups.com
I would just use the post fields plugin, and add a new info field for the image you want to show up on the homepage. Then on the homepage, just call something like:

<img src="$post->info->hero">

Or whatever you call the info record when you create it.

mratc...@mozilla.com

unread,
Apr 13, 2013, 4:08:14 PM4/13/13
to habar...@googlegroups.com
I knew something must already exist, thanks.

mratc...@mozilla.com

unread,
Apr 13, 2013, 4:17:16 PM4/13/13
to habar...@googlegroups.com
Doesn't work with 0.9.1, maybe the SEO plugin would work though.

Christopher Davis

unread,
Apr 13, 2013, 4:34:38 PM4/13/13
to habar...@googlegroups.com, habar...@googlegroups.com
Did you try it, or go by the addons dir? It should work with 0.9.1.  

Sent from my iPhone

mratc...@mozilla.com

unread,
Apr 13, 2013, 5:49:05 PM4/13/13
to habar...@googlegroups.com
I cloned it from:
https://github.com/habari-extras/postfields

But it shows the following in admin/plugins:
The plugin file /home/blah/public_html/flailingmonkey.com/beta/user/plugins/postfields/postfields.plugin.php had syntax errors and could not load.

Parse error: syntax error, unexpected 'Habari' (T_STRING), expecting \\ (T_NS_SEPARATOR) in /home/blah/public_html/flailingmonkey.com/beta/system/classes/utils.php(752) : eval()'d code on line 2
Reply all
Reply to author
Forward
0 new messages