View previous topic :: View next topic |
Author |
Message |
Carol
Joined: 22 Mar 2002 Posts: 5 Location: Sydney
|
Posted: Fri Mar 29, 2002 8:07 am Post subject: Have different categories on different pages. |
|
|
Ok, I'll just start off by telling you that I'm not very familiar with php and have just started using b2.
Is it possible to use b2 for more than the 'blog' section of the site? I'm trying to see if I can have different categories on different pages, so that I can use b2 when I want to update other sections of the site.
I want 2 categories for the 'blog' section and wants to show several entries on one page.
I want a separate category for each of the other sections, and for them to display one entry at a time.
Can I do that? |
|
Back to top |
|
 |
Toxicity555
Joined: 09 Feb 2002 Posts: 50 Location: USA
|
Posted: Fri Mar 29, 2002 1:40 pm Post subject: |
|
|
Definately. On my site I use b2 to manage my entire site. What I have done is syndicated updates into RSS so that they show up on my home page. From there, I have linked to the b2.php file and told it to display only certain categories. When i post a story, I use the <!--more--> function to add a teaser to the top of the story, which automatically links to the entire story. It works great. Hope this helps! |
|
Back to top |
|
 |
Carol
Joined: 22 Mar 2002 Posts: 5 Location: Sydney
|
Posted: Sat Mar 30, 2002 11:09 am Post subject: |
|
|
Yea, I sort of get what you mean. Can I have different layouts for each section?
And how do I do what you just said? I'm sorry but it's like staring into empty space when I look at the codes. |
|
Back to top |
|
 |
michel v Site Admin
Joined: 25 Jan 2002 Posts: 799 Location: Corsica
|
Posted: Sun Mar 31, 2002 2:17 pm Post subject: |
|
|
Yes, you can have different layouts for different sections. Just create different templates: copy index.php or b2.php into a new file, and edit that new file, and you have a different template.  |
|
Back to top |
|
 |
Junior
Joined: 23 Apr 2002 Posts: 6
|
Posted: Tue Apr 23, 2002 9:29 am Post subject: Not a clue how to do this ? |
|
|
Guys I'm real new to this b2 and amd strugglingto pick up Php along the way .. I want to have a number of seperate categories [news/events/reports/etc] but was wondering how to I config b2 so that users post to individual pages ?
Any help would be much appreciated.
Cheers
Junior |
|
Back to top |
|
 |
Junior
Joined: 23 Apr 2002 Posts: 6
|
Posted: Tue Apr 23, 2002 5:42 pm Post subject: |
|
|
Ok I've looked thru the How-To Section on this board and I've tried the suggested solution in a number of other threads.
It doesn't work for me, B2 is running at http://www.cruiseirl.com/news/ I added the $cat=cat number code to the head of http://www.cruiseirl.com/news/events.php but it seems to take in all the postings.
Could some one please point me in the right direction
TIA
Junior |
|
Back to top |
|
 |
Toxicity555
Joined: 09 Feb 2002 Posts: 50 Location: USA
|
Posted: Wed Apr 24, 2002 2:37 am Post subject: |
|
|
Can you post the first few lines of the code? That should help find the problem... |
|
Back to top |
|
 |
Junior
Joined: 23 Apr 2002 Posts: 6
|
Posted: Wed Apr 24, 2002 9:28 am Post subject: |
|
|
Here's the start of the events page
Code: |
<?php cat = 2; ?>
<?php /* Don't remove this line, it calls the b2 function files ! */ $blog=1; include ("blog.header.php"); ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
|
I had it like this below and it didn't do anything either.
Code: |
<?php /* Don't remove this line, it calls the b2 function files ! */ $cat=2; $blog=1; include ("blog.header.php"); ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
|
Back to top |
|
 |
Toxicity555
Joined: 09 Feb 2002 Posts: 50 Location: USA
|
Posted: Wed Apr 24, 2002 4:04 pm Post subject: |
|
|
<?php /* Don't remove this line, it calls the b2 function files ! */ $blog=1; $cat=2; include ("blog.header.php"); ?> Try moving the $cat statement after the blog statement, might help. I just tested it out again and it seems to still be working fine. |
|
Back to top |
|
 |
imeridian
Joined: 12 Feb 2002 Posts: 191
|
Posted: Thu Apr 25, 2002 7:58 am Post subject: |
|
|
<?php $cat = "-7+6"; ?>
is a way to "block" categories 6 and 7.
<?php $cat = "1 2 3"; ?>
will show only categories 1, 2, and 3. |
|
Back to top |
|
 |
Junior
Joined: 23 Apr 2002 Posts: 6
|
Posted: Thu Apr 25, 2002 9:37 am Post subject: |
|
|
Cheers people for all your help I'm indebted to you all for figuring that simple thing out for me !
Cheers again
Junior |
|
Back to top |
|
 |
|DarkNoise|
Joined: 26 Nov 2003 Posts: 1
|
Posted: Wed Nov 26, 2003 7:39 am Post subject: |
|
|
k well we know now we can have various categories on each page, but what about having 2 categories in seperate parts of the page, eg a different category in a different cell of a table...
ive been trying to figure this out for days. say we state that $cat=1 then query the db can we change or clear and restate $cat=2 and re-query the db? |
|
Back to top |
|
 |
|