Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2021-08-02 13:57:25

Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,137

Article search field Easter eggs?

If I want to search for articles with a status of Draft, I can:

  1. select the dropdown header
  2. select the ‘Toggle all/none’ checkbox
  3. select the ‘Status’ checkbox
  4. select the ‘Search articles’ field
  5. type Draft
  6. press Enter or select the magnifying glass

This works. It’s six steps. Is it possible (or viable, or unreasonable, or whatever else) to:

  1. select the ‘Search articles’ field
  2. type status:draft
  3. press Enter

…and see the same result? Perhaps a similar route with less mousing / tapping involved for keyboard jockeys like me? I can’t be alone in this.

This feels like it should already be possible with some sneaky option that’s not well-known…

Any advice or feedback from the Textpattern hivemind most gratefully received!


#2 2021-08-02 14:42:11

From: Leeds, UK
Registered: 2006-01-29
Posts: 11,269
Website GitHub

Re: Article search field Easter eggs?

With our supercharged Search/Filter class this is eminently doable and something I have thought about to a greater or lesser degree and then forget.

I don’t like the overly clicky clicky nature of the search either. Coupled with that, when you initiate a search from another panel – e.g. click an Article count from the Sections panel – it changes the dropdown (which is nice) but keeps it that way for future searches (which may be deemed unexpected). Thus if you use any of the other links and then try to perform a subsequent search it will do so within only the field that you last used.

To some degree, I do like that the search keeps the previous setting for future searches. Though other times I wish it wouldn’t. Guess it’s one of those things we have to live with as we can’t have both easily.

Anyway, my thoughts about this proposal are:

  1. By implication, it renders any existing search checkboxes inoperative. So if you have ‘section’ and ‘category’ selected in an article search and type in status: draft then it would consider all articles. That could actually be considered a positive feature as a shorthand way to bypass the dropdown, reducing the annoyance mentioned above.
  2. Whatever we choose as delimiter (colon seems logical, as you suggest) will piss off people who want to search for things containing that delimiter. Granted, it would only apply if the thing preceding the colon is the name of a database column, but even so. Potentially unexpected for people who don’t know about the Easter egg feature.
  3. Combinations are tricky. What happens if someone uses status: draft section: products? Is that an OR situation? Find me all articles of status draft OR in section products? Would "status:draft section: products" treat it as AND? If so, we’d have to split the search terms up if they are in ‘verbatim’ double quotes and see if any contain {something}: that matches a DB field, then apply them all as filters.
  4. Further to the above, would a different syntax be better than double quotes, thus retaining their use for verbatim searches? So, I dunno, {status:draft section: products} would group those terms as an AND? But then, what would be the expected outcome of {status:draft section: products} category: marvel spiderman? Draft articles in the products section OR articles with one of their categories = marvel, either of which contain the term ‘spideman’?

Not saying it can’t be done. I’m sure it can, and I’d use it. We just need to decide its scope and proceed from there to make it the most useful feature.

Last edited by Bloke (2021-08-02 15:00:29)

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


#3 2021-08-02 17:53:06

From: Cologne
Registered: 2006-08-15
Posts: 4,304

Re: Article search field Easter eggs?

Would it be feasible that non-English speakers can type their own language for “status” and “draft” etc?

In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links


#4 2021-08-03 09:01:48

Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,137

Re: Article search field Easter eggs?

I’ll open I have opened an issue so we can track. I’ve lost count of the number of times this has come up in my head and then I’ve forgotten about it.


Last edited by gaekwad (2021-08-03 09:17:29)


Board footer

Powered by FluxBB