PDA


View Full Version : Display entries from all subcats in browsecat?


tfw2005
09-11-2007, 12:25 AM
Is it possible to do the following:

Main -> Category -> Sub-Cat 1
Main -> Category -> Sub-Cat 2

Entries in Sub Cat 1 and Sub Cat 2
No Entries in Category

When looking at Category, it displays the entries of both Sub Cat 1 and Sub Cat 2 under the sub-cat tables?

This is how it's done for "News" related systems, rather than forcing folks to click to 3 or 4 or more sub cats without seeing any entries, and going back up to start over.

Usage example:

Electronics -> MP3 Players
Electronics -> DVD Players
Electronics -> DVD Players -> HD-DVD Players
Electronics -> DVD Players -> Blue Ray DVD Players
Electronics -> DVD Players -> Standard DVD Players

When looking at Electronics, you could see everything, MP3, DVD, HD-DVD, Blue Ray, Standard.

When Looking at DVD Players, You would see HD-DVD Blue Ray and Standard.

Or, you can go right to only Blue Ray.

But, you have the option of looking at nice formatted expanded entry bit listings for "Electronics" or "DVD Players" if you were interested in everything they had to offer, not just one subcat.

Right now, the default VB method forces people to click subcats repeatedly until they get to a subcat, browse that, then go back up, start over in another subcat.

Thoughts?

BWJ
09-11-2007, 09:42 AM
Yes, I suggested that a copy of the "Browse category module" should be possible (http://www.vbadvanced.com/forum/showthread.php?t=24145). This way you can customize which categories you would like to output as you which.

'Limit to Specific Category if Applicable' is a simple and very good solution - if this is the only thing you would like - but if you would like some thing really versatile - then a copy function (like some of the other modules) should (also) be possible.... Then you could do a thing like:

Category A - subcategory 1, subcategory 2
Category B - subcategory 3, subcategory 4
Category C - subcategory 5, subcategory 6
Category D - subcategory 7, subcategory 8

E.g.: You could in Category D - subcategory 7 - choose to show new entries from CatA,1 and CatB,1,2 and Cat7

I don't have any idea how many could exploit a feature like this - but if you really are in a need of it - then it would be super....

tfw2005
09-11-2007, 10:59 AM
Yeah, but I do not want it in module format, I want it as the main content, with pagination, SEO links, and then modules on the top/sides/bottom. So you could see...

Electronics -> DVD Players -> HD-DVD Players - First, Page 1, Page 2, Page 10, Last, etc.

Unless I am missing something with the modules, I don't believe they can do that.

Brian
09-11-2007, 12:52 PM
There is the 'View All Entries (Including Sub-Categories)' link under the 'Category Tools' menu when browsing a category. Looks like it would be farily easy to sort of turn that on by default as well. If you'd be interested in that, you would need to add a new plugin to the 'vba_dyna_browsecategory_start' location with the following code:
if (!isset($_REQUEST['showall']))
{
$_REQUEST['showall'] = 1;
}

Then you would need to look in your browsecategory.php file for this code:
if (!$eventdate AND !$vbulletin->GPC['showall'] AND (!$entryuserid OR ($entryuserid AND $catid)))


And replace with this:
if (!$eventdate AND (!$entryuserid OR ($entryuserid AND $catid)))

tfw2005
09-12-2007, 07:04 AM
Thanks Brian.

I didn't even know that function existed. That is exactly what I was looking for.

One thing, it does what I wanted/you said it would, only if I DONT change the code in the browsecategory.php file. If I just use the plug in, it works.

I reverted back to normal, reset the cat to sub-cat view, turned back on, still only works with just plug-in. Also did it in a fresh IE browser (I use FF).

Its working, so Im cool, just wondering why the browsecategory.php file edit jacked things up.

Brian
09-12-2007, 11:58 AM
The browsecategory.php code should prevent any sub-categories from being displayed if the 'showall' variable is set. The change I posted should prevent that from happening and still allow the sub-categories to be displayed at the top. I guess as long as it's working the way you would like though there's no need to worry about it. :)