Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-08-31 20:43:11

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,437
Website GitHub

smd_browse_by: browse articles, images, files and links by category

Merely a rebadged lam_browse_by, this plugin adds a dropdown select list above the Search box on the article, image, file and links panels so you can rapidly select content by category. On the Articles panel you also have a Section dropdown list.

There is a (hidden) option to permit you to add a Go button next to the select list if you prefer. Other than that it does what it says on the tin.

Suitable for Txp 4.6.0 and higher only. Download the plugin.

Revision history
————————

All available versions and changes are listed here. Each entry indexes the relevant post(s) in the thread to learn about the features.

  • 2021-06-16 | 0.1.2 | For Txp 4.6+ ; PHP 8 compatibility (thanks, GugUser).
  • 2012-03-04 | 0.1.1 | Added hidden pref to control which dropdowns to use ; Category tree now displayed (thanks, pieman) ; `pluggable_ui()` implemented so other plugins can alter the lists (thanks, tye) ; More consistent layout (thanks, philwareham) ; Sections ordered by title.
  • 2011-08-31 | 0.1.0 | Initial release.

Last edited by Bloke (2021-06-16 14:37:38)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#2 2011-08-31 22:02:00

joebaich
Member
From: DC Metro Area and elsewhere
Registered: 2006-09-24
Posts: 507
Website

Re: smd_browse_by: browse articles, images, files and links by category

Lovely Stef, another excellent and uber useful plug-in.

I personally found the plug-in tjh_listfilter to be more useful than Steve’s lam_browse_by when I was working with a selection of articles by category or section. It was ‘persistent’ in that I could establish a filtered list on the Content / Articles page, select an article from that list, amend it, save the amended page and then click the Articles tab to be taken back to the same filtered list of articles. For me that was a real time saver because I often would have to apply a similar type of amendment to the other articles in the list and didn’t have to re-establish the filter each time. (Sadly, TJH moved on and his plug-in stopped working with subsequent versions of Textpattern.) With lam_browse_by and now your smd_browse_by I am taken back to the complete unfiltered list of articles in the same situation.

This is a little inconsistent too, because when one selects an image, file or a link from a smd_browse_by filtered list, amends it and saves it, one remains presented with the same filtered list. I think that is a good thing and wonder if you could make the article filtered list behave in the same way, maybe as an option? The tjh_listfilter plugin had a flaw though; using the ‘Select All’ option on a filtered list selected all the articles, not just the ones presented by the filtered list, that wasn’t a good thing as I found out the hard way when I thought I had changed ownership of a particular category of articles to a new author and found I had given her ownership of all the articles.

Offline

#3 2011-08-31 22:37:50

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,437
Website GitHub

Re: smd_browse_by: browse articles, images, files and links by category

joebaich wrote:

when one selects an image, file or a link from a smd_browse_by filtered list, amends it and saves it, one remains presented with the same filtered list.

Thanks for bringing this up. That’s a by-product of the fact those panels work differently to the Articles tab. The main reason I can see for the perceived inconsistency is because the Write tab is entirely separate from the Article List tab. With the others, editing an item is just another ‘step’ on the same tab so it’s easy to maintain the current state as you flick between edit and list modes. Jumping back and forth between two distinct tabs and trying to keep the list filtered in a logical manner is probably tricky.

For example, consider this workflow:

  1. Filter the Article list by Category
  2. Choose one to edit and Save it — you remain on the Write tab (in the other Content tabs you are returned to the list view in some form)
  3. Click Next and edit that article
  4. Click Next again to edit a 3rd article

What should happen when you subsequently click the Articles tab?

  1. The original filter remains in place
  2. The full list presented

What if you hadn’t edited the other two articles and had gone straight back to the Article list after editing the chosen article? Would you expect a different outcome? Notice that to get back to the full unfiltered list in any of the other three tabs you just click the tab heading. In that regard, the Article list tab is behaving entirely consistently and it’s the fact the edit/list steps are physically separated on different tabs that is the problem.

If it makes sense — and is possible — to alter the core to behave the same way as the other tabs then I’d prefer to do that. If not — and I suspect this will be the case — I can certainly look into a way of making the filter in this plugin ‘sticky’ (for want of a better word) : it’s a reasonable request. I may have to use a cookie to do it, which might pose other problems such as how do I allow you to show all articles if the list will always be filtered by the last known setting when you click the Articles tab heading?

Perhaps I should take a look at tjh_listfilter and see if I can steal kindly borrow some ideas from there to roll into this plugin. Is the workflow of that plugin good enough, or could it be improved if such functionality was migrated to smd_browse_by?


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#4 2011-08-31 23:11:00

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,437
Website GitHub

Re: smd_browse_by: browse articles, images, files and links by category

Actually, having just skimmed the tjh_listfilter plugin I can see a potential merger, though quite how I’d pull it off in terms of workflow should be up to all you clever designy folk, not coding trolls like me. I’d just screw the interface up.

tjh_listfilter uses cookies to always remember your last filtered state, it seems. That means that clicking the tab heading will reinstate the filter and will not restore the unfiltered list. So the first thing to decide is if this is an improvement and, if so, how to implement some incredibly simple/obvious way to return a tab to its unfiltered state. Thoughts on this welcome. (btw, nowadays I’d probably use a hidden per-user pref to retain state, instead of a cookie, but the effect is the same)

