Recent Topics

1 Jul 28, 2009 17:52    

My b2evolution Version: 2.x

Hi all,

having some issues implementing this piece and I can't really get my head around what to search for - hopefully someone can lead me in the right direction.

I've got a site that is not fully b2evo, I'm using it to post news articles and videos, for which it's a really great tool. On the home page of the site I have an iframe that pulls a stub, showing the titles and date, and those titles link through to the respective article page at /blogs/etc...... I am trying to add a short lead-in JUST to the stubs page, not to the /blogs/ page. The articles are only a paragraph long, so there is no need to use the 'more' link on the /blogs/ page, but where space is limited on the home page it allows for only a single sentence.

Does this make sense? Please share any suggestions on how to best achieve this.

Thanks very much

2 Jul 28, 2009 20:40

Assuming your stub is only used for the home page.

In your stub declare a trigger var with the name of your choice :

$home_page = true; // I'm really unimaginative when it comes to var/function names

Then, in your index.main.php or posts.main.php ... whichever your skin has ... just look for the same var and then display excerpt instead of post content ;)

global $home_page;
if( !empty( $home_page ) )
{ // do the excerpt bit
  echo $Item->get('excerpt');
}
else
{ // do the normal content bit
 $Item->content();
}

*note* free typed so backup your files first ;)

¥
}

3 Jul 28, 2009 21:10

Hey, thanks a lot - I see where you're going with this but I'm afraid I might have to get some help getting there with you...

So I have myskin/index.main.php (this is showing at blogs/)
and I have mystub/index.main.php (this is showing in the iframe on the home page)

I've added the helpful-if-not-imaginative variable to the mystub/index.main.php . Then I've added the other code to myskin/index.main.php :
[php]<?php
// --------------------------------- START OF POSTS -------------------------------------
// Display message if no post:
display_if_empty();
global $home_page;
if( !empty( $home_page ) )
{ // do the excerpt bit
echo $Item->get('excerpt');
}
else
{ // do the normal content bit
$Item->content();
}
while( $Item = & mainlist_get_item() )
{ // For each blog post, do everything below up to the closing curly brace "}"
?>[/php]

So my question is - where does excerpt originate and where should the code above be put around the posts in the main /blogs /?

I'm sorry to be so dense, but I do appreciate your help.


Form is loading...