The current intention of the blocks admin user interface is to show the block regions in their natural habitat, switching themes whenever someone picks a different theme to set blocks for. While Drupal 6 comes with one theme enabled only, this is less of a pain by default, but it is highlighted more in Drupal 7, which has two themes enabled by default.
Issues include:
- usability testing found that people would want to use these region markers and drag and drop endpoints and were disappointed it did not work
- today's themes use a bazillion block regions displayed on various pages (eg. node specific blocks displayed inside node pages, enormous amounts of regions on the home page, etc). trying to display all these at once does not help a lot
- switching themes in the admin UI kicks the users out of context
This is discussed (among other places) on the overlay issue from http://drupal.org/node/517688#comment-2050006 onwards.
| Comment | File | Size | Author |
|---|---|---|---|
| #20 | block-regions-demo-5.patch | 16.79 KB | gábor hojtsy |
| #18 | block-regions-demo-4.patch | 14.02 KB | gábor hojtsy |
| #16 | block-regions-demo-3.patch | 12.23 KB | gábor hojtsy |
| #15 | block-regions-demo-3.patch | 12.24 KB | gábor hojtsy |
| #14 | block-regions-demo-2.patch | 4.64 KB | gábor hojtsy |
Comments
Comment #1
ksenzeeWhat Gábor said. It's deceptive not to use those highlighted regions as drop targets. Since there's no time to make them drop targets before D8, we at least need to quit showing them.
Comment #2
seutje commentedsubscribe
Comment #3
Bojhan commentedCould we demo the regions? So switching this to "Seven" but having a link - Demo block regions.
Comment #4
gábor hojtsyThis nice feature of Drupal calls out people to say stuff like (from http://stackoverflow.com/questions/1393464/drupal-administration-theme-d...)
So since it was affecting both the dashboard add new block experience and the overlay block editing experience (see http://drupal.org/node/544360#comment-2103130 and http://drupal.org/node/517688#comment-2054106)
1. The attached patch removes the theme switching from the blocks admin pages altogether.
2. This also fixes a recently introduced bug where even the new block addition
bugpage was showing up in Garland regardless of our admin theme (it inherited its theme callback from the main/default blocks page). This was a mistake introduced with the menu theme callback patch.3. The patch also adds demo pages per theme. These pages do not display blocks or any page content, just the themed page with the block regions highlighted.
4. I've also found a bug with the help text while adding the link to the demo pages to the help text. The help text was only displayed on the default tab of the blocks admin, since it was using that static path to match. Now added a more intelligent checker.
Here is how the Garland blocks admin looking now:
And the demo page when the link is clicked:
Not sure about the exact interaction we should support/follow here. Should we have some kind of "go back to block placement" action on the demo page? Is the demo link in the help adequate? (Note that the "add new block" action link is not showing up and that has its own issue at #556872: Action links do not work on all levels (example: 'add block' action link does not appear))
Comment #5
gábor hojtsyAlso note that the demo page does not spell out the name of the Highlighted content region. That is the same regardless of the patch. Tried to find the root of the issue, but decided I covered enough ground already :)
Comment #7
WorldFallz commentedTested the patch-- applies fine works as described. Nice work--- it would be nice to get some actual non-technical user feedback, but this seems to me to be a huge usability improvement.
Comment #8
dries commentedI tested this patch and I like it a lot, and agree that it makes life better. ;-)
What I'd try to do better is make it a lot more obvious that the link is context-sensitive (e.g. that is specific to the current theme). It's hidden in the documentation right now and therefore lost.
Comment #9
gábor hojtsySince we are already on the second level in the local tasks, we cannot do this easily with local tasks. We could add a local action, not sure whether that is applicable here (demo is not a CRUD operation :). Any better ideas?
Comment #10
webchickSubscribing. I'd also like to see this change.
Local action might be our best shot. It'd draw more attention to it than a task. That "+" sign next to them is a bummer, though...
Comment #11
Bojhan commentedCan anyone explain me what a local action/ local task is? Are we going to mix semantics because we want more prominence?
What about fixing the text, and making it a link in a li? Or atleast making it stand out from the crowd?
Comment #12
dries commentedI like Bojhan's proposal, although I'd make it even more explicit by changing it to:
Demonstrate block regions for $theme
That makes it clear that the regions are specific to the active theme, instead of being something generic.
Looks like a reasonably straightforward patch.
Comment #13
Bojhan commentedI agree, however lets go for
Demonstrate block regions ($theme)
Scanning wise, this takes away the need to reach a whole sentence - the 'for' word does that.
Comment #14
gábor hojtsyUpdated patch with updated screenshot as per @Bojhan/@Dries. Looking into those test failures but I highly doubt we can fail so many tests by this simple change. Removed the "add block" link from the help text, since it will be a prominent local action once the related bug is fixed.
Comment #15
gábor hojtsyOk, these test failures all around were due to how the underlying code (and many API functions) behind the blocks page assume we do switch the theme. Those underlying functions and APIs need fixing. Therefore this results in some API changes.
- made block_admin_display() do something in itself with its $theme argument (get blocks for that theme and order them with that in mind)
- _block_rehash() gets a $theme argument and defaults to $theme_key if not provided
- _block_compare() needs to know about the theme internally; since it is a usort() callback, we cannot just add arguments to it, so I've used drupal_static() outside _block_compare() to tell it the theme to use (still defaults to $theme_key as before)
- block_admin_display_form() made $theme mandatory
- the default theme needs to be passed on to the default block config page
- NonDefaultBlockAdmin() test was looking for the stark CSS in the output (assuming theme switching), that was removed
Given how all kinds of places assumed a theme switching on the blocks page, this turned out to be a bit more extensive then originally assumed. Anyway, let's see how this passes tests. I've rerun some tests, but not all, so it might turn out it still fails some tests. Let's see.
Comment #16
gábor hojtsyFound whitespace issues, updated edited patch attached.
Comment #18
gábor hojtsyDoh, theming of the blocks admin form still assumed using the $theme_key global. Also found other instances of the $theme_key, but they were not global. To overcome any later confusion, I've renamed those to $key only. Let's run this through the tests. Again, run some tests which were failing, and looked good.
Comment #20
gábor hojtsyEven more tests assumed that the blocks page was to be displayed with the same theme being edited, so they looked for blocks on the same page. Fixed this by requesting a page which is in fact displayed with the theme the blocks are edited for (picked 'node'). This flied through the two failing test groups that the detailed results above point to. Let's see whether this passes now.
Comment #21
gábor hojtsyOk, now that tests pass and the UX feedback was implemented, what is outstanding?
Comment #22
dries commentedI think this looks good now. webchick also expressed that this was important, so committed it to CVS HEAD. Thanks Gabor.
Comment #24
drupal_was_my_past commentedMarked #559244: Help text on block configuration pages should be displayed on all themes as duplicate.