1

In a custom view I have several fields excluded from display.
I wanted to use their values within an global:fieldset with rewrite output option.
This works but the values are embedded in a <span> that I don't want, and I didn't find the way to remove it. i.e. if rewrite text use the replacement patterns [field1],[field2],[field3] I got as result

<span>field1 result, field2 result, field3 result</span> 

instead of only: field1 result, field2 result, field3 result

1 Answer 1

2

You will need to click on the fields you excluded (one by one), click on Style settings and select Customize field HTML. Then select -None- under HTML Element. You may need to do this for Customize label and Customize wrapper. Click Apply. Don't forget to click Save.

enter image description here

EDIT: Since you have now clarified that you are using Views Fieldsets (and for next time, be sure to provide ALL details about your problem!), I believe you will need to override the default tpl.php file for the Views Fieldset fields.

Views Fieldset provides default tpl.php files inside the template folder inside the module folder (usually found in /sites/all/modules/views_fieldset. You need to copy the content of that file, save it in your theme's template folder and modify it. Follow the steps in this general tutorial (you will need to adapt it to your problem) to override the default template for Views Fieldset fields. Good luck.

5
  • Thanks for your answer but it does not work, I still have the span around the alter text. I edited my question to show it better.
    – Pierre_C
    Nov 24, 2015 at 21:23
  • Where are you trying to rewrite the fields? Are you creating a Global: Custom text? If so, you will ALSO need to customize the style for that custom text field (the SPAN is probably coming from that custom field)
    – argiepiano
    Nov 25, 2015 at 7:14
  • I rewrite the field Global:fieldset that does not provide the possibility to customize the style. But when I look at the code of this module I do not find where a span is added.
    – Pierre_C
    Nov 25, 2015 at 18:34
  • See my edited answer now.
    – argiepiano
    Nov 25, 2015 at 19:41
  • Thanks for you edited comment and help. I already overided this template without success because the content of the rewriten global:fieldset (the result) is provided in the $legend variable. The content of $legend is embeded within the span tag that I want to avoid. A solution would be to remove it by extracting this tag from the $legend variable directly within the template tpl file. I expected that some one may explain me from where this span tag comes and how to remove it.
    – Pierre_C
    Nov 26, 2015 at 22:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.