J3 Issue ?
avatar brianteeman
brianteeman
25 Apr 2018

There have been several issues recently about joomla needing custom post types. My view is that we can already do something similar to that without any backwards compatibility issues or the need to introduce UCM etc. and my view is that in many cases it is just a matter of perception and semantics.

But to make it easier for people to realise that we need to use the new custom admin feature of joomla to make the editor experience clearer. So I was playing around with the custom admin menu feature to see if I could create something similar to the custom post type feature being requested

I was able to create this
chrome_2018-04-25_10-52-48

In this example Types === Categories

And cars, events, blog === articles

And as we all know we can assign fields to categories and have different layouts for each category

Therefore we can already create custom post types it's just about the UI.

There is just one thing missing. When you create an admin menu item to display a list of all articles there is no option to select a filter so the article list displays all the articles.

chrome_2018-04-25_11-00-18

If however it was the same as when you create a site menu item to display a list of all articles in a category then you have achieved the custom post types people are asking for.

chrome_2018-04-25_11-02-49

I suspect in the admin it will not be quite the same as just displaying the articles in a single category but we can certainly use the activeFilters variable so that the list opens with the category preselected.

image

Then we are imho 99% of the way to satisfy most requests for custom post types

avatar brianteeman brianteeman - open - 25 Apr 2018
avatar joomla-cms-bot joomla-cms-bot - change - 25 Apr 2018
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 25 Apr 2018
avatar brianteeman brianteeman - change - 25 Apr 2018
The description was changed
avatar brianteeman brianteeman - edited - 25 Apr 2018
avatar brianteeman
brianteeman - comment - 25 Apr 2018

The one thing we dont have right now is an easy way to assign a collection of fields to categories. I remember there was a discussion about this when fields were added to Joomla but I completely forget the reasoning that this was not done. maybe @laoneo can enlighten us on that aspect

avatar helpwise
helpwise - comment - 25 Apr 2018

This is a great start ~!

My only issues is that Categories are hierarchical, and Types are not (?), buuuttt.... I am thinking that through and cannot see why this would not be a great step forwards and cover most of the issues in previous chats !

Adding Tags filtering in the menu and making sure that sub categories inherit the Custom Fields would be important in my view..

avatar franz-wohlkoenig franz-wohlkoenig - change - 25 Apr 2018
Status New Discussion
avatar franz-wohlkoenig franz-wohlkoenig - change - 25 Apr 2018
Category Administration com_categories com_menus Feature Request
avatar Bakual
Bakual - comment - 25 Apr 2018

My only issues is that Categories are hierarchical, and Types are not

Look at it as a feature. You can have nested types. Eg a type "car" and then a subtype "Opel" and another one "Ford". ?

avatar laoneo
laoneo - comment - 25 Apr 2018

@brianteeman The easiest way would be a batch command to assign multiple fields to a category. From my point of view there is no issue doing that.

avatar pepperstreet
pepperstreet - comment - 25 Apr 2018

Also hence this related topic "Improve admin menu items" #17407

avatar brianteeman
brianteeman - comment - 25 Apr 2018

@laoneo except that functionality doesnt currently exist

I understand that field groups = tabs
I understand that a field can be assigned to a category

Wouldnt it also make sense that a field group can be assigned to a category

avatar laoneo
laoneo - comment - 25 Apr 2018

No issue with that as well.

avatar brianteeman
brianteeman - comment - 25 Apr 2018

maybe its my memory failing but I seem to recall there was a discussion about putting field groups in caategories when you did the original PR

avatar laoneo
laoneo - comment - 25 Apr 2018

At that time field groups have been categories. I guess you mix things up.

avatar brianteeman
brianteeman - comment - 25 Apr 2018

that explains that

avatar Bakual
Bakual - comment - 25 Apr 2018

Wouldnt it also make sense that a field group can be assigned to a category

This may become interesting as soon as the assigned field category and field group category aren't matching. Which one should then have precedence?

avatar laoneo
laoneo - comment - 25 Apr 2018

It is only about assignment, it will be then assigned to both.

avatar ggppdk
ggppdk - comment - 25 Apr 2018

Yes, indeed, this is a simple (?cleaner?) solution
it bonds well with the existing assignment of custom fields by category

and it is usable by any component

  • i would say that Joomla already has "types" for all components since the custom fields were added per category,

just some UI work is needed, to expose what is already possible

