Rethinking the display of several Category Groups in CP Publish and Edit forms
Posted: 20 July 2007 12:56 PM   [ Ignore ]  
Grad Student
Avatar
Rank
Total Posts:  98
Joined  07-06-2006

Does anyone know if there is an extension, hack or otherwise for the following?

1: Show categories as drop-down selects rather than multi-selects in the Control Panel’s Publish and Edit forms?

2: Alternatively, can it be hacked to limit the size of the one big multiselect box to a few rows so it scrolls.

3: Is there a way of labeling each category group with the group’s name/label? In the big multiselect, each list isn’t even labeled with the group name, so the client doesn’t find it at all easy to find a group and then select a category.

Ideally, I need to separate categories into clearly labeled groups (shown side-by-side or one above the other) and then either shrink the multiselect boxes to a few rows or convert to drop-down selects (only ever need to select one thing from a cat group on this job).

As it is now, all groups are combined into one mega-multiselect, with grouped categories separated by a dotted line, like so:

Item A
Item B
etc (millions more cats)
Item Z
- - - - - - -
Item 1
Item 2
etc (millions more cats)
Item 327

And so on. Not good from a usability perspective.

Any tips welcome on this one.

 Signature 

Erskine Design: http://www.erskinedesign.com
“Grad student”? - we’ve been here since the start!

Profile
 
 
Posted: 20 July 2007 02:00 PM   [ Ignore ]   [ # 1 ]  
Grad Student
Avatar
Rank
Total Posts:  98
Joined  07-06-2006

OK, in cp.display.php

/** -------------------------------------------
/**  Input - pulldown - header
/** -------------------------------------------*/

function input_select_header($name, $multi = '', $size=3, $width='', $extra='')
{
  
if ($multi != '')
   
$multi = " size='".$size."' multiple='multiple'";

Removing “.size.” (which makes the multiselect have as many rows as you have categories) and replacing it with a numeric value results in a multiselect set to a certain number of rows (I have used ‘20’).

But, I would still really like to split into a separate multiselect for each category group, and label each group with the group name.

 Signature 

Erskine Design: http://www.erskinedesign.com
“Grad student”? - we’ve been here since the start!

Profile
 
 
Posted: 20 July 2007 02:19 PM   [ Ignore ]   [ # 2 ]  
Grad Student
Avatar
Rank
Total Posts:  98
Joined  07-06-2006

Getting there. To split groups into different multiselect forms…

In cp.publish.php, replace…

// Build our output...
  
  
$sel = '';

  foreach(
$cat_array as $key => $val)
  
{
   
if (0 == $val['0'])
   
{
if (isset($last_group) && $last_group != $val['2'])
{
  $this
->categories[] = $DSP->input_select_option('', '-------');
}

With…

// Build our output...
  
  
$sel = '';

  foreach(
$cat_array as $key => $val)
  
{
   
if (0 == $val['0'])
   
{
if (isset($last_group) && $last_group != $val['2'])
{
   $this
->categories[] = $DSP->input_select_footer();
   
$this->categories[] = $DSP->input_select_header('category[]', 1, $size);
}

So, this exchanges the dashed group divider <option> with a select footer and a new select header.

Anyone know if this will screw anything up further down the line??

Now, all I need is to name the Category Groups above the multiselects!

Image Attachments
rethinking_category_groups.png
Click thumbnail to see full-size image
 Signature 

Erskine Design: http://www.erskinedesign.com
“Grad student”? - we’ve been here since the start!

Profile
 
 
Posted: 21 July 2007 08:04 PM   [ Ignore ]   [ # 3 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  712
Joined  07-02-2007

dude that is fantasic….SUPER WORK i hope the EE folks with build that into EE (the seperate group part)
many thanks my friend i owe you one.. lol i would even pay for that little tweak.

Again: many thanks !!

edit: seriously, pm a staff to add that into the code

 Signature 

Truly ExpressionEngine


Fielder Module ( Mass Custom Fields )
Super Cache (Cache heavy tag output)
reCAPTCHA Extension
Rewrite Module


See all my EE Addons (8)

Profile
 
 
Posted: 21 July 2007 08:19 PM   [ Ignore ]   [ # 4 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  712
Joined  07-02-2007

Oe almost forgot,
you might want to add that the modification has to be done in: cp.publish.php

i was looking all over in cp.display.php

 Signature 

Truly ExpressionEngine


Fielder Module ( Mass Custom Fields )
Super Cache (Cache heavy tag output)
reCAPTCHA Extension
Rewrite Module


See all my EE Addons (8)

Profile
 
 
Posted: 14 August 2007 07:51 PM   [ Ignore ]   [ # 5 ]  
Grad Student
Avatar
Rank
Total Posts:  77
Joined  05-10-2006

This is pure sweetness.  Thank you Erskine.  I wonder if there’d be a way to handle this through an extension instead of a direct hack though.  Regardless, I’m using it as is and very thankful for it.

===========
KEYWORDS: (so other forum searchers can find this thread much faster/easier than I did)  smile

categories publish edit tab plugins modules add-ons multiple admin control panel form several select
===========

Profile
 
 
Posted: 29 August 2007 09:52 AM   [ Ignore ]   [ # 6 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  712
Joined  07-02-2007

This is just gorgeous, heh

Totally using this with every project

Hope that Ellislab integrate this into EE itself

 Signature 

Truly ExpressionEngine


Fielder Module ( Mass Custom Fields )
Super Cache (Cache heavy tag output)
reCAPTCHA Extension
Rewrite Module


See all my EE Addons (8)

Profile
 
 
Posted: 31 August 2007 05:39 AM   [ Ignore ]   [ # 7 ]  
Research Assistant
RankRankRank
Total Posts:  592
Joined  10-22-2006

Just what I needed grin

Profile
 
 
Posted: 07 November 2008 04:28 PM   [ Ignore ]   [ # 8 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1709
Joined  03-26-2006

Has anyone, or CAN anyone, convert this to an extension? What happens when there are say, 5 category groups? Can this work with Cocoaholic’s “Category Checkboxes” extension?

 Signature 

ryan masuga
—————
Masuga Design | Member, EE Pro Network
My EE Add-Ons | {devot:ee}
Twitter: masuga | masugadesign | devot_ee

Profile
 
 
Posted: 19 November 2008 12:36 PM   [ Ignore ]   [ # 9 ]  
Grad Student
Avatar
Rank
Total Posts:  40
Joined  08-25-2008

I’ve found that Erskine’s modification can dramatically improve Publish/Edit page performance when there is a large amount of categories. I had wanted to use ~1000 categories for a particular weblog (don’t ask, please. I’m not happy about it downer , and found that my browser was likely to lock up with that many categories.

For me, anyway, this modification stops my browser from freezing, and makes the page a lot more manageable.

 Signature 

lukemcreynolds.com

Profile
 
 
Posted: 19 November 2008 06:00 PM   [ Ignore ]   [ # 10 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1709
Joined  03-26-2006

Just a note that if you’re using (or trying to use) the Required Category extension, it won’t work when the categories are broken up in this way. Also doesn’t work with Category Checkboxes from Cocoaholic, obviously.

I tweaked this by changing “$size” to a definite number - in my case, “20”.

 Signature 

ryan masuga
—————
Masuga Design | Member, EE Pro Network
My EE Add-Ons | {devot:ee}
Twitter: masuga | masugadesign | devot_ee

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64545 Total Logged-in Users: 22
Total Topics: 81137 Total Anonymous Users: 7
Total Replies: 436514 Total Guests: 149
Total Posts: 517651    
Members ( View Memberlist )