Recent Topics

1 Dec 31, 2004 05:10    

Ok guys, you know I've become fairly accomplished since I started with b2evo in August...but now I'm developing a totally new blog for my partner and I need it to display A, B, and Linkblog all in one template. I know there's a demo of multiblogs.php, but I just don't get it. I've never understood how to make stubs work (multiblogs.php is a stub, right?).

If you check out the current version...

http://www.jasonschneiderman.net/blogs/

...you can see the column on the left where I want Blog B to display, mostly for photos from events.

Blog A, in the middle, will be for listing events (for jason's readings, classes he's teaching, etc).

The Linkblog, on the right, is to list his books, other publications, CV, contact info, etc.

Can you guys walk me through this real slow?

Thanks!

Michael

2 Dec 31, 2004 12:30

Firstly, multiblogs.php is a template, not a stub. Basically a template combines the information from a stub file and a skin into one file.

More info on templates: http://b2evolution.net/man/2004/06/17/templates

and on skins: http://b2evolution.net/man/2004/06/16/evo_skins

and on stub files: http://b2evolution.net/man/2004/06/04/stub_files

You can include multiblogs in skins as well as templates, so if you're used to using skins, there's no real need to go back to templates if you don't want to.

The important bits to look at when using multiblogs are:

	<?php
		// Dirty trick until we get everything into objects:
		$saved_blog = $blog;
		$blog = 3;	// Blog B now
		$Blog_B = Blog_get_by_ID( 3 );	// Blog B
	?>

Change the two numbers to reflect the blog you want to display.

	<?php
		// You can restrict to specific categories by listing them in the two params below: '', array()
		// '', array(9,15) will restrict to cats 9 and 15
		// '9,15', array() will restrict to cats 9,15 and all their subcats
		$BlogBList = & new ItemList( $blog,	 $show_statuses, '', $m, $w, '', array(), $author, $order, $orderby, $posts, '', '', '', '', '', '', '', '3', 'posts', $timestamp_min, $timestamp_max );

		while( $Item = $BlogBList->get_item() )
		{
		?>

Change the 3 to be however many posts you want to be displayed. This line is also where you can set more advanced options, as what to order the posts by etc (http://doc.b2evolution.net/0.9.0/evocore/ItemList.html#methodItemList - link to the technical documentation).

Next you will see the usual tags to display the information in your post.

And finally, there's this bit which tells b2evolution to go back to the default blog (probably blog A in your case)

		<?php
		}

		// Restore after dirty trick:
		$blog = $saved_blog;
	?>

3 Dec 31, 2004 23:59

Thanks, Graham, that worked.

But I included the linkblog the skins way rather than the templates way, because I don't understand how to set the parameters. Is there a place where we can see what the default parameters are and an explanation of how you change them? The only thing I can think of right now that I really want to do is be able to order the categories in the linkblog alphabetically. The default seems to be that they appear in the order they were created, which does not seem to be the case for categories in the main blog. Right?

Thanks again (and Happy New Year!).

Michael

4 Jan 01, 2005 12:54

I can't tell you off the top of my head (it's new year's day, I'm sure you can guess what condition a 19 year old is in...), but a peek at the technical documentation will probably help - look in the evocore section - that's where all the magic happens.

http://doc.b2evolution.net/0.9.0/


Form is loading...