Motivation

Some users go to the content section, rather than the structure section, looking for options to edit content types.

Proposed resolution

On the node/add page, add links to edit the content types as well, for users who have the right permissions. This provides another way of navigating to admin/structure/types/manage/[node-type]

Remaining tasks

Summary of API changes
Needs usability review; see #59

User interface changes

Adds links to admin/structure/types/manage/[node-type] for each node type on the node/add page

Screenshot of UI before patch:
UI-before-patch

Latest screenshot of UI after patch (from comment #50):
ui-after-patch.png

Related Issues

Original report by catch

Many users go to the node/add and node/edit forms looking for settings (submitted information, input formats). We should consider adding links there to the admin screens for those form elements when users have the relevant permissions.

Files: 
CommentFileSizeAuthor
#62 drupal-add-content-description-384150-61.patch1.37 KBaschiwi
FAILED: [[SimpleTest]]: [MySQL] 58,642 pass(es), 4 fail(s), and 1 exception(s).
[ View ]
#61 add-content.jpg153.91 KBaschiwi
#59 content.png244.8 KBYesCT
#59 emphasis.png173.1 KBYesCT
#59 use_edit_hover_like_blocks.png50.98 KBYesCT
#53 after-patch-51.png28.54 KBmahaprasad
#51 content-type-edit-384150-51.patch3.33 KBmahaprasad
PASSED: [[SimpleTest]]: [MySQL] 53,060 pass(es).
[ View ]
#50 ui-after-patch.png40.69 KBrootwork
#49 Screen Shot 2013-03-10 at 5.36.24 PM.png40.69 KBrootwork
#48 content-type-edit-384150-48.patch2.57 KBrootwork
PASSED: [[SimpleTest]]: [MySQL] 53,176 pass(es).
[ View ]
#48 interdiff.txt1 KBrootwork
#46 UI-before-patch.png65.95 KBpameeela
#46 UI-after-patch.png144.62 KBpameeela
#43 content-type-edit-384150-43.patch2.59 KBmahaprasad
PASSED: [[SimpleTest]]: [MySQL] 52,432 pass(es).
[ View ]
#38 content-type-edit-384150-38.patch2.47 KBpbz1912
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch content-type-edit-384150-38.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#36 content-type-edit-384150-36.patch2.49 KBBrian Altenhofel
Test request sent.
Previous result: PASSED: [[SimpleTest]]: [MySQL] 39,834 pass(es).
[ View ]
#33 content-type-edit-384150-33.patch2.79 KBjaredsmith
PASSED: [[SimpleTest]]: [MySQL] 37,058 pass(es).
[ View ]
#32 content-type-edit-384150-32.patch2.3 KBBrian Altenhofel
PASSED: [[SimpleTest]]: [MySQL] 35,349 pass(es).
[ View ]
#31 content-type-edit-384150-31.patch1.64 KBBrian Altenhofel
PASSED: [[SimpleTest]]: [MySQL] 35,356 pass(es).
[ View ]
#27 content-type-edit-384150-27.patch1.6 KBBrian Altenhofel
PASSED: [[SimpleTest]]: [MySQL] 34,118 pass(es).
[ View ]
#24 content-type-edit-384150-24.patch1.62 KBBrian Altenhofel
PASSED: [[SimpleTest]]: [MySQL] 34,196 pass(es).
[ View ]
#22 content-type-edit-384150-22.patch1.57 KBBrian Altenhofel
FAILED: [[SimpleTest]]: [MySQL] 34,177 pass(es), 0 fail(s), and 8 exception(es).
[ View ]
#18 cross-link-edit-node-type.patch1.93 KBlucaswoj
Failed: 11624 passes, 0 fails, 6 exceptions
[ View ]
#17 CreateContentEditCTLink.png191 KBjpoesen
#15 contenttypes-final.patch1.31 KBlucaswoj
Unable to apply patch contenttypes-final.patch
[ View ]
#12 contenttypeslinkf.patch1.31 KBlucaswoj
Passed: 11624 passes, 0 fails, 0 exceptions
[ View ]
#11 contenttypeslinkf.patch1.32 KBlucaswoj
Failed: Failed to apply patch.
[ View ]
#9 contenttypeslink.patch1.25 KBlucaswoj
Failed: 10818 passes, 0 fails, 6 exceptions
[ View ]
#5 contenttypeslink.patch1.27 KBlucaswoj
Failed: Failed to apply patch.
[ View ]

Comments

Issue tags:+UBUserTesting2009

Fixing tag.

Issue tags:-UBUserTesting2009

This might be good for the novice queue.

Issue tags:+Novice, +UBUserTesting2009

Sorry, I screwed up the tags.

Assigned:Unassigned» lucaswoj

Hey, I'm completely new to Drupal development, but this looks like a great starter project. I'll see if I can get a patch done by tonight.
- Lucas

StatusFileSize
new1.27 KB
Failed: Failed to apply patch.
[ View ]

First open source patch!

The method I use to do this is arguably a little hack-ey, but because of the way that drupal handles the node/add page, its the easiest and most efficient way. The node/add page stores the content types as menu items, and displays them back without any knowledge of the content type its describing. For me to provide a link to edit the content type, I have to reverse engineer the URL that goes with the menu item.

Status:Active» Needs review

Status:Needs review» Needs work

The last submitted patch failed testing.

Status:Needs work» Needs review

Fixed patch. Relative filename problems...

StatusFileSize
new1.25 KB
Failed: 10818 passes, 0 fails, 6 exceptions
[ View ]

Not sure why this failed to attach the first time

Status:Needs review» Needs work

The last submitted patch failed testing.

StatusFileSize
new1.32 KB
Failed: Failed to apply patch.
[ View ]

Fixed errors with declaring variables. That will teach me to run my server in E_ALL...

StatusFileSize
new1.31 KB
Passed: 11624 passes, 0 fails, 0 exceptions
[ View ]

Please, please be the last try. I have to manually change the file path because diff is being mean to me.

Status:Needs work» Needs review

Status:Needs review» Needs work

Hey lucaswoj, your code is not adhering to the Drupal coding standards. If you look at the patch, you'll see that you're using tabs instead of spaces. It would be great if you could re-roll the patch with Drupal's coding standards in mind.

Status:Needs work» Needs review
StatusFileSize
new1.31 KB
Unable to apply patch contenttypes-final.patch
[ View ]

I'm sorry, I thought my IDE was already configured for spaces... I guess I've never really worried about it before.

For the 5th time, here we go....

this worked for me.

Status:Needs review» Needs work
Issue tags:+Usability
StatusFileSize
new191 KB

Thanks for your patch. It almost works as advertised - here are some remarks:

Inconsistency:
The patch indicates that line 25 replaces line 23, but they're identical so the patch should not indicate changes.

23:  -      $output .= '<dt>' . l($item['title'], $item['href'], $item['localized_options']) . '</dt>';
24:  -      [...]
25:  +      $output .= '<dt>' . l($item['title'], $item['href'], $item['localized_options']) . '</dt>';

Markup error:
On line 28 of your patch you're adding:

28: +      $output .= '</dt>';

but you really wanted to close the DD element opened on line 26, so line 28 should be:

28: +      $output .= '</dd>';

Usability:
The patch adds an 'Edit Content Type' link to the end of each Content Type definition on /node/add. However I only noticed that link after clicking around trying to find the changes introduced by the patch.

Wouldn't it make more sense to add the edit link next to the Content Type title? See attached screenshot.

Entities / wrapper:

27: +      $output .= isset($item['edit_href']) ? '&nbsp;<small>('.l(t('Edit Content Type'), $item['edit_href']).')</a></small>' : '';

I personally don't like the addition of a non-breaking space entity and wrapping the "Edit Content Type" link in small tags. The entity clutters up the code and by using the small tags we make assumptions on how this link should be displayed.

Adding a meaningful css class name is more versatile and less imposing.

Status:Needs work» Needs review
StatusFileSize
new1.93 KB
Failed: 11624 passes, 0 fails, 6 exceptions
[ View ]

Thanks for the thoughtful feedback jpoesen. I think this updated patch fixes all of your concerns.

Status:Needs review» Needs work

The last submitted patch failed testing.

Version:7.x-dev» 8.x-dev

This has unfortunately missed the string freeze for 7.

Issue tags:+SettingsAPI

Yes, please.

Assigned:lucaswoj» Brian Altenhofel
Status:Needs work» Needs review
StatusFileSize
new1.57 KB
FAILED: [[SimpleTest]]: [MySQL] 34,177 pass(es), 0 fail(s), and 8 exception(es).
[ View ]

I was bored this evening, so here's a patch that brings #18 to D8, along with a clarification that the link is to edit the content type, rather than a link to bring up a view or something that would list all nodes of that type available for editing.

Status:Needs review» Needs work

The last submitted patch, content-type-edit-384150-22.patch, failed testing.

StatusFileSize
new1.62 KB
PASSED: [[SimpleTest]]: [MySQL] 34,196 pass(es).
[ View ]

Retry...

Status:Needs work» Needs review

Status:Needs review» Needs work

Coding standards
http://drupal.org/coding-standards

else if
should be:
elseif

$output .= $item['edit_href'] ? '<span class="node-type-edit">['
  . l(t('Edit content type'), $item['edit_href']) . ']</span>' : '';

Use one line dot concatenation or the operator .=

Same here:

$output .= '<dt>' . l($item['title'], $item['href'],
  $item['localized_options']);

better:

$output .= '<dt>' . l($item['title'], $item['href'], $item['localized_options']);

Status:Needs work» Needs review
StatusFileSize
new1.6 KB
PASSED: [[SimpleTest]]: [MySQL] 34,118 pass(es).
[ View ]

Better adherence to coding standards. (Sorry, got wrapped up in "80 characters per line".)

+++ b/core/modules/node/node.pages.inc
@@ -38,6 +38,12 @@ function node_add_page() {
+    //Generate links to edit content type if user has proper permissions

Based on other patches I've looked at recently, my understanding is that comments are supposed to have a space after the "//" and have sentence formatting, e.g.

// Generate links to edit content type if user has proper permissions.

Note that I applied the patch (in D8) and am not seeing anything come up on the node/add page while logged in as super-admin. I cleared the cache and that had no effect either.

Status:Needs review» Needs work

Drush wasn't working for clearing the caches so I changed the theme to clear the theme registry and now I see the links.

+++ b/core/modules/node/node.pages.inc
@@ -58,7 +64,11 @@ function theme_node_add_list($variables) {
+      if (isset($item['edit_href'])) {
+        $output .= $item['edit_href'] ? '<span class="node-type-edit">[' . l(t('Edit content type'), $item['edit_href']) . ']</span>' : '';

I think it would be good to add a space between the content type name and the "[", e.g.

$output .= $item['edit_href'] ? ' <span class="node-type-edit">[' . l(t('Edit content type'), $item['edit_href']) . ']</span>' : '';

Also, there is no node.css anymore, that bit probably needs to be moved into node.admin.css

Status:Needs work» Needs review
StatusFileSize
new1.64 KB
PASSED: [[SimpleTest]]: [MySQL] 35,356 pass(es).
[ View ]

Updated patch.

Also noticed that the links don't appear when using the Seven theme. Tried applying the patch, creating a new empty database, then installing Drupal, used another browser that had not accessed my dev environment, and still didn't see them on Seven. That *should* rule out caching issues.

StatusFileSize
new2.3 KB
PASSED: [[SimpleTest]]: [MySQL] 35,349 pass(es).
[ View ]

Ahh... there's a template.php override in Seven...

Here's an updated patch...

Also cleaned up the "if" surrounding the addition. When I first worked on this in December, I admit that I was just being introduced to the ...?...:... syntax at the time.

StatusFileSize
new2.79 KB
PASSED: [[SimpleTest]]: [MySQL] 37,058 pass(es).
[ View ]

I've cleaned up the patch so that it works with modern Drupal 8 code... the previous patch was suffering from some bit-rot. The attached patch is functionally the same as the previous patch.

I've tested the attached patch myself, but would love to see some additional review so that we can get this pushed through.

Status:Needs review» Reviewed & tested by the community

Applied patch, looks good, works for core and custom content types.

Status:Reviewed & tested by the community» Needs work

Hmm I think I'd probably place the permissions check directly in the theme function rather than overloading the node type objects. Also is the new CSS absolutely necessary in node.admin.css or could that be put in seven theme instead?

Status:Needs work» Needs review
StatusFileSize
new2.49 KB
Test request sent.
Previous result: PASSED: [[SimpleTest]]: [MySQL] 39,834 pass(es).
[ View ]

This patch moves the CSS to Seven theme since it is not necessary to provide a default here. It also moves the call to user_access() and generation of content type edit links to theme_node_add_list().

#36: content-type-edit-384150-36.patch queued for re-testing.

StatusFileSize
new2.47 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch content-type-edit-384150-38.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Applied #36 to bc1da65 and rerolled it.

It seems to work.

Status:Needs review» Needs work
Issue tags:-Usability, -Novice, -UBUserTesting2009, -SettingsAPI

The last submitted patch, content-type-edit-384150-38.patch, failed testing.

Status:Needs work» Needs review

#38: content-type-edit-384150-38.patch queued for re-testing.

Status:Needs review» Needs work

did a standards review. mostly looks good.

+++ b/core/modules/node/node.pages.incundefined
@@ -59,9 +59,17 @@ function theme_node_add_list($variables) {
+      // Generate links to edit content type if the current user has proper permissions.
+++ b/core/themes/seven/template.phpundefined
@@ -44,10 +44,17 @@ function seven_node_add_list($variables) {
+      // Generate links to edit content type if the current user has proper permissions.

comments should wrap at 80 chars. See: http://drupal.org/node/1354

Status:Needs work» Needs review
StatusFileSize
new2.59 KB
PASSED: [[SimpleTest]]: [MySQL] 52,432 pass(es).
[ View ]

Applied #38 and rerolled it.

Hope it will work.

Thanks @mahaprasad!

screenshots embedded in the issue summary with before and after would help. Also it would help to update the issue summary using the issue summary template.

Issue tags:-Needs screenshot
StatusFileSize
new144.62 KB
new65.95 KB

Did a manual test of this patch. Works well but some minor issues.

1. There are brackets appearing in the output - see screenshot

UI-after-patch.png

2. The hover state for the 'Edit content type' links doesn't work - doesn't get an underline, as it should.

Also uploading a screenshot of the UI before to add to summary.

Status:Needs review» Needs work

Does this patch include any updates to node/edit pages? Couldn't find any, only saw changes to node/add. If there are proposed changes to the edit screen as well can someone provide more detail?

Issue summary:View changes

Updates summary to use template.

Assigned:Brian Altenhofel» rootwork
Status:Needs work» Needs review
Issue tags:+#SprintWeekend
StatusFileSize
new1 KB
new2.57 KB
PASSED: [[SimpleTest]]: [MySQL] 53,176 pass(es).
[ View ]

Updated the patch from #43 to remove the extraneous brackets and give it the right span wrapper.

StatusFileSize
new40.69 KB

Here's a new screenshot of the add content page with my revised patch.

It looks like the underlines on hover still aren't appearing. I'm going to try to track down what's going on in the CSS.

Status:Needs review» Needs work
StatusFileSize
new40.69 KB

Sorry, changing status back to needs work and embedding the new screenshot.

ui-after-patch.png

Issue summary:View changes

Updates [username] with link to OP

Status:Needs work» Needs review
StatusFileSize
new3.33 KB
PASSED: [[SimpleTest]]: [MySQL] 53,060 pass(es).
[ View ]

Fixed the hover link & aligned the links in one line.

Please find the attached patch.

Thanks @mahaprasad, @rootwork, and @pameeela! The updates make it much easier to understand the proposed change.

The proposed pattern seems pretty confusing to me, and it's different from any pattern we have elsewhere. We have two links that say "edit content type" with nothing to distinguish them aside from their spacial placement. I would have no idea which link I was supposed to click on when going to this page.

For this to work at all, I think the link texts would need to be more specific, like "Add new basic page" and "Configure basic pages" or something. Also, elsewhere when we have multiple operations related to one thing, we use the dropbutton pattern.

Tagging for the UX team to give feedback.

StatusFileSize
new28.54 KB

Applied the #51 patch & tested screen shot is attached.

patch-51

Status:Needs review» Needs work

Minor in style.css
\ No newline at end of file

Status:Needs work» Needs review

@xjm (and useability reviewers), what if the pattern was more like the screenshot in #50? I actually thought that's what the previous patch was trying to create. I agree having the two links next to each other, with one in brackets, would be confusing.

What if they were on two separate lines, with the second line saying "Edit article content type," "Edit page content type," etc.?

Another option I could see is tacking it on to the end of the help text. So then it would say something like "Use articles for time-sensitive content like news, press releases or blog posts. Edit this content type." The edit link could be in parentheses, brackets, or italicized, although I think the fact that it's a link would probably set it apart enough.

@rootwork @xjm I also think this is really confusing. I frequently do training for users new to Drupal and the concept of editing content vs editing content types is already hard to grasp. I think this blurs the line even further, by eliminating the content/structure split - which I see as a small hurdle to get over up front, but from there it makes a lot of sense.

I do appreciate this as an attempt to make things less confusing, so I am keen to see what the UX team thinks!

@rootwork, #50 is exactly what I found very confusing. My review is about that screenshot.

Issue summary:View changes

updating latest screenshot

StatusFileSize
new50.98 KB
new173.1 KB
new244.8 KB

I'm reading the motivation in the issue summary:

Some users go to the content section, rather than the structure section, looking for options to edit content types.

I've seen this in Usability testing the multilingual stuff.
http://groups.drupal.org/node/285978 (g.d.o post). I have not gone through all the video to make notes yet. I'll come back and provide a specific example when I find it.

But, from memory, I think where they actually went was: admin/content (not the shortcut to add content):

content.png

And then tried the edit link for a particular piece of content when attempting to configure the content type in general.

on the add content page

But back to the add content page...
the text in [ ] reminds me of the [edit] [clone] [delete] links that used to show up when hovering over a view.

Consider:
1. What about using the word *structure*.
2. Also, since this is the add content page. We do not want the main emphasis to appear to be to edit the content type. (which it is I think in the screenshots previously posted)
3. Being specific about the links, so they are not identical.. there might be some code reusable from #1810386: Create workflow to setup multilingual for entity types, bundles and fields because we had to figure out the type of things when building the label for in input items.

a. Article[ Edit Article content type structure ]
b. Article[ Edit Article content type ]
c. Article[ Edit Article structure ]
d. Add an Article[ Edit Article structure ]

this shows a and b:
emphasis.png

but I think my favorite might be:

use_edit_hover_like_blocks.png

I would mark this needs work for that. But I think we still want a Usability review to point this in an acceptable direction.

[edit: added width= on the img's because my retina display yields giant screenshots]

Status:Needs review» Needs work
StatusFileSize
new153.91 KB

Just got to this issue via the Prague code sprint (http://drupalmentoring.org/node/425/). I'm not sure this is still relevant, since the UX team hasn't given any feedback and there's still discussion about it. Also the patch is pretty outdated by now.

I think one major part of the problem is that only the content types are listed here, but not the "action" - in my experience people forget to read the page title, which states "Add content" (that title is also hard to see with Overlay module on). So they click on "Article" thinking they can edit the content type. Proposed quick fix: Make the links say "Add Article" and "Add Page".

Here's a screenshot, what do you guys think?

add content

StatusFileSize
new1.37 KB
FAILED: [[SimpleTest]]: [MySQL] 58,642 pass(es), 4 fail(s), and 1 exception(s).
[ View ]

Here's a small patch to theme_node_add_list and seven_node_add_list for testing purposes. See comment #61 for a screenshot of the result.

Status:Needs work» Needs review

Status:Needs review» Needs work

The last submitted patch, drupal-add-content-description-384150-61.patch, failed testing.

I like the idea in #61.

But we still desperately need useability reviewers, for instance for the other ideas in #59.

Issue summary:View changes

added related issues

Component:node.module» node system
Issue summary:View changes

(Merging "node system" and "node.module" components for 8.x; disregard.)

Assigned:rootwork» Unassigned
Status:Needs work» Needs review
Issue tags:-#SprintWeekend+SprintWeekend2014, +useability, +Needs usability testing

Sorry, didn't realize this was still assigned to me. This still needs a useability review.

Issue summary:View changes
Issue tags:-useability

Updating issue summary and removing my misspelled tag.