- Posts: 30
COMMUNITY FORUM
K2 Auto Categories and Auto Articles
- Omar Ramos
-
Topic Author
- Offline
- Junior Member
Please Log in or Create an account to join the conversation.
- Simon Wells
-
- Offline
- Platinum Member
- Posts: 955
mod_k2_tools.
Select module functionality, Set to Category List Automatic Menu
Categories List (Automatic Menu) Settings, set to Yes
Select root category, set to my primary category, containing several sub, sub/sub cats.
Published to module position below content on home page only.
Saved
Visit home page, refresh, no change.
Hard refresh, no change.
Changed module position to "banner" as I know that this has significant change.
The banner module appears, but no content.
Inspect with Firebug, and no trace of K2_tools.
I then created another mod_k2_tools using the same folder, but this time setting up the Categories List (Menu).
Save and published to the same position, this loads.
These two examples are LIVE at the moment at k2joom.com/
They are only viewable on the home page to registered users only.
I have not tested the content_auto-articles.
K2Joom
Please Log in or Create an account to join the conversation.
- Omar Ramos
-
Topic Author
- Offline
- Junior Member
- Posts: 30
The automatic part does not depend on the root category setting.
The way it works is that it will automatically show a list of categories when you are on a K2 Category page so you want to leave the module enabled on "all" menu items. On a page that doesn't have option=com_k2 then the module will not display.
Here is a live example as well:
faculty.imperial.edu/omar.ramos (is showing the subcategories for the current category "Omar Ramos" and the articles for this category)
faculty.imperial.edu/andres.martinez (is not showing anything because this particular category "Andres Martinez" does not have any subcategories, nor does it have any articles yet)
I've enabled mod_k2_tools on all pages in the above site, but it only gets displayed when it needs to, making it really easy (once instructors start adding their own content) for them to create a simple navigation for their area, without requiring me to create 100+ instances of mod_k2_tools (one for each instructor).
I can send over some screenshots of the configuration if you still aren't able to get things working or even help to get it working on your demo site there.
Please Log in or Create an account to join the conversation.
- Simon Wells
-
- Offline
- Platinum Member
- Posts: 955
OK, I enabled for all menus and now auto cat works, it can be seen via the blog menu from the front page.
Omar Ramos said:Hi K2Joom, The automatic part does not depend on the root category setting.
The way it works is that it will automatically show a list of categories when you are on a K2 Category page so you want to leave the module enabled on "all" menu items. On a page that doesn't have option=com_k2 then the module will not display.
Here is a live example as well:
faculty.imperial.edu/omar.ramos (is showing the subcategories for the current category "Omar Ramos" and the articles for this category)
faculty.imperial.edu/andres.martinez (is not showing anything because this particular category "Andres Martinez" does not have any subcategories, nor does it have any articles yet)
I've enabled mod_k2_tools on all pages in the above site, but it only gets displayed when it needs to, making it really easy (once instructors start adding their own content) for them to create a simple navigation for their area, without requiring me to create 100+ instances of mod_k2_tools (one for each instructor).
I can send over some screenshots of the configuration if you still aren't able to get things working or even help to get it working on your demo site there.
Please Log in or Create an account to join the conversation.
- Omar Ramos
-
Topic Author
- Offline
- Junior Member
- Posts: 30
I'm not sure where to look on the page (after clicking on the blog link), but I'm glad you were able to get things to work!
Please Log in or Create an account to join the conversation.
- Simon Wells
-
- Offline
- Platinum Member
- Posts: 955
OK, time to sleep.
I will get these files added to K2Joom, reviewed etc.
Will test the auto articles shortly.
Omar Ramos said:Glad it works now, the links shouldn't be dead (if you try again in a few minutes it'll probably work...most likely our external DNS servers are hiccuping...dodgy Windows machines :-). I'm not sure where to look on the page (after clicking on the blog link), but I'm glad you were able to get things to work!
Please Log in or Create an account to join the conversation.
- FeSys
-
- Offline
- Elite Member
- Posts: 262
The Idea is new and great for K2..
You start sharing something needed for main sized websites and Huge content Management portals.
I am happy to see your idea working "Omar Ramos".
Just keep the cool-ideas and of course your share.
Thank you.
Please Log in or Create an account to join the conversation.
- Simon Wells
-
- Offline
- Platinum Member
- Posts: 955
I now have a drop down menu appear in my cPanel location, in the top right of the page.
This is called k2CategorySelectBlock
Even after disabling the module, it still appears.
Is this coincidence that cat menu appears after adding the auto cat module?
It does not appear in my Module Manger, so it must be hard coded, the only change being from the auto cat module.
Knowing how to move this would be useful as to be honest, that kind of drop down category list could be useful to other, just not fixed in my cPanel ;)
Please Log in or Create an account to join the conversation.
- Simon Wells
-
- Offline
- Platinum Member
- Posts: 955
There is NO problem - Developer Error!!
Simon hangs his head in shame for getting something wrong hahaha . . .
K2Joom said:One very important thing to note, since I made that demo on K2Joom.
I now have a drop down menu appear in my cPanel location, in the top right of the page.
This is called k2CategorySelectBlock
Even after disabling the module, it still appears.
Is this coincidence that cat menu appears after adding the auto cat module?
It does not appear in my Module Manger, so it must be hard coded, the only change being from the auto cat module.
Knowing how to move this would be useful as to be honest, that kind of drop down category list could be useful to other, just not fixed in my cPanel ;)
Please Log in or Create an account to join the conversation.
- GreenDome
-
- Offline
- Premium Member
- Posts: 93
How have you designed the 'List of Instructors' page? i.e. faculty.imperial.edu/index.php
I'm really interested in the Alpha Jump Links part?
Thanks
GD
Please Log in or Create an account to join the conversation.
- Manny Santos
-
- Offline
- Senior Member
- Posts: 49
A couple things I noticed: If I chose a different template from the default, it stopped working.
Also, I went to see about the patch you mentioned because the module shows up in pages where I have nothing but don't understand how to apply the patch.
Any help would be greatly appreciated. Thanks
Please Log in or Create an account to join the conversation.
- Omar Ramos
-
Topic Author
- Offline
- Junior Member
- Posts: 30
Yeah I put that one together (I'm not particularly happy with the coding of it...it was a little messy but it gets the job done).
The attached zip has a folder named "directory" within it...this would be dropped into your k2 templates directory (after copying from the main com_k2 directory into my template directory the location for me is /templates/ja_kyanite_ii/html/com_k2/templates/directory).
An instructor already requested if it could be organized by last name, but since the category names contain the instructor names, that could be a little tricky, or at least would require some extra processing.
GreenDome said:Hello Omar,
How have you designed the 'List of Instructors' page? i.e. faculty.imperial.edu/index.php
I'm really interested in the Alpha Jump Links part?
Thanks
GD
Please Log in or Create an account to join the conversation.
- Omar Ramos
-
Topic Author
- Offline
- Junior Member
- Posts: 30
For the other fix I mentioned, just go to libaries/joomla/document/html/html.php and go to line 272 (it's the commented line below) and add in the following:
//$words[$i] = ((isset($this->_buffer[$name])) && ($this->_buffer[$name] === false)) ? 0 : count(JModuleHelper::getModules($name));
$words[$i] = 0;
if(!isset($this->_buffer[$name]))
{
$modules = JModuleHelper::getModules($name);
$result = $this->getBuffer('modules', $name);
$words[$i] += !empty($result);
}
Manukat said:Thanks for the module. Now I can remove the 12 modules I created for each category.
A couple things I noticed: If I chose a different template from the default, it stopped working.
Also, I went to see about the patch you mentioned because the module shows up in pages where I have nothing but don't understand how to apply the patch.
Any help would be greatly appreciated. Thanks
Please Log in or Create an account to join the conversation.
- Manny Santos
-
- Offline
- Senior Member
- Posts: 49
Thanks again for this great addition.
Omar Ramos said:I think the template issue is due to my depending on the Default/menu.php folder location...you'll have to edit things to make that work.
For the other fix I mentioned, just go to libaries/joomla/document/html/html.php and go to line 272 (it's the commented line below) and add in the following:
//$words[$i] = ((isset($this->_buffer[$name])) && ($this->_buffer[$name] === false)) ? 0 : count(JModuleHelper::getModules($name));
$words[$i] = 0;
if(!isset($this->_buffer[$name]))
{
$modules = JModuleHelper::getModules($name);
$result = $this->getBuffer('modules', $name);
$words[$i] += !empty($result);
}
Manukat said:Thanks for the module. Now I can remove the 12 modules I created for each category. A couple things I noticed: If I chose a different template from the default, it stopped working.
Also, I went to see about the patch you mentioned because the module shows up in pages where I have nothing but don't understand how to apply the patch.
Any help would be greatly appreciated. Thanks
Please Log in or Create an account to join the conversation.
- GreenDome
-
- Offline
- Premium Member
- Posts: 93
Thank you for the directory file. Will test it later.
I seem to be getting the following error with this:
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /var/www/joomla/testsite/libraries/joomla/document/html/html.php on line 127
Any ideas?
Thank you
GD
Please Log in or Create an account to join the conversation.
- Omar Ramos
-
Topic Author
- Offline
- Junior Member
- Posts: 30
GreenDome said:Hi Omar,
Thank you for the directory file. Will test it later.
I seem to be getting the following error with this:
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /var/www/joomla/testsite/libraries/joomla/document/html/html.php on line 127
Any ideas?
Thank you
GD
Please Log in or Create an account to join the conversation.
- Omar Ramos
-
Topic Author
- Offline
- Junior Member
- Posts: 30
It seems like instructors didn't exactly think that having themselves organized by first name would be that useful so this version takes a category title (in this case, the name of an instructor like, "Omar Ramos") and reorganizes it by last name = "Ramos, Omar" and the organizes them that way. So I can still name my categories normally "Omar Ramos", but in the directory list it will be organized by the last name.
GreenDome said:Hi Omar,
Thank you for the directory file. Will test it later.
I seem to be getting the following error with this:
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /var/www/joomla/testsite/libraries/joomla/document/html/html.php on line 127
Any ideas?
Thank you
GD
Please Log in or Create an account to join the conversation.
- GreenDome
-
- Offline
- Premium Member
- Posts: 93
Many Thanks for all your hard work.
GD
Please Log in or Create an account to join the conversation.
- Markus Thiel
-
- Offline
- Premium Member
- Posts: 149
I do have a question about a wanted feature ;)
Would it be possible to sort the articles according to the hierarchy? So that perhaps it shows only items from sub categories and they are sorted by hierarchy and date?
A nice little checkbox for "Sort by hierarchy" would really make my day(s)! :)
Please Log in or Create an account to join the conversation.
- Markus Thiel
-
- Offline
- Premium Member
- Posts: 149
Please Log in or Create an account to join the conversation.