[development] Making blocks from some setting in Drupal 7?

Gábor Hojtsy gabor at hojtsy.hu
Thu Feb 21 10:26:02 UTC 2008


On the quest to better format support in Drupal 7, I made a
spreadsheet of how certain texts are filtered in Drupal as of now:

The table shows some interesting bits, like the user signature format
changing based on the actual format used for a comment, which is quite
interesting; or some node details filter_xss()-ed in action
implementations, when they would probably better filtered with their
format. (Let's follow up about these on the node.)

Anyway, one itch which shows up here is to add support for site
settings like "footer message", "mission", etc. These are without
format support now, so even if the whole of your site uses wiki
formatting, you cannot use that here. Or if you have an input policy,
it is not enforced here. There are basically two ways to solve this:

 - add format support for site variables (that would be a format
column in the db, which is only used for some settings)
 - move these settings to an area which supports formats already
(nodes, blocks come to mind)

After thinking about this more and more, I came to the realization
that making these blocks would be fun.  The affected settings are:

 - site mission
 - site footer
 - user registration help
 - contact page help

Some reasons for why this could be cool to be blocks:

 - provide these with format support instantly
 - give examples on things put in the footer region, content top region, etc
 - give examples on blocks limited to pages (mission to front page,
helps limited to pages they provide help for)
 - get rid of special "theme feature" settings for displaying the
mission, as it is a normal block (btw I'd get rid of the "search
feature" provided by themes and let them use/theme the search block
instead - those reading the Drupal 5 Themes book probably realized how
awfully confusing are the various search input options)

There is still one core setting left which cannot be made a block, the
site offline message. And there are certainly other contrib use cases,
where making blocks is not a good idea, so moving the above stuff to
blocks would not solve the generic problem. The reason I am bringing
it up regardless is that it would (IMHO) provide some more consistency
and better features for these settings.

What do you think?

Ps. As far as easy theming of these go when moved to blocks, there is
a DROP task to replace numeric block deltas with named deltas:
http://drupal.org/node/216072 Which would result in
block-system-mission.tpl.php and the like :)


More information about the development mailing list