There may be contrib modules to do that, but a very simple way to do this is to override the field template, and putting that file in your themes/MY_THEME/templates folder.
For example, to override the body field template, you should put your code in a file called field--body.tpl.php and place it in core/theme/basis/templates, or if you are using another theme, in themes/MY_THEME/templates.
You can see an example of the default code that Backdrop uses to theme fields by looking at core/modules/field/templates/field.tpl.php, (also here) but please notice that THAT particular template is not used - it's there as an example to help you override the field templates.
Also, take a look at the different patterns you can use to override fields in specific content types by looking at this help text.
I've installed the Field Wrappers module, and I can see the option to wrap a field in views, but I cannot see any options to wrap a field in my layout?
Here are a couple of suggestions for where to look in the View that creates the page:
In the FORMAT section, if the view has Show: Fields | Settings, click on the word Settings, and there...
No. There are no plans to make Composer mandatory and most people don't touch it for Backdrop sites. While there are a few things you can do in Bee that you can't do in the UI, you can easily...
Posted7 hours 23 min ago by Martin Price | System Horizons Ltd (yorkshirepudding) on:
When I get errors I don't understand, I usually first search the codebase for where the message appears. When I search for "Not authorized to perform installation" I don't find it anywhere in...
In some places, yes, that works. But since that would make it a relative path, it doesn't work for most cases. Thanks for the suggestion of the vhost ... I will try that out. :)
I have a use case that sounds somewhat similar where there is a main domain and backdrop is just a portion of it running in a subdirectory. What we did was set the vhost to a parent directory,...
Comments
There may be contrib modules to do that, but a very simple way to do this is to override the field template, and putting that file in your
themes/MY_THEME/templates
folder.For example, to override the body field template, you should put your code in a file called
field--body.tpl.php
and place it incore/theme/basis/templates
, or if you are using another theme, inthemes/MY_THEME/templates
.You can see an example of the default code that Backdrop uses to theme fields by looking at
core/modules/field/templates/field.tpl.php
, (also here) but please notice that THAT particular template is not used - it's there as an example to help you override the field templates.Also, take a look at the different patterns you can use to override fields in specific content types by looking at this help text.
The Field Wrappers module is very easy to extend to add the wrappers you need. There is an example in the wiki and in the API.php file in the module.
I've installed the Field Wrappers module, and I can see the option to wrap a field in views, but I cannot see any options to wrap a field in my layout?
Hi @kgolding. You go to "manage display" for the content type and it is part of the configuration for the field.