Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2020-02-29 20:48:32

Myusername
Member
Registered: 2019-12-12
Posts: 44

I need to separate pending articles from the rest on the admin panel

Hello everyone!

I have a website with a large flow of daily articles; around 25 articles per day are published, and in the middle of that there are also pending articles made by the authors (which will go to the review later), which in total are around 35 articles going through the “feed” on articles panel. And that number is expected to increase even more over time.

It turns out that there is a big mess there, and often pending articles end up being lost among others, and not being reviewed and even forgotten. That said, I would like to take some questions and even ask for some tips to get a better organization for the authors.

First, I tested smd_tabber, which makes it possible to create a new tab on the panel. So I tried to create the review tab and keep only those articles that are marked as pending there. However, the <article_custom/> tag does not display posts with status="pending", which made me go to the aks_article plugin, however it does not work on the admin side, only on the public side. So the question is: Would it be complicated to make aks_article work on the admin side?

Second, I would like to know if anyone knows a plugin that could change something in the articles panel. Perhaps separating articles by status, or a drop-down menu with options responsible for quickly displaying only articles with the selected status. (I know it is possible to do this by default search, however, it is a bit “boring” when the job needs to be done quickly.

Well, anything that can help I appreciate it.

Offline

#2 2020-02-29 21:24:22

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,120
Website

Re: I need to separate pending articles from the rest on the admin panel

I would go with adi_matrix. There may be a newer version floating around somewhere (I have 2.1beta3 that I got from somewhere, but I’m not sure if that’s the latest).

Create a matrix called “Pending articles” or something, set the status to Pending and choose which columns you want to show on the panel. The bonus? You can edit more than one article at once and save them all, just by visiting your Content->Pending articles panel. It’s utterly brilliant.


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

#3 2020-03-09 19:12:33

Myusername
Member
Registered: 2019-12-12
Posts: 44

Re: I need to separate pending articles from the rest on the admin panel

Bloke wrote #322015:

I would go with adi_matrix. There may be a newer version floating around somewhere (I have 2.1beta3 that I got from somewhere, but I’m not sure if that’s the latest).

I did some tests with adi_matrix, but it’s still not what I’m looking for.

Tell me, is it possible to duplicate the “articles” tab in the admin panel in some way and rename it?

Because if that were possible, it would be easy to show articles from just a section, category, status, etc. I tried a few things, but to no avail.

Last edited by Myusername (2020-03-09 19:17:11)

Offline

#4 2020-03-09 19:58:47

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 7,760
Website

Re: I need to separate pending articles from the rest on the admin panel

The easy but very clumsy way is to order articles by status in the articles tab. Unless you have a lot of stickies, pending articles should appear somewhere in the top, when viewed in reverse order.


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | NeMe @ github | Covid-19; a resource
I do my best editing after I click on the submit button.

Offline

#5 2020-03-09 21:18:43

Myusername
Member
Registered: 2019-12-12
Posts: 44

Re: I need to separate pending articles from the rest on the admin panel

colak wrote #322117:

The easy but very clumsy way is to order articles by status in the articles tab. Unless you have a lot of stickies, pending articles should appear somewhere in the top, when viewed in reverse order.

Yes, I’ve seen that possibility.

But it is a little complicated. I’ll explain better:

I have some sections like: News, articles and a few more things. This section mainly generates many pending publications for review.

I also have a video section, where several videos are published daily, such as trailers, teasers and more.

In addition, I have a section that contains publications that contain information from films and series, such as: Breaking Bad, The Godfather and more.

It turns out that with so many things being published each day it gets extremely confusing, and it’s mixed content that doesn’t make sense. News in the midst of videos, which in turn, are in the midst of films.

What I need:
- A tab with all pending publications.
- A tab with all publications from the videos section
- A tab with all publications from films and series section.

I managed to do this using smd_tabber and mks_article, however the list of articles is not editable. Like, exclude articles, for example. So it ends up becoming useless.

What I thought about doing:
Find some way to duplicate the articles tab and then have it display only the articles you want, filtered by sections or status. I don’t know if it’s possible, but I haven’t given up yet.

If you know the way to do this, please tell me. I can also pay if someone is willing to develop a plugin capable of that.

Offline

#6 2020-03-10 02:17:28

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,120
Website

Re: I need to separate pending articles from the rest on the admin panel

I’m surprised that adi_matrix couldn’t help. I made a test matrix on my site that showed all pending articles as a list (with individual edit links available) so you could either edit the available fields directly and save them all at once, or click to edit each article in the Write panel individually. But maybe you’re after something very specific here.

In any case, filtering articles from the Articles panel is fairly easy using the admin_criteria callbacks, as the following simple plugin demonstrates:

# Name: smd_filter_articles v0.1.0 (compressed)
# Type: Admin plugin
# Filter articles via checkboxes
# Author: Stef Dawson
# URL: https://stefdawson.com/
# Recommended load order: 5

# .....................................................................
# This is a plugin for Textpattern CMS - http://textpattern.com/
# To install: textpattern > admin > plugins
# Paste the following text into the 'Install plugin' box:
# .....................................................................

H4sIAAAAAAAAA61WUW/qNhR+R+I/eBGag0QDgXVtA3Sq7u2dOk13Xbu7F4Qi4xyIS0gi2+FS
Vfz32U4MpGWlk8YDAp/zfed8x8fHJoHvBy8i+ClwUrICZygC/ypwxCoK5yyRwEPCJaMJCG36
OXBIIeOMGz8/cB4lzNFn8l1kqVnqWYew4Eyv9AeBE0uZi6DbFco5Mr4ezVZdbb4InDVwwUr4
eeD0PN/rWfYIBOUsl5V5oNi/mKSQTQqtGUE0BrqcZZsyR6WEZpFR0vevLgOHw4IJrYSSJJkR
unTxEXm4gzCJViwNVUhlYESvJAoZ6i/cHjYbH2MKC2ahBtVszIuUahHoiLfbgrXsoJaQebvZ
eGk2kPq0jjii8TF4aMS7Oo4BMnEPacTShXL/AVa5fHaPkU1wXrrhaZmiBnOQBU+Ruydpo18Q
RjdfP6NHSWShcxhgFCCMFWh7SpoqxP+nroKahf8sUck44WJFlWGAxhkqey98Eu5oNLr947fH
ZuPpzwL4s2tFu21USaoM2JOb/IxmqeRZcpaTFBJklmaFlFmK2x6ZqwRcXLZxgEYszQuJ5HMO
Y8f2sYNYND52BMMq3ZDOHKSP62kvmhAhTrq91Oq6Rd3rUUJmKvl5xk+Cr+12WOOoa8DX2Hbl
rjrvM6nyqJpiGpN0AeoIvS2z/rBUAJf3hJPV8eNn97Rj48qYibaX8yzX5EonRLhtc9vqH9tX
5/QwxhKeO2hNkgL2HazWVPNBqgfNt4c77WP5jGfNWGJ3vbUmHC3XuXKJMlqsIJVeklGi43oC
CKexJ4qZkNz1257IEyZd/CPe03PEFFYxeAmkCxkfGDa7IN9jlgBy2dlZrXabEjlhU8s8xvvM
THXnyN1MetPxWGs6xBr8xJ8qCqNoWDeVtMq48Z4yllrmQ5cZB7I8WNtWO2Dj69gMjVCvFlcT
79XqCBO9JSaH6ZtYO7JuFz1AkpEIyRhQThbglYZ/q3pV1JJQFxyZEVcefA1sf2jmVRNr1ypC
DU5GUav003MuLZJkeKh5bxuX1pr+VtXPn8rOVQSLXLzf+W+3tBqTdar2m/09EgtkmHOYvxvQ
nN36xu7/iI8ydF6HV5fo8Yv6/uH2S3j/+7df774qHwkbGZo5qkw9a324+/vmr9vDrCz7jZRc
KXtdDVV9xcULwOWtZydF/WYwRNV+HV4f4xr962asblYL1I1UPVX05DfPncAZVE+gjEfAq7Xz
am2ekIWo1noVNIYk1z/Vq8i8jgJnFRn/QT9w/EtycT4gNKJ90odL/+KKUJj11H+ISG8wc4bb
fwB4T5mD+wkAAA==

There are some interesting screen blips on my test site using this as you scroll up and down the list. It’s getting late here so I don’t have the mental capacity to debug it, but the gist is:

  1. A Filter area is added (via JavaScript) alongside the New Article button that houses (in this version) a single checkbox for ‘Pending articles’.
  2. If you check that box, it’ll refresh the page and only show the pending articles.
  3. If you uncheck it, the page will be restored to its usual list.
  4. The state of the checkbox is remembered in a per-user pref, so if you go back to the panel it’ll remember the filter.
  5. The styling’s a bit rubbish at the moment.

This idea could be extended to add other checkboxes for filtering by section(s). Or even combos if we were clever.

Depending on how integrated you want it, and since these filters are all available from search, an easier method than using the admin_criteria callback might be to make the checkboxes simply pass the relevant search parameters to the URL. So when you check the box, it resubmits the page with crit=pending&search_method[]=status, for example. If you didn’t want to store the state of the checkbox(es) this is a ludicrously simple plugin to write.


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 2020-03-10 10:22:07

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,750
Website

Re: I need to separate pending articles from the rest on the admin panel

Bloke wrote #322128:

In any case, filtering articles from the Articles panel is fairly easy using the admin_criteria callbacks, as the following simple plugin demonstrates:

This idea could be extended to add other checkboxes for filtering by section(s). Or even combos if we were clever.

Nice! I can think of some other uses for this. Thank you!

Depending on how integrated you want it, and since these filters are all available from search, an easier method than using the admin_criteria callback might be to make the checkboxes simply pass the relevant search parameters to the URL. So when you check the box, it resubmits the page with crit=pending&search_method[]=status, for example. If you didn’t want to store the state of the checkbox(es) this is a ludicrously simple plugin to write.

Sort of like “saved searches”. That’s a great idea!

The idea of being able to pass in the criteria via the URL would be very useful, I think. rah_wrach did it in a two-step way but it would be great for dashboards where you might have a custom-made list of the most recent “pending” (or events, or submissions) articles with a link to the respective filtered article list.


TXP Builders – finely-crafted code, design and txp

Offline

#8 2020-03-10 12:15:10

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,120
Website

Re: I need to separate pending articles from the rest on the admin panel

jakob wrote #322134:

Nice! I can think of some other uses for this. Thank you!

No problem. If you can improve it or figure out why the admin side goes haywire when scrolling up and down the list – blanking out bits of the UI in the process – then please do.

Sort of like “saved searches”.

Exactly that. I think it could be nice and easy to build a custom search builder panel. One could be as simple as allowing you to just type in a query string manually and give it a name. Perhaps the naming convention list_Pending_articles would determine that this “Pending articles” search is destined for the list (Articles) panel.

That’s super simple to set up. If you wanted to get fancy:

  1. Have a table of saved searches just like any other admin list panel.
  2. Click ‘Add Saved Search’ at the top, to see the add/edit search step (again, like we do for other list panels).
  3. Pick an admin-side ‘list’ panel from a pre-defined dropdown. Txp then knows the database structure of what should be in the table. Though some columns aren’t searchable from the UI so that might make it more tricky.
  4. Pick one or more columns to search.
  5. Type in the thing to find in the adjacent text box.
  6. Give it a user-friendly name.
  7. Click Save to add it to the DB and show it on the plugins’ main panel in its table. Pagination, search, sort, etc available as standard. Under the hood it constructs a query param string that can be appended to the URL and stashes it in the plugin’s DB table too.

Job done. With either of the above methods of defining saved searches, all you have to do then in the plugin is offer one or both of the following:

  1. On all list panels, check for the existence of a saved search dedicated to that panel. Grab them and present them as a dropdown alongside some existing UI furniture. When selected, the query filter is appended to the URL (taking into account whether the params already exist or not and replacing them if so).
  2. A simple public tag that could be used on a dashboard page to display a dropdown of a given denomination. e.g. <smd::filter type="list" label="Show articles by:" labeltag="h3" />.

Bonus points for storing the state of which filter is in use per user on each panel. And maybe making the various filters available per user role so that admins can have different searches to other types of user.

I don’t think that’d be too onerous to write if it’s of any use to anyone. Any thoughts welcome.

Last edited by Bloke (2020-03-10 12:18:08)


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

#9 2020-03-10 20:26:12

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,750
Website

Re: I need to separate pending articles from the rest on the admin panel

Bloke wrote #322136:

No problem. If you can improve it or figure out why the admin side goes haywire when scrolling up and down the list – blanking out bits of the UI in the process – then please do.

I didn’t notice any oddities save for a margin around the checkbox that causes minor misalignment but maybe I don’t have enough pending articles (9) [with Safari on Catalina].

Job done. With either of the above methods of defining saved searches, all you have to do then in the plugin is offer one or both of the following …

Sounds off-hand like you’ve thought of everything. On a dashboard I’d probably make direct links rather than a drop-down but otherwise it’s a good way of getting to grips with unwieldy numbers of articles and sections.


TXP Builders – finely-crafted code, design and txp

Offline

#10 2020-03-10 21:51:39

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,120
Website

Re: I need to separate pending articles from the rest on the admin panel

jakob wrote #322142:

On a dashboard I’d probably make direct links rather than a drop-down

Yes. If you supplied a ‘name’ attribute rather than a type, I expect it should render just the specified link.


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

Board footer

Powered by FluxBB