Forums / Addon Sideboxes / Display Categories In Separate Boxes

Display Categories In Separate Boxes

Views: 41,074

Results 21 to 40 of 63
29 Mar 2010, 4:15 AM
#21
chireficken avatar

chireficken

New Zenner

Join Date:
Mar 2010
Posts:
2
Plugin Contributions:
0

Display Categories In Separate Boxes

The addon works great - however, what Im wanting to do is have each category show in a separate box (which it does), but instead of showing just the subcategories (which I dont have any of), show the products themselves in that list.

How would I modify the code to do this?
Thanks all.

30 Mar 2010, 6:06 AM
#22
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Display Categories In Separate Boxes

That would require modifying the SQL query first, and then adding variables to handle the new information. It is not a job for a novice.
The Expanded Category Listing mod displays products as well as categories, but it displays all of them all the time. You might be able to use it for reference to modify another mod.

Categories Dressing can show all of your categories and subcats in separate boxes, though it won't do products.

30 Mar 2010, 4:05 PM
#23
chireficken avatar

chireficken

New Zenner

Join Date:
Mar 2010
Posts:
2
Plugin Contributions:
0

Re: Display Categories In Separate Boxes

gjh42:

That would require modifying the SQL query first, and then adding variables to handle the new information. It is not a job for a novice.
The Expanded Category Listing mod displays products as well as categories, but it displays all of them all the time. You might be able to use it for reference to modify another mod.

Categories Dressing can show all of your categories and subcats in separate boxes, though it won't do products.

Ok thanks GJH. I figured it wouldnt be simple :) I guess I could use the expanded categories mod, then make the main category header have a background image that would make it look like they were two separate boxes but with no space in between?

1 Aug 2010, 1:56 PM
#24
fontaholic avatar

fontaholic

Zen Follower

Join Date:
Jun 2008
Posts:
111
Plugin Contributions:
0

Re: Display Categories In Separate Boxes

i've installed the separate sidebox files and adjusted the master category id and all is working as expected.:clap:

however, i'm wondering if i can do more with it. i see in the readme that you can make different versions of the same sidebox. is there a way to display a separate sidebox i define only if the user is browsing a particular section of the site? is there a way to pin a sidebox to a subcategory?

for example, i have 3 main categories that allow people to view my products, by department, by tradition and by intention. within those, i have complex sub-category trees that are long and messy when you get deep into them.

so what i'd like to do is display only the separate sidebox with the current category that the user is browsing or even the current sub category.

i'd also like to tell it to only display the separate sidebox when the user is not on the main page.

thanks!

:) emily
http://store.inspiritcommon.com/
ZC 1.3.8a on Godaddy :: EP 1.2.5.4 :: Adv Search 1.1 and a buncha other stuff

1 Aug 2010, 2:39 PM
#25
fontaholic avatar

fontaholic

Zen Follower

Join Date:
Jun 2008
Posts:
111
Plugin Contributions:
0

Re: Display Categories In Separate Boxes

i have just also installed Category Select (dropdown) Sidebox v1.4 and think it would be great if this dropdown could contain my 3 primary "shop by" categories and then Separate Category Sidebox v1.1 can display the current directory a user has chosen once they have left the main page.

i'm gonna tinker and see what i can do but i know diddle about how to write conditional php, if you have info or want to see what i'm up to, you can log in to the site in my .sig using un: alphatester pw: Gr8gratitude.

thanks! i'm learning!:smile:

:) emily
http://store.inspiritcommon.com/
ZC 1.3.8a on Godaddy :: EP 1.2.5.4 :: Adv Search 1.1 and a buncha other stuff

4 Aug 2010, 9:23 PM
#26
mary4c avatar

mary4c

New Zenner

Join Date:
Aug 2010
Posts:
21
Plugin Contributions:
0

Re: Display Categories In Separate Boxes

I uploaded the Separate Category Sidebox v1.1 and it works, but I know have the states category in the top and in a separate box. What did I do wrong? https://www.southerngenealogybooks.com

23 Sep 2010, 2:56 AM
#27
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Display Categories In Separate Boxes

