1 ethan5150 Jan 06, 2011 00:56
3 ethan5150 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 sam2kb 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 ethan5150 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 sam2kb 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 ethan5150 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 sam2kb Jan 07, 2011 04:57
That was just an example of how you can style home page post ;)
9 ethan5150 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 sam2kb Jan 08, 2011 03:17
Just add the code I posted anywhere in styles.css , preferably at the end of the file.
11 ethan5150 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 sam2kb 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 ethan5150 Jan 08, 2011 21:25
Make that 2 kegs of beer! You are amazing!
14 ethan5150 Jan 13, 2011 22:37
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/)
15 sam2kb Jan 13, 2011 22:53
You have to add featured block to the skin, otherwise it won't work
16 ethan5150 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 ethan5150 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?
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