2 tilqicom Jan 06, 2011 05: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.
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.
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/
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 }
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...
That was just an example of how you can style home page post ;)
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?
Just add the code I posted anywhere in styles.css , preferably at the end of the file.
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...
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',
Make that 2 kegs of beer! You are amazing!
Ok, how does this work if there is no Featured Post section in the skin I'm working with (ie: SimpleZen - http://fairjustice.net/index.php/Home/)
You have to add featured block to the skin, otherwise it won't work
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.
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?
this may help i guess..
http://forums.b2evolution.net/viewtopic.php?t=14046
you can create a "home" display, and put anything you want in it