Weceem

Propose Content Types when creating new content

Details

  • Type: Improvement Improvement
  • Status: Open Open
  • Priority: Trivial Trivial
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: 2.0
  • Component/s: None
  • Labels:
    None
  • Request Controller:
    Please Select
  • External Supervisor:
    Please select
  • Executing Programmer:
    Please select

Description

The problem: if you want to write a new Blog entry, how do you do it? Right now you'd have to select the Blog node that is the blog you want to write for, click New Content, choose "Blog Entry" from the list - the list is alpha sorted so defaults to Blog which is not the right type for this.

Or you can use New Content, choose Blog Entry, and then drag and drop it under the right blog.

I propose the following changes:

1) When "New Content" is clicked, we look for a currently selected node. If there is one, we look up the type of it and see if there is a "defaultChildClass" static property set on the class, and if so we make the dialog default to that type.

Eg in Blog we would set defaultChildClass = BlogEntry.class

If the static property is not defined on the selected node, we auto-select the same content type as the current selected node. Eg if you have an HTMLContent node selected, it will default to creating a new HTMLContent (auto selects it in the drop down, you can still change it).

If there is no selected node, we just do nothing and let them select from the alpha-sorted list.

This is all pretty easy to implement.

2) We add another static property convention on content classes eg static permittedParents = [Blog.class]. We use this so that when we build the list of types that the user can create after clicking New Content, the list only includes types that have no value for permittedParents (implies any) or their class is listed in the value of permittedParents.

This is different from "canAcceptChild" (which we have as a JIRA'd requirement - needs to change to a property I think, not an event) as some node types can only make sense as children of specific types - others can not care who their parents are but the parent might need to filter who their children are.

Activity

Hide
Göran Ehrsson added a comment - 22/Jun/10 5:03 PM

I think it should be possible to set "defaultChildClass" (or something like that) for each node instance.
In one site I have a HTMLContent node that can only have Product nodes as children (Product is a custom content type with lots of product details that extends HTMLContent)
Today I have instructed the site admin that she must select Product when adding new products.

Show
Göran Ehrsson added a comment - 22/Jun/10 5:03 PM I think it should be possible to set "defaultChildClass" (or something like that) for each node instance. In one site I have a HTMLContent node that can only have Product nodes as children (Product is a custom content type with lots of product details that extends HTMLContent) Today I have instructed the site admin that she must select Product when adding new products.

People

Vote (1)
Watch (1)

Dates

  • Created:
    18/Nov/09 5:10 PM
    Updated:
    09/Nov/10 5:18 PM