I created a custom block that I want to include in my template file. But I don't want to include using block id. Is there any way to do it?
I enabled the box module so a machine name is added with each block. I want to add using machine name.
If you want to export the block as part of a Feature (as per your comment above), then you can use the Features Extra module.
Features Extra provides faux exportables (via Features) of several site-building components.
[...]
Block
To export a block, install FE Block, edit your block, give it a "machine name," export it with Features. You can export block settings (region settings, visibility settings, ...) of any block, and the content of blocks created with the Block module from Drupal core. The D7 version supports the Block Class, i18n block and Block Cache Alter modules.
I dont think there are any machine names associated with a block. At least didnt saw it in the database. And by the way, why will you want to use the machine name when you already have an unique identifier like the "bid"/"delta" ??
The "Drupal way" is to never use blocks directly, as theme shouldn't need any blocks to exist. Simplest way is to create a region. Regions have machine names all right. Then put your block into it. Features can export block to region associations.