Answer the question
In order to leave comments, you need to log in
How to remove empty divs?
Good morning wt. Forum users are gurus. The question for you may be simple, but I did not ask such a question. Often at a verst I come across the fact that without filling some field it is displayed empty on the page, and if God forbid it needs to be styled like that, then you have to use the :empty pseudo-element, but agree that this is not Drupal-style, right? There should be nothing on the page other than the .
Attached image
P.S. The image turned out to be small, so I'm attaching a link to the full version
joxi.ru/V2VnD4Rs4kyG2v
P.S.S. To put it simply: empty .field-content tags in any of the empty fields.
Thank you very much. =)
Answer the question
In order to leave comments, you need to log in
In the settings of each field there is an item "Behavior in the absence of results". Check the box "Hide when empty"
The fields are displayed using a view, respectively, in the settings of this view, you can either in the field settings in the "BEHAVIOR WITH NO RESULTS" check the checkbox "Hide when empty", or in the settings for the output format of the view, select "Hide empty fields" in the settings for the fields (in this case it will work for all empty fields)
What do these empty divs do to you?
Try digging into field.tpl.php. I think you can write a condition there, if the field contains something, then display it, if not, then do not display it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question