Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2018-03-16 18:57:24

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 687
Website Mastodon

Reconfiguring article->write per section, category or tag

Is there a lean way to reconfigure the article write form on a per section, per author, per category, per smd_tag base eventually?

This would concern showing or suppressing custom fields, excerpts, bodies, categories, posted/expired section, meta etc. – on a per section, per author, per category, per smd_tag base.

Simple example
An article in section “For sale” needs a custom field price but not phone number – but an article in section “Managers” needs no price but phone number.

Different example
Author A is clever enough to write into a custom field pros and cons, but for author B, who is a bit disrespectful, this custom field should be unavailable/suppressed. Yet content author A has put in there should remain existent, if author B edits the respective article.

I have smd_admin_themes installed, but i don’t seem to get there.

Any hints appreciated!

Last edited by jayrope (2018-03-16 18:59:26)


A hole turned upside down is a dome, when there’s also gravity.

Offline

#2 2018-03-16 19:24:55

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,305

Re: Reconfiguring article->write per section, category or tag

bot_write_tab_customize (this version patched by jakob for TXP v4.6, I think)
For authors there’s the CSS way of hiding/styling via bot_body_class


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

Offline

#3 2018-03-16 20:00:00

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

Re: Reconfiguring article->write per section, category or tag

A different approach: roll your own Write panel. smd_tabber (or jcr_dashboard if you can find a copy) allows you to make your own tabs. You can put anything you want on there (e.g. mem_simple_form / mem_form / etc_query) and then use smd_user_manager to control access to the tabs. Even hide the real Write panel if you want from certain user groups.

I know jakob has used this concept quite a lot so may be able to offer some guidance if you think it has potential.


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 2018-03-17 00:00:23

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 687
Website Mastodon

Re: Reconfiguring article->write per section, category or tag

Bloke wrote #310036:

A different approach: roll your own Write panel. smd_tabber (or jcr_dashboard if you can find a copy) allows you to make your own tabs. You can put anything you want on there (e.g. mem_simple_form / mem_form / etc_query) and then use smd_user_manager to control access to the tabs. Even hide the real Write panel if you want from certain user groups.

Excellent suggestion, thank you. I am so out of the loop, that i couldn’t wrap my head about smd_tabber and etc_search yet, though i have them installed. Probably need to find a good tutorial on either plugins.


A hole turned upside down is a dome, when there’s also gravity.

Offline

#5 2018-03-17 00:22:03

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,615
Website

Re: Reconfiguring article->write per section, category or tag

Bloke wrote #310036:

A different approach: roll your own Write panel. smd_tabber (or jcr_dashboard if you can find a copy) allows you to make your own tabs. You can put anything you want on there (e.g. mem_simple_form / mem_form / etc_query) and then use smd_user_manager to control access to the tabs. Even hide the real Write panel if you want from certain user groups.

I know jakob has used this concept quite a lot so may be able to offer some guidance if you think it has potential.

The mem_simple_form in combination with smd_query does have potential but it’s fussy and a whole lot of work and you have to do all the safety checking mechanisms yourself to avoid illegal content etc. I haven’t tried it in a while on a more recent version of txp and the mem_plugins are all pretty long in the tooth now (and some never actually worked in the beginning).

smd_tabber is very simple: it gives you an extra admin panel and a you define the admin pane for it in a form/page template.

uli’s two suggestions are good if you don’t need ultimate safety but simply want to hide stuff. bot_wtc does the per section show/hide exactly as you mention. the other plugin simply gives you classes on the body and you define per css what should be hidden to whom. It’s all still in the source. adi’s minimalism I looked at briefly (cool!) and does something similar with lots of choices.

Otherwise, a lot of the write_tab elements have a ‘pluggable_ui’ hook at the end which allows you to add/to or modify those elements with a plugin. If I’m not mistaken, you can use that method to influence what source code is shown (for example rah_status_dropdown (no longer necessary) replaces the previous radio button status choice with a drop-down). You could use that to show/hide certain elements depending on smd_um privileges level, for example. There’s no plugin I know of that allows you to pick and choose there, so you’d have to write one / have someone write one for you.

Re: multi-author sites and editing. The one site where I’ve done this in more detail is for a university department database and I set up a fairly clear arrangement. First:

  • Guest accounts can only edit their own user details and own articles. There’s no editing of other people’s articles.
  • Guest accounts have a section of their own. They can only post in their own section and a general section. All other ‘categorisation’ is via categories. A plugin basically does what I outline above and trims down the section choices to those two possibilities.
  • I have nothing of potentially private information in there. If it’s unsafe for general consumption, it doesn’t belong on the site. There are a few user-specific fields that only I can set as an admin (like which section is theirs).
  • I can’t remember exactly what I did for the admin panels: I think I may have hacked in a “shown only own articles” line into the core before the table is output (shame on me). Maybe that’s doable now per ‘hook’.

TXP Builders – finely-crafted code, design and txp

Offline

#6 2018-03-17 09:33:35

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

Re: Reconfiguring article->write per section, category or tag

jakob wrote #310052:

“shown only own articles”… Maybe that’s doable now per ‘hook’.

Definitely.


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