2 newb questions

1 view
Skip to first unread message

mindlube

unread,
Sep 1, 2010, 4:49:34 PM9/1/10
to habari-users
Howdy all, Habari looks pretty cool and the admin interface is really
nice. I'm happy that my web host seems to meet all the requirements.
Two things not clear after trying the demo and reading docs:

1) I created a Page and disabled comments. The site however still
shows "0 comments" below the page. Is there a way to turn that 0
Comments off for Pages? This doesn't make sense for static content
like a Contact or Support type of page.

2) The Features mentions "media silos" and the like, but I didn't see
how to add any multimedia content like a slide show of .png images. I
want to make a slideshow from my local filesystem content. Does this
require a plugin and if so any recommendations?

Thanks much

Colin

unread,
Sep 5, 2010, 11:16:49 AM9/5/10
to habari...@googlegroups.com
Hi mindlube

My comments are in line.

On Wed, Sep 1, 2010 at 9:49 PM, mindlube <mind...@gmail.com> wrote:
Howdy all, Habari looks pretty cool and the admin interface is really
nice. I'm happy that my web host seems to meet all the requirements.
Two things not clear after trying the demo and reading  docs:

1) I created a Page and disabled comments. The site however still
shows "0 comments" below the page. Is there a way to turn that  0
Comments off for Pages? This doesn't make sense for static content
like a Contact or Support type of page.

This is going to be a "feature" of the theme you've selected.  Different themes do things in different ways.  If you're using the Habari supplied K2 theme, then the simplest way of removing this is to comment out the following line in the page.single.php:

<?php $theme->display ( 'comments' ); ?>

This will of course remove this from ALL pages.  If you want to only disable this for pages with comments disabled, you'll need to delve into the comments.php file.

If you're using another theme, let us know which one and we'll be able to direct you to the lines of code you need to change or remove for that theme.

 
2) The Features mentions "media silos" and the like, but I didn't see
how to add any multimedia content like a slide show of .png images. I
want to make a slideshow from my local filesystem content. Does this
require a plugin and if so any recommendations?

Such a function would indeed need a new plugin, for which I don't believe there is one currently available.  Most of the silo plugins I've seen just provide a means of storing and managing your media rather than manipulating them or doing something funky like this.

If you've got the PHP skills, but all means start creating a plugin and we'll be more than happy to help out on the habari-dev group and even add the plugin to the list available in habari-extras.

If you don't have the skills, then it might be an idea to add a ticket to the wishlist at https://trac.habariproject.org/habari-extras and someone may jump at the opportunity.

HTH
Colin

--
Colin Seymour
Blog: http://colinseymour.co.uk
Tech Stuff: http://lildude.co.uk
Barefoot Running: http://barefootrunner.co.uk
IRC: lildude #habari

François Letendre

unread,
Sep 5, 2010, 5:03:05 PM9/5/10
to habari-users


On 5 sep, 11:16, Colin <lild...@gmail.com> wrote:
> Hi mindlube
>
> My comments are in line.
>
> On Wed, Sep 1, 2010 at 9:49 PM, mindlube <mindl...@gmail.com> wrote:
> > Howdy all, Habari looks pretty cool and the admin interface is really
> > nice. I'm happy that my web host seems to meet all the requirements.
> > Two things not clear after trying the demo and reading  docs:
>
> > 1) I created a Page and disabled comments. The site however still
> > shows "0 comments" below the page. Is there a way to turn that  0
> > Comments off for Pages? This doesn't make sense for static content
> > like a Contact or Support type of page.
>
> This is going to be a "feature" of the theme you've selected.  Different
> themes do things in different ways.  If you're using the Habari supplied K2
> theme, then the simplest way of removing this is to comment out the
> following line in the page.single.php:
>
> <?php $theme->display ( 'comments' ); ?>
>
> This will of course remove this from ALL pages.  If you want to only disable
> this for pages with comments disabled, you'll need to delve into the
> comments.php file.
>
> If you're using another theme, let us know which one and we'll be able to
> direct you to the lines of code you need to change or remove for that theme.
>

Here's an exemple from my own theme.

Note that I'm far from being an expert at coding and there's probably
better ways to handle this...

First I replaced <?php $theme->display ( 'comments' ); ?> by <?php
$theme->comments_link($post); ?>
in home.php, entry.single.php, page.single.php, etc.

Then I added my own comments_link() function in theme.php:

public function comments_link( $post )
{
// Get number of comments for this post
$comment_count = $post->comments->approved->count;

if ( $comment_count > 0 ) {

// If number of comments for this post is greater than zero

echo "<a href=\"{$post->permalink}#comments\">"
. "{$comment_count} " . _n('comment', 'comments',
$comment_count ) . "</a>";


} else if ( !$post->info->comments_disabled ) {

// If zero comments and comments are NOT disabled

echo "<a href=\"{$post->permalink}#comments\">"
. "Add a comment</a>";

} else {

// If zero comments and comments are disabled

echo "Comments disabled";

}
}

François Letendre

unread,
Sep 5, 2010, 6:03:10 PM9/5/10
to habari-users

> First I replaced <?php $theme->display ( 'comments' ); ?> by <?php
> $theme->comments_link($post); ?>
> in home.php, entry.single.php, page.single.php, etc.

Oops... sorry for the confusion here... after verification, I did not
replace <?php $theme->display ( 'comments' ); ?> which actually
displays all the comments themeselves.

I just used <?php $theme->comments_link($post); ?> in my template to
display the comment link and added the proper function in theme.php

Now that should be more clear.
Reply all
Reply to author
Forward
0 new messages