Style settings such as wrapping output in different html tags and adding custom classes only works for regular fields. Styling is lost when using replacement values in a global text field.

While I do understand that you can just as easily apply custom markup with global text there are situations it would not work except for adding wrapper containers. Example: An image field where you want to use the style settings to apply a css class to the default container.

Also by being able to utilize the style settings in your field configurations and have it passed into a global text through replacement values it keeps the markup in global text clean separating item styling from layout styling.

Comments

dawehner’s picture

Status: Active » Postponed (maintainer needs more info)

Can you show your replacement code you used there?

esmerel’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)
Yuri’s picture

I also experience this behavior of the Global text text field as a limitation.
It actually strips the whole lot of settings of the views fields when using the replacement patterns.
For example:
I have a page with teasers, made out of a view with fields: each having an image, title and body field.
For the title and body I have set different values in Rewrite: "Trim this field to a maximum length".
Now for the layout i want to combine them in a Global text text field (while disabling the fields) but i lose the possibility to use these settings.
Adding classes in the Global field would require knowledge of html and css, but for the trimming, php is needed. This is not really the Drupal way i guess..
I think that making the Global field more flexible, would also make it a lot easier for people that don't like views templates.

merlinofchaos’s picture

people that don't like views templates

Sorry. You'll

1) have to use the templates
2) create an unsafe field handler that will let you put in whatever you want.

This won't be changing in Views.

tim.plunkett’s picture

Status: Closed (cannot reproduce) » Closed (won't fix)

I clarified with merlinofchaos that this is truly won't fix.
The tokens represent just the field data, and it's easier to add new wrappers while rewriting than to remove them. Also, due to the order of execution of the handlers and rendering, it's not even feasible.

kiwibytes’s picture

Issue summary: View changes

I am facing the same problem. I really wanted to have CSS code in global text within view because if I put it in theme files, this setting will be lost if I change/update theme.
I found a workaround for this: Instead of using Global Text Field, use an unrestricted text field in view header or footer. That allows you to put HTML, CSS or even PHP in that field.