I ran into something today that, even as an experienced Drupal developer, I was completely thrown off by. Consider the following:
- User installs Drupal using the "Minimal" installation profile (to which no content types are added)
- After clicking around a bit, they go to "Add Content" via
node/add - No content types are displayed (obviously) but no warning message exists to prompt users and thus it appears "broken"
With the Overlay module enabled, it's especially heinous as it looks like the attached image (http://drupal.org/files/add-new-content-d7.jpg). This actually caused me to fumble around for a minute or two until I stumbled back on the "Content Types" screen where it notifies me that none are available.
I think this is partially because in Drupal 6, the absence of Minimal created content types for you.
Does it make sense for us to include some text to that effect on node/add when no content types have been created? e.g. "No content types available. Add content type."
Probably better for us to present that message than include a default content type since that would defeat the purpose of Minimal.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | seven-node_add_list-9.patch | 1.03 KB | reglogge |
| #6 | seven-node_add_list.png | 38.66 KB | reglogge |
| #4 | theme_node_add_list.patch | 914 bytes | reglogge |
| add-new-content-d7.jpg | 25.26 KB | webkenny |
Comments
Comment #1
webkenny commentedSorry, folks my inline link above is broken. Should be: http://drupal.org/files/issues/add-new-content-d7.jpg
Comment #4
reglogge commentedThis is actually a problem with seven theme which overrides theme_node_add_list() from node_pages.inc where the correct code for displaying the desired warning message is implemented. In Seven's override-function the check for
if (count($content) == 0)has been ommitted.Patch attached.
Comment #5
reglogge commentedpinging bot.
Comment #6
reglogge commentedAn even simpler solution would be to just remove the function seven_node_add_list() from template.php in seven theme. The screen for selecting the content-type would then look like the attached screenshot.
The default warning message for no existing content-types would then be displayed also.
Comment #7
Jeff Burnz commentedConfirmed - the patch in #4 fixes the issue.
Prefer to go with the patch and not require us to fix the visual style of Seven since it's quite important we maintain this.
+1
Comment #8
bojanz commentedThe fix is cool.
One nitpick: coding style.
Should be
Do a quick reroll, and this is RTBC.
Comment #9
reglogge commentedrerolled according to #8.
Comment #10
bojanz commentedOkay.
Comment #11
webkenny commentedWorks for me as well. Thanks.
Comment #12
reglogge commentedClosed as duplicate of #852394: minimal profile + seven leads to broken 'node/add' link which is more elegant.