You are here

README.txt in Block Theme 8

Same filename and directory in other branches
  1. 5 README.txt
  2. 6 README.txt
  3. 7 README.txt
== Description ==
BlockTheme allows an admin to define tpl files for standard block templates
and provides a select box on the block configure form so the user can select
a tpl file to use as opposed to having to override the templates by block ID.

== Installation ==

1. Enable the module

2. Go to admin/config/blocktheme and add entries like:
customtemplate|My Custom Template
mysupertemplate|My SuperTemplate
Where the first name is the machine-readable name of your template which may contain only
alphanumerical characters, -, or _ . The second name is the user-friendly name that appears
in the selectionbox on the block edit form.

3. Choose from either step 4. or 5.

4. Create twig files in your theme directory like: (Note: filenames must be preceded by block--blocktheme--)
 block--blocktheme--customtemplate.html.twig
 block--blocktheme--mysupertemplate.html.twig

5. Alternatively use the extra provided variable $blocktheme to customize your
 block.html.twig or block-*.html.twig files. The $blocktheme will typically be
 used as a css class name in you template and contains the machine-readable name of
 your template.

6. In your custom block templates, you can also use values from the
 $blocktheme_vars variable. This array contains custom variables defined in the
 block edit form, right below the block theme selection.

== Usage ==

Go to the edit form for any block and select the appropriate template.

File

README.txt
View source
  1. == Description ==
  2. BlockTheme allows an admin to define tpl files for standard block templates
  3. and provides a select box on the block configure form so the user can select
  4. a tpl file to use as opposed to having to override the templates by block ID.
  5. == Installation ==
  6. 1. Enable the module
  7. 2. Go to admin/config/blocktheme and add entries like:
  8. customtemplate|My Custom Template
  9. mysupertemplate|My SuperTemplate
  10. Where the first name is the machine-readable name of your template which may contain only
  11. alphanumerical characters, -, or _ . The second name is the user-friendly name that appears
  12. in the selectionbox on the block edit form.
  13. 3. Choose from either step 4. or 5.
  14. 4. Create twig files in your theme directory like: (Note: filenames must be preceded by block--blocktheme--)
  15. block--blocktheme--customtemplate.html.twig
  16. block--blocktheme--mysupertemplate.html.twig
  17. 5. Alternatively use the extra provided variable $blocktheme to customize your
  18. block.html.twig or block-*.html.twig files. The $blocktheme will typically be
  19. used as a css class name in you template and contains the machine-readable name of
  20. your template.
  21. 6. In your custom block templates, you can also use values from the
  22. $blocktheme_vars variable. This array contains custom variables defined in the
  23. block edit form, right below the block theme selection.
  24. == Usage ==
  25. Go to the edit form for any block and select the appropriate template.