1
stevemul
News Module - Categories and Subcategories
  • 2004/7/9 5:20

  • stevemul

  • Just popping in

  • Posts: 1

  • Since: 2004/7/9 5


Subcategories are not shown when I select a parent category.

For example, if I have a Category of Animals with two sub-categories of Dogs and Cats, when I put a news item into the category of Dogs it displays when I select Dogs but NOT when I select animals.

Surely a parent category should display ALL sub-categories ?

Regards,

Steve, Hobart, Tasmania.


2
sottwell
Re: News Module - Categories and Subcategories
  • 2004/7/9 6:52

  • sottwell

  • Just popping in

  • Posts: 30

  • Since: 2004/6/23


No, not necessarily. Consider a graphical representation of a file system, such as the typical folder icon. The individual files are only shown when you open the folder the files actually reside in. Opening a parent folder shows any child folders and any files residing in the parent folder, not the files residing in the child folder.

Imagine if at the root directory of your OS of choice you saw a listing of all the files on the disk at once! It's certainly possible to do this if it's what you need, but it's hardly what you would want to have when you're just looking for one of your mp3 files to play.

Likewise, if I want to read an article about dogs, I'm really not interesting in having to pick through a long list of articles about other unrelated topics. A plain category list is much better for me. That's why you have categories and subcategories to begin with.

3
MadFish
Re: News Module - Categories and Subcategories
  • 2004/7/9 7:13

  • MadFish

  • Friend of XOOPS

  • Posts: 1056

  • Since: 2003/9/27


Steve

At the moment sub-categories are handled the same as parent categories - there is no functional difference between them (except that sub-categories are listed beneath their parent in the drop-down box).

I agree, would be nice for parent categories to cover their childeren categories too...I think I read something about future plans to change this, but it was a while ago.

4
Mithrandir
Re: News Module - Categories and Subcategories

News Module Feature Request tracker

Personally, I do feel as the first replier, though - subcategory topics should not show in parent category listing. Also, it will put some strain on the database with permission checking and article retrieval, raising the SQL query count somewhat.

5
mike67
Re: News Module - Categories and Subcategories
  • 2009/10/30 7:47

  • mike67

  • Just popping in

  • Posts: 15

  • Since: 2004/4/3 9


Hello
+1

This function will be nice.
but I have no idea how to do that myself.
ghia give me an advise on french support forum, but i can't code php.
If someone can help me, and the other people who made the same request ?

Thanks

michael

6
ghia
Re: News Module - Categories and Subcategories
  • 2009/10/30 9:41

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


What I said was:
Quote:
in principle, it would not be that difficult.
In index.php there is this line
$sarray NewsStory::getAllPublished($xoopsOption['storynum'], $start$xoopsModuleConfig['restrictindex'], $xoopsOption['storytopic'], 0true'published'$topic_frontpage);

where all the articles are listed for the selected category ($xoopsOption['storytopic']). Now we have to add the subcategories and pass this parameter as an array. A list of all accesible categories exist in $allTopics, which is defined a dozen lines before with the category navigator.
A simple query to the database, that searches all categories, which have the requested category as parent and are in the list of accessible categories is all that is needed.

(Except for a preference in xoops_version.php for switching on this new trick)

Login

Who's Online

289 user(s) are online (220 user(s) are browsing Support Forums)


Members: 0


Guests: 289


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits