Include subcategories Checked by default?

More
13 years 9 months ago #9266 by ThatComputerDude
Any time I sort categories in the "Items" section, I always want to include subcategories but I always have to check the box anytime I make a choice in the drop down.


How can I (which file do I need to edit) make that "Include subcategories" box checked by default so I don't have to keep checking it?

I greatly appreciate any feedback!

Please Log in or Create an account to join the conversation.

More
13 years 9 months ago #9294 by kenmcd
.
Looks like a bug.

I found the code here:
\administrator\components\com_flexicontent\views\items\tmpl\default.php

Line 321:
<span class="radio"><label for="filter_subcats"><input type="checkbox" name="filter_subcats" value="1" id="filter_subcats" class="inputbox"<?php echo $checked; ?> /><?php echo ' '.JText::_( 'FLEXI_INCLUDE_SUBS' ); ?></label></span>

The value="1" means this should be Yes by default.
But obviously that is not happening.

Please add this to the Bug Tracker.
code.google.com/p/flexicontent/issues/list


If we can get the setting to work, I can add a configuration parameter to set the default.
(that is within my skill set)
:D


Moderator note: moved to Bugs forum
.

Please Log in or Create an account to join the conversation.

More
13 years 9 months ago #9300 by ThatComputerDude
Cool - I'm sorry I didn't catch it as a bug.

Thank you for looking into it and figuring it out for me! I'll add it right now. If anyone can fix it, that would be outstanding. Not a big deal, just adds extra steps and would be way more convenient if it worked properly.

Please Log in or Create an account to join the conversation.

More
13 years 9 months ago #9301 by kenmcd
.
Thanks for adding this issue to the tracker:
code.google.com/p/flexicontent/issues/detail?id=72

After thinking about this a bit, I can see the need to un-check this by default.
The performance hit could be an issue with a lot of nested categories.


I looked a little closer and found a switch.
\administrator\components\com_flexicontent\models\items.php
Line 368:
$filter_subcats = JRequest::getInt('filter_subcats', 0, 'post');

Change that "0" to a "1" and the category filter in the Items listing page defaults to Yes.
Like this:
$filter_subcats = JRequest::getInt('filter_subcats', 1, 'post');


It does not show anything in the checkbox, but the results do show the sub-categories.
But beware, it always shows the sub-categories.
There is no checkbox switch now.

I have no idea what else this may affect.
That variable ($filter_subcats) is used in another file:
\administrator\components\com_flexicontent\views\items\view.html.php
On lines 57 and 295.


Give that a try and see if anything else breaks.
:D

.

Please Log in or Create an account to join the conversation.

More
13 years 9 months ago #9308 by ThatComputerDude
I will try that and THANK YOU for poking around to find a fix.

I know enough PHP to understand what it's doing, for the most part. I guess enough to be dangerous LOL. I'm learning though.

To me, I'd like it to be set like this, providing it doesn't break anything. Sure it would be nice at times not to see subcategories but for how I structure categories, the top category is used for "static" articles/items and the categories nested is used as category menu items.

So what you came up with should work perfect for me - so again, I thank you very much.

I'm going to go make the switch and do some testing over the next few days, this is for a school district website, so it'll be a decent size website to test this out on.


Thanks again, much appreciated!

Please Log in or Create an account to join the conversation.

More
13 years 9 months ago #9309 by ThatComputerDude
I think I'm going to remove that check box all together so it's not confusing for users, since there's really no way to check or uncheck it after this change you suggested.

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.537 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline