We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Extension: Show Categories on Edit Page

Development and Programming

Nathan Pitman's avatar
Nathan Pitman
531 posts
16 years ago
Nathan Pitman's avatar Nathan Pitman

Hi all, so I got fed up with waiting for someone else to do it and wrote a little extension to add a column to the edit page which shows the category assignment of entries. Obviously entries can often have numerous categories so there’s a setting to configure a display limit and when this is in use additional categories will be displayed when hovering over the primary category for that entry (via the abbr tag).

This is my first extension that interacts with the edit page so I’m not sure whether it’s possible to control the placement of the extra column or not, it’s current location at the end of the row is not ideal… if anyone knows of a way to adjust that or whether it’s possible to add more than one column to the edit table at a time, let me know! 😊

http://ninefour.co.uk/labs/show-categories/

Finally, I should mention that I used the md_weegee extension as a starting point in developing this so some kudos there to Ryan for his extension that provided me with the building blocks for this.

       
Sue Crocker's avatar
Sue Crocker
26,054 posts
16 years ago
Sue Crocker's avatar Sue Crocker

Excellent! I’m sure others will find this helpful. Thanks for sharing.

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen

Hi Nathan,

Neat little extension that one, well done. Just wondering though would it be possible to get the categories showing in a drop-down menu possibly? That way the limit could be a lot higher. Saying that though I do like what you did with the abbr tag, very neat 😊 Thanks for sharing too.

Best wishes,

Mark

       
Nathan Pitman's avatar
Nathan Pitman
531 posts
16 years ago
Nathan Pitman's avatar Nathan Pitman

Hi Sue & Mark. Thanks for the feedback. I just spotted a couple of issues with the extension, specifically that it conflicted with Ryan’s extension since it was using the same method name in response to the hook. I’ll nudge Ryan and see if he can change his method to something more unique as at present it matches the name of the hook.

I’ll re-post here once I’ve pushed the update live… I’ve also just knocked out a ‘Show entry views’ extension… much the same but it shows the number of views each entry has had in an additional column…

😊

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen
I’ll re-post here once I’ve pushed the update live… I’ve also just knocked out a ‘Show entry views’ extension… much the same but it shows the number of views each entry has had in an additional column… 😊

Yep just noticed that one 😉 looking forward to it.

Any thoughts on the drop-down idea?

Best wishes,

Mark

       
Nathan Pitman's avatar
Nathan Pitman
531 posts
16 years ago
Nathan Pitman's avatar Nathan Pitman

I’ll be honest, I’m not convinced by the drop down select idea as it wouldn’t perform a function, or did I misunderstand? 😊

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen
I’ll be honest, I’m not convinced by the drop down select idea as it wouldn’t perform a function, or did I misunderstand? 😊

Sort of and sort of not 😉

The reason I thought it might be a good idea is then you could show more categories at once. If a post has any more than about 5 categories then the column would start to get quite unusable so I just thought that by using a drop-down it would enable you to easily see all the categories assigned to that entry at once or at least a lot more in one go.

Admitted I don’t think this is the best option either as a drop-down to me seems more like it should have an action as opposed to just showing something but maybe you could put it in as an extension setting option?

The other thing I was thinking is some fancy shmancy javascript which builds on your abbr tag idea and instead when you hover over the categories and get the list shown the way it is now you could fade in a div which has all the categories shown there instead. It’s just that any entries that have lots and lots of categories may look odd in the way it is working now although I must admit I haven’t tested it out on a site where I do have lots of categories yet as I’m not at my main computer to be able to do that so it might turn out that it looks fine in which case I will shut-up! 😊

Just a few thoughts though.

Best wishes,

Mark

       
smartpill's avatar
smartpill
456 posts
16 years ago
smartpill's avatar smartpill

Very nice, thank you. FYI, seems to conflict with the Restrict Entries To Member Groups extension also, which adds a column to the Edit list to show if the entry is restricted.

       
Nathan Pitman's avatar
Nathan Pitman
531 posts
16 years ago
Nathan Pitman's avatar Nathan Pitman