Looking across the content types, it appears that all of the tabs could benefit from being filterable by Category and Author (I did consider Author in an early version of the plugin but couldn’t make the interface work neatly enough for my liking). In addition, the Articles should be filterable by Section and Status. Adding a single ‘selector’ dropdown and then a secondary ‘thingy’ dropdown based on which selector was chosen — exactly like tjh_listfilter — seems logical, but it could get confusing to have all those dropdowns floating about.

I wonder if I could somehow hijack the existing Search box dropdown and, if the chosen method matches Category, Author, Section or Status, to insert a dropdown of the relevant items alongside — perhaps between the selector and the search box.

Pros:

  • The ability to use the dropdown to filter using currently available items, without typing.
  • Typing of search terms is still available should you wish to alter or augment the search — after all, the plugin just fakes you typing a search term into the box.
  • The dropdown could auto-submit by default. Alternatively, the hidden pref could perhaps be used to hijack the existing search Go button to submit the form. If you had entered any search text then that’s used, but if that box was empty the dropdown content could be used instead as search criteria. Not sure if that’d work, but it’s an interesting notion.

Cons:

  • An extra mouse click to first select the thing to filter by and then to select the actual filter item. Given that the idea behind the plugin is fast filtering this might be counter to that goal.
  • The selector interface element would jump around horizontally as the item dropdown was added or removed from the interface on the fly.

I’m sure there are better / other ways to approach it from an interface design perspective so if anyone has any thoughts or mockups please present them for consideration.

Incidentally, the ‘all article’ selection thing may stem from the fact tjh_listfilter filters using javascript. Might be wrong there because I’ve not looked at the code in detail yet.

Last edited by Bloke (2011-08-31 23:15:53)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#5 2011-09-12 10:20:40

pieman
Member
From: Bristol, UK
Registered: 2005-09-22
Posts: 491
Website

Re: smd_browse_by: browse articles, images, files and links by category

Hi Stef

I have one hastily thought through request: that smd_browse_by should display content from child categories by default (or with a pref). Preferably also to display the category hierarchy in the select list.

Offline

#6 2011-09-12 10:33:51

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,437
Website GitHub

Re: smd_browse_by: browse articles, images, files and links by category

pieman wrote:

display content from child categories by default (or with a pref)

Hadn’t considered that. Quite tricky with the current plugin architecture, but if anyone would like to chip in with their thoughts on my previous post, the direction can be decided and the code will have to change to suit. At that time I’ll look into this

Preferably also to display the category hierarchy in the select list.

Reasonably simple to do. Would require some jQuery since the core’s treeSelectInput() function doesn’t support onchange for some reason. I’ll give it a go along with the above changes.

Do you need this right away or can it wait a bit?


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#7 2011-10-31 13:34:54

sacripant
Plugin Author
From: Rhône — France
Registered: 2008-06-01
Posts: 479
Website

Re: smd_browse_by: browse articles, images, files and links by category

Steph thank you to live this sort plug’in.
Using title instead name for Categories. Cool

@ Pieman +1

In the “Categories” tab, the categories are arranged into a tree
In the Write tab, the select “Categories” reproduces the classification of the tab “categories”
I expect that the smd_brows_by select reproduces this classification.

Offline

#8 2011-10-31 21:28:40

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: smd_browse_by: browse articles, images, files and links by category

Stef – yet again a great revival :)

Not sure if this is possible at all – but I normally hide a few sections in the write tab using rebots bot_write_tab_customize – I know that they are different pages, and it looks like totally different code on the page, but can this section list on smd_browse_by reflect this somehow?

Cheeky I know :)

Offline

#9 2011-11-12 07:41:16

masa
Member
From: Asturias, Spain
Registered: 2005-11-25
Posts: 1,091

Re: smd_browse_by: browse articles, images, files and links by category

Hi Stef,

and thanks for adopting this indispensable plugin!
Your refinements – making it work onChange and placing the selects side-by-side – are much appreciated.

Other than that I like pieman’s suggestion:

Preferably also to display the category hierarchy in the select list.

Offline

#10 2011-11-12 09:38:34

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,437
Website GitHub

Re: smd_browse_by: browse articles, images, files and links by category

tye wrote:

I normally hide a few sections in the write tab using rebots bot_write_tab_customize

If redbot makes the list of hidden sections available somewhere (prefs, some table, whatever) then it might be possible. What I think I’d prefer to do though is add a callback to smd_browse_by so other plugins can modify the list to suit. That way, bot_wtc, ied_hide_in_admin, or a plugin of your own can choose to alter the list somehow before display. Will see what I can do.

all

Has anyone had any thoughts on what I posted above? It’d be great to combine tjh_listfilter functionality and smd_browse_by somehow but I’d like some feedback / ideas / mockups on the best way to manage the functionality before I commit to anything. Thanks.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#11 2011-11-12 11:20:07

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,437
Website GitHub

Re: smd_browse_by: browse articles, images, files and links by category

I’ve just thrown together v0.11 beta. Features:

  • Category tree now displayed (thanks pieman)
  • Added hidden pref to allow you to control which select lists to use, in case you don’t want them all
  • pluggable_ui() implemented so other plugins can alter the lists (thanks tye)

The docs explain things better. Please test this and let me know if it works ok. If so I’ll release it, thanks.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#12 2011-11-12 18:36:35

masa
Member
From: Asturias, Spain
Registered: 2005-11-25
Posts: 1,091

Re: smd_browse_by: browse articles, images, files and links by category

Bloke wrote:

Please test this and let me know if it works ok.

Works fine so far – thanks muchly, Stef!

Offline

Board footer

Powered by FluxBB