To make this more automatic i would say to do this

  • Optionally "Flag" categories as types (add a new column to categories table: is_type)
  1. (as mentioned) You have nested types with ACL (create / edit / etc) per type
  2. Items assigned to a flagged category (or to its any sub-categories) will (automatically) appear in (?frontend?) / backend management as items of the type in the types menu, that have the same name as the category, an item inside 'Automobile' Category is-an "Automobile" and if you move it to sub-category "Truck" it is both an "Automobile" and a "Truck", thus if you filter by "Automobile" you should also see the "Truck" items
  3. When creating content the types selector (a new form element) is populated according to create ACL of the flagged categories
  4. If creating an item of type "Automobile" limits category selector to "Automobile" category and to its descendants, if creating a "Truck" limits category selector to "Truck" category and its descendants

Specially for com_content (J4) rename "articles" term to "items" , no need to change DB table name or context name (com_content.article), just change all language strings and documentation everywhere

[EDIT] this last one is probably bad idea, see comment below #20233 (comment)

avatar mbabker
mbabker - comment - 25 Apr 2018

Optionally "Flag" categories as types (add a new column to categories table: is_type)

Might as well do the content/post types thing in the other issue if you're doing that. Because that's what you're leading up to.

Specially for com_content (J4) rename "articles" term to "items" , no need to change DB table name or context name (com_content.article), just change all language strings and documentation everywhere

Bad idea. That's changing labels for the sake of changing labels (inherently breaking all documentation ever written) and leaving the code and the UI massively inconsistent.

avatar ot2sen
ot2sen - comment - 25 Apr 2018

Thinking out loud, with the lack of experience in how new installable demodata actually works, but could this approach be provided with installable "demo packages"?
Core provided installable packages of setups similar to demo data but being useful starter type kits.

avatar Bakual
Bakual - comment - 25 Apr 2018

You can do almost anything with a sampledata plugin.

avatar ggppdk
ggppdk - comment - 25 Apr 2018

Might as well do the content/post types thing in the other issue if you're doing that. Because that's what you're leading up to.

hhmm i am continueing discussion already done in this topic,
which is about using something that is already implemented

Bad idea. That's changing labels for the sake of changing labels (inherently breaking all documentation ever written) and leaving the code and the UI massively inconsistent.

Well, ok, you could keep as articles, just the term will feel wrong
plus once you add the "types" terminology you have this already:
"and leaving the code and the UI massively inconsistent"

avatar mbabker
mbabker - comment - 25 Apr 2018

Article is already a generic term. There's nothing gained from changing the term and breaking 12 years of history for the sake of replacing a generic UI term for another more generic UI term.

avatar ggppdk
ggppdk - comment - 25 Apr 2018

Article is already a generic term. There's nothing gained from changing the term and breaking 12 years of history for the sake of replacing a generic UI term for another more generic UI term.

Good argument, indeed, probably not worth the troubles changing this term

avatar tonypartridge
tonypartridge - comment - 25 Apr 2018

Funny enough this is something myself and @GeraintEdwards have talked about in the past. We were originally looking at handling it with a plugin, but if the core natively adopts it then awesome!

Would make it much better when using com_content for more than just site pages..

avatar brianteeman
brianteeman - comment - 25 Apr 2018

There are no needs for any dB changes and nor should there be any to achieve this

avatar GeraintEdwards
GeraintEdwards - comment - 26 Apr 2018

If the admin menu item passed an extra parameter e.g. &type=catid then it would be easy for the edit page to use slightly different language strings??

avatar brianteeman
brianteeman - comment - 26 Apr 2018

@GeraintEdwards you're the dev not me. so i can't answer that but it sounds feasible

avatar brianteeman brianteeman - change - 28 May 2018
Labels Added: J3 Issue
avatar brianteeman brianteeman - labeled - 28 May 2018
avatar brianteeman
brianteeman - comment - 26 Jun 2018

I have started working on this. I have been able to add category selection to the admin menu link.

But the url is generated as index.php?option=com_content&view=articles&category_id=8
and it needs to be filter.category_id

Any hints

avatar brianteeman
brianteeman - comment - 26 Jun 2018

OK that part done thanks to @tonypartridge

avatar helpwise
helpwise - comment - 25 Oct 2018

Just downloaded and tested this feature in Joomla 3.9.

Great work Brian et al ! Thanks for doing this - it makes a content admins life much easier.

To see this, and workflows being incorporated into Joomla 3.9/4.0 is frankly extremely satisfying.

Especially for government opportunities where document workflow (and accessibility) are key factors in the platform.

Now we just need standard template overrides for category list pages, and to also be able to actually 'delete my article' from the front end and I think Joomla will have made significant strides interface wise.

avatar brianteeman brianteeman - change - 8 Nov 2018
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2018-11-08 13:17:42
Closed_By brianteeman
avatar brianteeman brianteeman - close - 8 Nov 2018

Add a Comment

Login with GitHub to post a comment