3. If I wanted to limit the drop down list of available categories to child categories only when creating a discussion within the parent / child category, which theme files should I look to modify?
This would be a good addition to the plugin. Adam will you have time soon to continue to work on this much needed plugin...?
tata said:If I wanted to limit the drop down list of available categories to child categories only when creating a discussion within the parent / child category, which theme files should I look to modify?
Neither this extension nor Vanilla itself is really set up for this. As was stated earlier in this discussion, the SubCategories extension is really just stylistic, not structural. You would need to write a new extension to implement this effect.
Hamed said:this does not really work for me any ideas why?
Uhh... what's wrong? Did you install the theme files into the proper folder(s)? Did you add "(dash)(space)" to the front of your sub category name?
It works perfect for me in v1.1.3 (except for the small bug Vaz mentions).
Hamed: Yes, there should be a "sub-categories.php" included with the add-on that needs to be uploaded to the appropriate theme folder(s). Certain options also require you to modify your categories.php file, check the readme.
Can this be used to do "sections" in the style of the more generic forum systems (vB, phpBB, PunBB, etc.)? That is, I basically want to have a few parent categories, which are just for visual organization -- you have to post in one of the subcategories. (It needs only be two levels deep. The top-level abstract sections, and the categories they contain.) And on the main Categories page, each should show its immediate subcategories.
Is that possible?
Well, I'm sure it is, but has anyone done it? :)
Structurally, that's real easy if you combine it with Category Roles. Just set the parent category to read-only. Visually/style-wise, getting the sub-categories to show up on the main category page will require some modification of categories.php and/or sub-categories.php.
thanks timfire - do I need another add-on to make a category read only - as far as I know I can only make a category visible/invisible to certain roles and don't the ability to alter to read/write access so further info would be a great help, thanks.
For anyone that is still having problems with SubCategories not showing up because there are special characters in a Category name, the solution is simple:
I don't think this extension is working for me but I want to make sure it does what I think it does before I start troubleshooting.
What I have done... I have made the following categories: CO2 Incubators - Troubleshooting - - The Temperature is Too High - - The Temperature is Too Low Bactron User Group
There are discussions in the Bactron User Group but that does not matter since I don't need subcategories there.
In the CO2 Incubator category only the sub sub categories ("The Temperature is Too High" and "The Temperature is Too Low") have discussions in them.
I have started a discussion in "The Temperature is Too High" titled "Possible Cause is the Controller"
My Issues: In Vanilla, when I click on Categories I only see CO2 Incubators and Bactron User Group. If I click on CO2 Incubators I do not see the sub category. It says "No discussions found". Should I see the subcategory here?
The discussion I started shows up on the front page of "Discussions". When I click on it I see the post. The breadcrumb shows the cat and the sub sub cat but is missing the sub category. It is "CO2 Incubators > The Temperature is Too High » Possible Cause is the Controller". Why is the subcategory "Troubleshooting" missing?
Something is not right, correct?
Any ideas what could be wrong. I have not made any mods to the system. I have added the following themes and extensions.
Theme Blogger
Extensions AjaxQuote Applicant Email Verification Html Formatter Notify Nuggets Preview Post SubCategories
Thanks Peterbp. That worked and I saw that was even in the readme. So shame on me for not reading .
I wanted to mention this.
As I added Categories and SubCategories they were in the correct order (just by chance). I still could not get this extension to work. I then reordered the categories (took them out of order) and then put them back in the correct order. Then everything started working. It seems (for me) that the reordering of the categories step is necessary even if they happen to be in the correct order upon creation. Might have just been my setup but I thought it might help someone else.
Installed it and worked great.
One feature request: In the categories view, could each parent topic have a listing of the sub-categories in it? A forum listing might look like:
# Support Questions
# Category description Technical help about the XO laptop. Synced with the community-support@lists.laptop.org mailing list.
# Discussions: 280 | Sub-forums: Software, Hardware, Networking
If you give me some insight into *how* to implement that (any similar code samples I could use as a reference?) I would even be willing to try. From there are other neat things we could do form their (have discussion # for each sub-forum being listed, etc), but that is just my daydreaming.
Subcategories has been working fine for me, but for some reason, recently the order of categories and subcategories has changed.
Start a new discussion -> select the category for this discussion.
From the drop down box, the categories are not in the same order as they have been placed.
I have clicked on settings and categories and they are in the original order there.
I have also tried to change the order from there, but they still show in the wrong order.
Can anybody help, please ?
Thanks in advance
Comments
'
It works perfect for me in v1.1.3 (except for the small bug Vaz mentions).
I wanted to, instead of just showing a count of Sub Categories under the parent category, actually list out all the subcategories with links.
My solution is below, although it should probably be generalized a bit more. Maybe it could be added to a future version of the extension?
------------------------------------------------------------------
In default.php under Subcategories I added this function (right under the line that reads "// Theme functions"...around 199)
function SubCatList ($CategoryID, $list_prefix="<div>", $list_suffix="</div>\n", $sub_cat_item_prefix="", $sub_cat_item_suffix="", $sub_cat_item_separator=", ") { global $Context; $CategoryManager = $Context->ObjectFactory->NewContextObject($Context, 'CategoryManager'); $Data = $CategoryManager->GetCategories(1); $Category = $Context->ObjectFactory->NewObject($Context, 'Category'); $BeginSubForums = 0; $SubForums = 0; $CurrentName = ''; $return_list = ''; $Count = 0; $Level = false; while ($Row = $Context->Database->GetRow($Data)) { $Category->Clear(); $Category->GetPropertiesFromDataSet($Row); $Category->FormatPropertiesForDisplay(); if ($Category->CategoryID == $CategoryID) { $BeginSubForums = 1; $CurrentName = $Category->Name; $Level = CategoryLevel($CurrentName); $return_list = $list_prefix; } if($BeginSubForums == 1) { if($Category->Name != $CurrentName) { if(CategoryLevel($Category->Name) <= $Level) { $return_list .= $list_suffix; break; } if ($Count > 0) $return_list .= $sub_cat_item_separator; $return_list .= $sub_cat_item_prefix . '<a href="' . GetUrl($Context->Configuration, 'index.php', '', 'CategoryID', $Category->CategoryID) . '">'. SubNameTidy($Category->Name) .'</a>' . $sub_cat_item_suffix; $Count++; } } } return $return_list; }
Then in theme/subcategories.php were it's calling SubCount($Category->CategoryID, 'categories'), instead call SubCatList ($CategoryID)
That'll more or less do it.
@conradslater: It's a separate add-on.
Add the following: Note that this uses the fix I provided in the comments above, so be sure to check those out too.
What I have done...
I have made the following categories:
CO2 Incubators
- Troubleshooting
- - The Temperature is Too High
- - The Temperature is Too Low
Bactron User Group
There are discussions in the Bactron User Group but that does not matter since I don't need subcategories there.
In the CO2 Incubator category only the sub sub categories ("The Temperature is Too High" and "The Temperature is Too Low") have discussions in them.
I have started a discussion in "The Temperature is Too High" titled "Possible Cause is the Controller"
My Issues:
In Vanilla, when I click on Categories I only see CO2 Incubators and Bactron User Group. If I click on CO2 Incubators I do not see the sub category. It says "No discussions found". Should I see the subcategory here?
The discussion I started shows up on the front page of "Discussions". When I click on it I see the post. The breadcrumb shows the cat and the sub sub cat but is missing the sub category. It is "CO2 Incubators > The Temperature is Too High » Possible Cause is the Controller". Why is the subcategory "Troubleshooting" missing?
Something is not right, correct?
Any ideas what could be wrong. I have not made any mods to the system. I have added the following themes and extensions.
Theme
Blogger
Extensions
AjaxQuote
Applicant Email Verification
Html Formatter
Notify
Nuggets
Preview Post
SubCategories
Everything is up to date.
Thanks for any help
Jed
I wanted to mention this.
As I added Categories and SubCategories they were in the correct order (just by chance). I still could not get this extension to work. I then reordered the categories (took them out of order) and then put them back in the correct order. Then everything started working. It seems (for me) that the reordering of the categories step is necessary even if they happen to be in the correct order upon creation. Might have just been my setup but I thought it might help someone else.
Jed
http://lussumo.com/community/?CommentID=79553