Emily - I was away at Pennsic when you posted here. It looks like you have achieved some results; do you want to get anything different from the way it works now? I guess you figured out the conditionals to hide all of the product type categories in the regular sidebox, and display all of them in the separate sidebox. I do note that the categories in the separate sidebox will not open to show their subs in the menu, but must rely on the top/center display.

If you use Categories Dressing, you can display the Department/Intention/Tradition categories and the product line categories in separate boxes, but all of them will open to their subs in the sidebox menu. You can put whatever organizational headings you want in any location.
Let me know if you need help with anything.

11 Oct 2010, 4:57 PM
#28
boselixer avatar

boselixer

New Zenner

Join Date:
Sep 2010
Posts:
20
Plugin Contributions:
0

Re: Display Categories In Separate Boxes

I think this is the right module for what I'd like to do, can someone help me confirm a few things?

*Adding Several Separate Category Sideboxes

If you wish to add more than one category in separate sideboxes, simply open the 3 files included in this mod find and replace separate_category in all of the 3 files by maintaining their proper case. Also change the 3 files name to match your category name.* (quoted from module read me.)

I interpret this to mean the following:
rename the "category" txt of the file names to match that of the categories, as well as within the files.

For multiple boxes of multiple categories: make a separate set of these three files for each one.

However, when I do this I get this error:

"1146 Table 'leg1026807505238.categories' doesn't exist
in:
[select c.categories_id, cd.categories_name, c.parent_id, c.categories_image from categories c, categories_description cd where c.categories_id = cd.categories_id and c.categories_status = 1 and c.parent_id = 1 order by sort_order, cd.categories_name]"

Any thoughts?

Thanks in advance

12 Oct 2010, 4:51 PM
#29
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Display Categories In Separate Boxes

It is the exact text "separate_category" that you need to change for the additional boxes, keeping upper/lowercase the same in each location. The simplest way would be to just use separate_category2 (adding a "2") for each instance. The category names are irrelevant to this adjustment, though they are relevant to having the sidebox ids and possibly headings match the content.

I haven't used the mod so can't say for sure, but it looks like it may be hard-coded to look for a table named categories, which would fail if your database had prefixes (the table would then be named yourprefix_categories).

24 Oct 2010, 7:31 AM
#30
kidsstuff avatar

kidsstuff

New Zenner

Join Date:
Oct 2010
Posts:
44
Plugin Contributions:
0

Re: Display Categories In Separate Boxes

fontaholic:

i've installed the separate sidebox files and adjusted the master category id and all is working as expected.:clap:

however, i'm wondering if i can do more with it. i see in the readme that you can make different versions of the same sidebox. is there a way to display a separate sidebox i define only if the user is browsing a particular section of the site? is there a way to pin a sidebox to a subcategory?

for example, i have 3 main categories that allow people to view my products, by department, by tradition and by intention. within those, i have complex sub-category trees that are long and messy when you get deep into them.

so what i'd like to do is display only the separate sidebox with the current category that the user is browsing or even the current sub category.

i'd also like to tell it to only display the separate sidebox when the user is not on the main page.

thanks!

Does anyone know how this can be achieved?
Display all subcategories from a master category on all product info pages/ subcategory pages of that selected master category and not show them on all other pages?...Hope this makes sense.

It doesn't have to be for this contribution in particular, I just need to set the condition, like:

if ($this_is_home_page) {
$show_featured = true;
} else {
$show_featured = false;
}
if ($show_featured == true) {
.....
}

I tried with:
if($current_category_id == 13) {
.....
}

But it only displays on one page: the main category page and not the subcategories or product pages.

Any help appreciated!

27 Oct 2010, 8:33 AM
#31
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Display Categories In Separate Boxes

