Recent Topics

1 Jan 06, 2011 00:56    

My b2evolution Version: 4

Ok, I'm pretty sure this question has been asked and probably answered many times but I'm going to ask again.

I'm wondering if there is a way to display content on the "home" page of a blog that doesn't show up under any of the category listings. In other words, I want to have a blog that has some sort of welcome message as it's home page but NOT have to have a "welcome" category listed in the category list widget. Is there a way to do this?

***ADDITIONAL INFO***

Here's the page I'm working with as an example (although this holds true with any skin)> http://wccoa.org/index.php/Home/. The problem is that I want that "Welcome" post to not have to have a category. As it is, it's in the News section just because I haven't put it anywhere else yet. As a workaround I can do this: http://wccoa.org/index.php/DDProgram/ (notice the "DD Program >" is it's own category where I can put a welcome message, but that's kind of cheesy.

3 Jan 07, 2011 00:22

I was hoping for a way to do this within the admin side of b2 so clients could edit the page just like any other post or page, I'm assuming there's no way to do this? If not, this is definitely something that should be incorporated into a future version of b2.

4 Jan 07, 2011 01:56

This is easy.
You need to edit the skin and add the following code to the end of featured post block

// Go Grab the featured post:
if( $Item = & get_featured_Item() )
{	// We have a featured/intro post to display:
	// ---------------------- ITEM BLOCK INCLUDED HERE ------------------------
	....
	// ----------------------------END ITEM BLOCK  ----------------------------
	

	// The code below hides other posts and navigation pages from home page
	if( $Item->ptyp_ID == 1500 ) $GLOBALS['MainList'] = NULL;
}

Then create an "Intro-Main" post, and it will be displayed on the home page. You may need to edit _item_block.inc.php and hide title, date, categories and other info that is not needed for home page post.

5 Jan 07, 2011 02:08

So to be clear - this will automatically apply to ALL blogs on the site - it can't be some but not all, right?

Also - why does an Intro post create this box around it? http://wccoa.org/index.php/Home/

6 Jan 07, 2011 02:27

It's a skin-wide feature. You'll see a single Intro-Main post only on the skin you edited. If there's no Intro-Main post created normal home page is displayed.

The gray box is added by CSS, you can style it the way you like.

.bPost_ptyp1500 { background: #333 }

7 Jan 07, 2011 03:16

I'm trying to find this code in the CSS but I'm not seeing it. I see

.bPosts {
	float: left;
	width: 480px;
	overflow: hidden;

}

and

.bPosts_left {
	float: right;
}

and

.bPost, .bPostpublished
{
	clear: both;
	margin-bottom: 15px;
	padding: 0;
}

but those are the only references to .bPost that I see...

8 Jan 07, 2011 04:57

That was just an example of how you can style home page post ;)

9 Jan 08, 2011 02:45

I hate to be dense here but I'm having trouble locating where in the CSS for Chita I can style the Intro-Main posts... ideas?

10 Jan 08, 2011 03:17

Just add the code I posted anywhere in styles.css , preferably at the end of the file.

11 Jan 08, 2011 20:23

I'm still a bit confused. There must be CSS already telling it to format this differently right? Basically what I'm looking to do is remove any unique formatting being applied to the Intro-Main posts. I used that line of code you suggested but can't seem to get the border to go away for example, or the indentation removed. For example

.bPost_ptyp1500 { border: 0px }

doesn't seem to remove that border. But what I'm confused about is what is generating that border in the first place...

12 Jan 08, 2011 21:05

To make featured posts look like regular posts, remove the following from featured post block (where you added a line of code before)

'item_class'   => 'featured_post',

13 Jan 08, 2011 21:25

Make that 2 kegs of beer! You are amazing!

15 Jan 13, 2011 22:53

You have to add featured block to the skin, otherwise it won't work

16 Jan 13, 2011 23:07

Ok, that's what I was thinking. Is there a generic way to do this? When I pull this from another skin:

<?php	// featured post:
						if( $Item = & get_featured_Item() )
						{	// We have a featured/intro post to display:
						// ---------------------- ITEM BLOCK INCLUDED HERE ------------------------
						skin_include( '_item_block.inc.php', array(
						'feature_block' => true,
						'content_mode' => 'auto',		// 'auto' will auto select depending on $disp-detail
						'intro_mode'   => 'normal',	// Intro posts will be displayed in normal mode
						
						'image_size'	 =>	'fit-400x320',
						) );	 
						
						if( $Item->ptyp_ID == 1500 ) $GLOBALS['MainList'] = NULL; 
						} ?>

It calls for the item_block.inc.php which I don't have and which appears to be customized for the skin I pulled the above code from.

17 Feb 19, 2011 21:26

How is this handled when there is no ITEM BLOCK section in any of the files in the Frugal skin to put in this featured post section?


Form is loading...