Recent Topics

1 Mar 15, 2007 05:37    

My b2evolution Version: 1.9.x

Either in the sidebar or on a special "about" page, I would like to create a list of all blogs complete with each one's long description.

I have seen several posts about creating an about page and found two that I liked. (here's a good one: http://forums.b2evolution.net/viewtopic.php?t=9140 )

But, on my 'about" page or maybe a better name might be my "index" page (or "contents" page) I would like to bullet list all of the blogs (with links) with each one's long description.

Now, I know how to call up the bloglist on a side panel (or anywhere), with this code:

<?php 
require( dirname(__FILE__).'/_bloglist.php' );
 ?>

but that just gives the blog name and link, no long description, and I can't figure out how to make that list appear bulleted or in an item listing.

I have this appearing at the top of my sidebar... giving the Name of the current blog and it's description (but no links):

<h3><?php $Blog->disp( 'name', 'htmlbody' ) ?></h3>
<p><?php $Blog->disp( 'longdesc', 'htmlbody' ); ?></p>

But, that is for just the current blog and without a link. I would be happy to build this by hand (if there is not some code to create such a list), but I couldn't figure out how to make that code respond with blog names, links and descriptions other than for the current one.

So, it seems like I can get the info I want... various ways.. but, not together in the way I need. Is there a simple way I can create my blog list with long descriptions?

2 Mar 15, 2007 09:29

First off make a copy of _bloglist.php ( call it something funky like _bloglistplus.php )

Then find this bit and add the extra line :-

	} // End of testing which blog is being displayed
	$blog_link .= '<br />'.format_to_output( blog_list_iteminfo('longdesc', false), 'htmlbody' );
	$blog_link .= $blog_item_end;

Finally, just include the file in your skine wherever you want it :-

<?php
// include the funky new bloglist
require( dirname(__FILE__).'/../_bloglistplus.php' );
?>

Job done ;)

¥

3 Mar 15, 2007 12:44

Thanks, ¥åßßå. That displays exactly the information I needed. Excellent coding. It will enable me to make a great index page.

I have two further questions.

1. How can I get that to display properly as a list?

The way it shows now, there are breaks between entries, but only after each blog name, so that the next blog name appears on the same line as the description of the previous one. I would like to add a <br> after each blog description, but I can't figure out how to make that happen.

2. How can I make the list bulleted?

Sam

4 Mar 15, 2007 13:07

Ok, I figured out my first question.. I just enclose the long description inside of

<p></p>.  

That does the trick for that.

Now, how to make the list bulleted, that's the challenge.

5 Mar 15, 2007 13:15

If you look slightly further up the file you have the parameters for the bloglist :

# this is what will start and end your blog links
if(!isset($blog_list_start)) $blog_list_start = '<ul>';
if(!isset($blog_list_end)) $blog_list_end = '</ul>';
# This is what will separate items in the list
if(!isset($blog_list_separator)) $blog_list_separator = '';
# this is what will separate your blog links
if(!isset($blog_item_start)) $blog_item_start = '<li>';
if(!isset($blog_item_end)) $blog_item_end = '</li>';

If you add a classname to the ul you can then use css to add in the bullets and margins

¥

6 Mar 15, 2007 13:38

That sounds like a great solution... if I can get it over where I am using css then I'm home free (css I understand).

But, adding a classname to the ul, is beyond my current range of knowledge. I am now (after seeing the power of b2evo) going to study php, but I'm not there yet.

If you could show me how to add that classname to the ul I will be very grateful.

7 Mar 15, 2007 13:39

if(!isset($blog_list_start)) $blog_list_start = '<ul class="a_funky_class">';

;)

¥

8 Mar 15, 2007 13:48

Thanks... that does the trick!! I am marking this one [Solved] in the topic heading.

9 Mar 15, 2007 13:48

Now you can remove the <p> tags and use css to add margins to the <li>'s ;)

¥


Form is loading...