You can replace
if($current_category_id == 13) {
with
if((int)$_GET['cPath'] == 13) {
which strips any subcat ids off of the current $cPath value.

27 Oct 2010, 8:55 AM
#32
kidsstuff avatar

kidsstuff

New Zenner

Join Date:
Oct 2010
Posts:
44
Plugin Contributions:
0

Re: Display Categories In Separate Boxes

Thanks a lot, works like a charm! :clap:

6 Dec 2010, 10:32 PM
#33
jorger avatar

jorger

New Zenner

Join Date:
Aug 2010
Posts:
53
Plugin Contributions:
0

Re: Display Categories In Separate Boxes

What are the conditionals to hide the category in the regular sidebox? I have now twice the category using Separate Category Sidebox?

Thanks

7 Dec 2010, 12:34 AM
#34
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Display Categories In Separate Boxes

Find this in tpl_categories.php```php
if (zen_get_product_types_to_category($box_categories_array[$i]['path']) == 3 or ($box_categories_array[$i]['top'] != 'true' and SHOW_CATEGORIES_SUBCATEGORIES_ALWAYS != 1)) {
// skip if this is for the document box (==3)
} else {


$box_categories_array[$i]['path']) == 'cPath=##' or 
(substituting your cat id for ##)

to get```php
     if ($box_categories_array[$i]['path']) == 'cPath=##' or zen_get_product_types_to_category($box_categories_array[$i]['path']) == 3 or ($box_categories_array[$i]['top'] != 'true' and SHOW_CATEGORIES_SUBCATEGORIES_ALWAYS != 1)) {
        // skip if this is for the document box (==3)
      } else {

This only covers the main category; you may need a slightly different form of test if subcats are a problem for you.

7 Dec 2010, 7:10 PM
#35
jorger avatar

jorger

New Zenner

Join Date:
Aug 2010
Posts:
53
Plugin Contributions:
0

Re: Display Categories In Separate Boxes

Hi,

Thank you for your reply. I tried your suggestion and It didn´t work. the pages display no content:

 if ($box_categories_array[$i]['path']) == 'cPath=236' or zen_get_product_types_to_category($box_categories_array[$i]['path']) == 3 or ($box_categories_array[$i]['top'] != 'true' and SHOW_CATEGORIES_SUBCATEGORIES_ALWAYS != 1)) {
    // skip if this is for the document box (==3)

Any idea?

Thanks

7 Dec 2010, 7:11 PM
#36
jorger avatar

jorger

New Zenner

Join Date:
Aug 2010
Posts:
53
Plugin Contributions:
0

Re: Display Categories In Separate Boxes

Hi again,

This is my web site:

http://wernerparts.com/

7 Dec 2010, 7:18 PM
#37
jorger avatar

jorger

New Zenner

Join Date:
Aug 2010
Posts:
53
Plugin Contributions:
0

Re: Display Categories In Separate Boxes

Sorry. It works NOW. THANKS!!!!!!!:clap:

7 Dec 2010, 7:50 PM
#38
jorger avatar

jorger

New Zenner

Join Date:
Aug 2010
Posts:
53
Plugin Contributions:
0

Re: Display Categories In Separate Boxes

Hi,

It doesn´t work properly. It opens another category-subcategory when I´m on the product info page:

I´m on Green Bull ladders- Rung Lock Kit, but the page displays the lock for the Fiberglass Ladders and that´s wrong.

http://wernerparts.com/index.php?main_page=product_info&cPath=236_238&products_id=647

Any suggestion?

Thanks

Jorge

7 Dec 2010, 8:08 PM
#39
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Display Categories In Separate Boxes

Yes, it looks like the Separate Category sidebox is giving incorrect cPath links. The rung lock kit is in cPath 236_238, but the SC link points to cPath 238, which is not actually a top category but a subcat. This may also affect the breadcrumbs which do not display correctly on the cPath=238 page.

I don't know the code used in the mod, so can't say what may have gone wrong in your copy of it.

7 Dec 2010, 8:25 PM
#40
jorger avatar

jorger

New Zenner

Join Date:
Aug 2010
Posts:
53
Plugin Contributions:
0

Re: Display Categories In Separate Boxes

Hi,

Thanks again. You wrote this before:

You can replace
if($current_category_id == 13) {
with
if((int)$_GET['cPath'] == 13) {
which strips any subcat ids off of the current $cPath value.

Where do i need to change that?