We already allow hiding fields from display and also hiding their label (we also have these options available for fields in views), but what options does one have if they need to rewrite the output of a field?...
option 1: Write custom php code, having to mess with preprocess hooks and node or field-specific template files.
option 2: "Hack" their way trying to use css :before/:after pseudo-elements & the content: property.
UX problems with these two options: - Need to create your own sub-theme if you are using core or contrib, otherwise your customizations will be lost with core/contrib updates. - Have to know how to code
...don't like or can't code? Views is your friend:
option 3: Create a view showing nodes of the content type that contains the field you need to rewrite, add all the fields you need to show, add a contextual filter for nid, override the node/% path with that view.
UX problems with this option:
- Try to change the display of a content type a long time after you've implemented this -> ...see that your changes do not work -> ...try to figure out why -> ...remember that you have a view that controls the display -> smack forehead
- Did you override the node/% path with a view believing that filtering by content type would leave the rest of the content types alone? Ha, think again ...now you have to account for all content types in that view -> smack forehead again
So, how about we do any or both of these:
- In each field settings on the manage display form, add the same options that we have available in views for fields:
- adding custom css classes to the field, the label or the entire field wrapper
- changing the HTML element (tag) for the field, the label, or the entire field wrapper
- custom empty value text (for optional fields) + the option to not render if empty
- rewriting the output of fields using HTML, tokens and replacement patterns
- Allow a view to be used as a display mode of a content type. Related: #2433
PS: #2605
Recent comments
AFAIK, this is part of the FullCalendar library and it doesn't create a separate View Display. If you want to customise the look and feel, you will need to target the elements with CSS....
FullCalendar Views - way to modify list view?
CSS - font-weight: bold. If in the future you want to remove the bold for that field on all pages of the site, changing the formatting of all pages is very difficult, unlike changing the CSS...
Use text editors in Summary Field
thanks! you understood me perfectly. Displays was the place to go... now it seems so obvious! thanks!!@
How to switch on/off taxonomy titles within a node?