Thanks for the heads up @smartpill, I think this may be the same issue that caused a conflict with Ryan’s extension. I’ve updated Github with a new version that should resolve this.

http://github.com/nathanpitman/np.show_categories.ee_addon/zipball/master

I’ll download the Restrict Entries extension and check though.

       
Versa Studio's avatar
Versa Studio
572 posts
16 years ago
Versa Studio's avatar Versa Studio

Though I am mostly PHP-illiterate, I was able to make each category appear with a <br /> after it. I could not figure out how to prepend a &middot; character though.

       
Nathan Pitman's avatar
Nathan Pitman
531 posts
16 years ago
Nathan Pitman's avatar Nathan Pitman

Hi expdesign, glad to hear you found a use for this extension. I’d be interested to see how the edit screen looks with <br’s> between categories, does it not end up makign the rows much taller??? 😊

       
Versa Studio's avatar
Versa Studio
572 posts
16 years ago
Versa Studio's avatar Versa Studio

Yes, the rows are a bit taller, but it’s ok. The benefit of seeing the categories outweighs the bloat.

I thought of a few options you could build in to your extension:

  • Abbreviate categories
  • Control over the table header, i.e., for one client I prefer it says “Departments”
  • Option to prepend a character like a &middot;
       
Nathan Pitman's avatar
Nathan Pitman
531 posts
about 16 years ago
Nathan Pitman's avatar Nathan Pitman

Some excellent ideas there. Thanks for these… will see what I can do for you. 😊

       
Laisvunas's avatar
Laisvunas
879 posts
15 years ago
Laisvunas's avatar Laisvunas

Hi Nathan,

After upgrading to ExpressionEngine’s 1.6.8 build 20100121 I noticed that Show Categories extension does not work anymore. Instead a list of PHP errors is being shown on the top of Edit page. Those are such error messages as

Notice: Undefined index: entry_id in /home/classics/public_html/eesys/extensions/ext.np_show_categories.php on line 166 Notice: Undefined index: entry_id in /home/classics/public_html/eesys/extensions/ext.np_show_categories.php on line 166 Notice: Undefined index: entry_id in /home/classics/public_html/eesys/extensions/ext.np_show_categories.php on line 166 Notice: Undefined index: entry_id in /home/classics/public_html/eesys/extensions/ext.np_show_categories.php on line 166 Notice: Undefined index: entry_id in /home/classics/public_html/eesys/extensions/ext.np_show_categories.php on line 166 Notice: Undefined index: entry_id in /home/classics/public_html/eesys/extensions/ext.np_show_categories.php on line 166 Notice: Undefined index: entry_id in /home/classics/public_html/eesys/extensions/ext.np_show_categories.php on line 166 Notice: Undefined index: entry_id in /home/classics/public_html/eesys/extensions/ext.np_show_categories.php on line 166 Notice: Undefined index: entry_id in /home/classics/public_html/eesys/extensions/ext.np_show_categories.php on line 166 Notice: Undefined index: entry_id in /home/classics/public_html/eesys/extensions/ext.np_show_categories.php on line 166 Notice: Undefined index: entry_id in /home/classics/public_html/eesys/extensions/ext.np_show_categories.php on line 166 Notice: Undefined index: entry_id in /home/classics/public_html/eesys/extensions/ext.np_show_categories.php on line 166 Notice: Undefined index: entry_id in /home/classics/public_html/eesys/extensions/ext.np_show_categories.php on line 166

This is amazing extension; it would be nice if it were possible to use it with current and future builds.

       
Nathan Pitman's avatar
Nathan Pitman
531 posts
15 years ago
Nathan Pitman's avatar Nathan Pitman

ooh, how odd. I’ll take a look at this as I tend to use this extension quite a lot myself I’m going to run into the same problem at some point…. thanks for the heads up. I’ll post back here once I have a solution.

       
1 2

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.