Recent Topics

is it possible to have a default category that shows up

Started by on May 18, 2004 – Contents updated: May 18, 2004

May 18, 2004 05:12    

is it possible to have a default category that shows up like default.. IE index.php would have a default category of 15 but if you click on a link it would show other categories if you have like index.php?cat=16

May 18, 2004 14:21

you must create a stub file for your blog to do that.

inside the stub file, before $blog= , add the following lines:


param( 'cat', 'integer', 15 );

15 is the default for param 'cat' that can be overriden by the URL.

$cat will always be forced to integer.

May 18, 2004 18:31

I pasted the code above the $ blog and im getting a parse error

May 18, 2004 22:01

I forgot a ; after the last )

I'm editing the code above.

Jul 13, 2005 05:39

Hi... im using B2evo as a Content Management System for a news portal in Spanish... it´s an excellent software by the way.

Anyway i made sort of a merge between the skin file and the summary / multiblogs templates. My "top news" (main category) are in the main part and the "other news" (several other categories) in the sidebar. The sidebar was generated using a piece of the multiblogs code.

I made the stub file that restricts the category and made that default category show up in the main part of the blog, and the other ones in the sidebar. But when i click on "read more..." in the sidebar it outputs "sorry, there is no post to show" (im translating from Spanish, it probably would say something different in the English version)

The thing is: you can override the stub file if you put a cat=n parameter, but you can´t override it if you are clicking a permalink.

Can anyone help me here? pls!!!

Jul 13, 2005 22:18

Thanks... i designed it myself... I just embedded pieces of b2evo php code inside a predesigned html layout.

BTW i kinda managed to get the effect i wanted to by passing a ?cat=n parameter through the URL in several parts (in the link that goes to that section, for example, and the "return to main page" link)...

alkhater Nov 01, 2005 18:06

alkhater Visitor

Here is an easy way to start with a specific category. Insert the following code in index.php

if ( empty($cat) )
{ // No category requested
$cat = 3; // this will start with cat. 3
:D [/code]

Nov 01, 2005 18:21

param( 'cat', 'integer', 3 );

Does the same thing as

if ( empty($cat) )
{ // No category requested
$cat = 3; // this will start with cat. 3



Feb 20, 2006 19:44

Has the "sorry, there is no post to show" thing been solved? We have the same problem..

Form is loading...

open source blog – This forum is powered by b2evolution CMS, a complete engine for your website.