I've spent a bit of time looking over the queue, and I'm sure this exists, but I can't find it. So please if you know of the outstanding issue for this, direct me to it.

Block module naming conventions are annoying, and uninformative. I don't know which block block-block-22.tpl.php actually is, and as such it is difficult to maintain. I seem to recall giving blocks machine readable names at one point (5.x?) and would like to go back to doing that similar to the way views and cck handle this. Once a field in cck is created you can't change its machine-readable name, thus any custom code built for it is always maintained. If we could do this for block module's admin generated blocks, it would be much more useful to the themer maintaining the site. So using my above example.

Instead of:

block-block-22.tpl.php

we'd have:

block-block-machine_name.tpl.php

hope this seems logical to others.

Eclipse

Comments

effulgentsia’s picture

Title: Block Template Naming Conventions » Add machine names for custom blocks
Version: 7.x-dev » 8.x-dev
Component: theme system » block.module

I agree that machine names for administrator-added blocks would be nice.

klonos’s picture

larowlan’s picture

Tagging to align with D8 core track.
Crossposting for reference: #430886: Make all blocks fieldable entities

sun’s picture

We don't want machine names for every single block instance. We want machine names for block types.

See http://drupal.org/project/block_api for details.

sun’s picture

Issue tags: +Configuration system
sun’s picture

Issue tags: +Blocks-Layouts

@EclipseGc: This issue is quite old -- is this still the plan? If not, let's won't fix it. :)

EclipseGc’s picture

Currently in D8, I'm using UUIDs for this, I would be 100% ok with moving that over to a machine name (and I think it'd be fairly easy). That would likely be a better method ultimately, but I wanted to play with UUID when I started, and that code is still hanging around. Open for debate.

Kris

sun’s picture

Well, if we turn custom blocks into true entities, then they will have a serial ID and a UUID due to #1637370: Add UUID support to core entity types

EclipseGc’s picture

Sure, but since we're allowing multiple instances of any block, it's still relevant (even outside of entity driven blocks)

sun’s picture

Issue tags: +Plugin system
EclipseGc’s picture

Status: Active » Closed (won't fix)

ok, so machine_names seem to be shaping up to be instance specific, which is to say we actually name the CMI object, not the block. As we move to custom block entities, a UUID for the entity will cover the needs from that angle. Since all of this is sort of panning out differently (and in other issues) it has been pointed out that this issue could probably be closed. Hopefully this explanation is sufficient.

Eclipse