Hey @jeffburnz, I have been playing around with JohnAlbin's awesome Fences module in an attempt to get more lean semantic markup. While fences lets you override default fields in the manage display section for each and every field, fences also has some global and far reaching settings in its main configuration area. These two settings are as follows (image is attached as well):

a) Default DIV Markup for unconfigured fields: Override the default wrapper markup with Fences' lean markup (single div wrapper)
b) Default Classes: Override the default classes with Fences' single field-name class

Do you know if using these two settings as defaults would in any way cause problems with adaptivetheme or some of the CSS you have written as a lot of Drupal's 'divitis' would be gone. :)

CommentFileSizeAuthor
Fences.JPG38.09 KBsylus
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Jeff Burnz’s picture

I wouldn't think you'll run into any major problems, although AT has an override for theme_field() and two more, one for image fields and one for taxonomy term fields. Worth experimenting, I'll give it a whirl. I've used it quite a lot as well, although not with those global settings - in fact I didn't even know they existed :)

Jeff Burnz’s picture

Using the single class will break things in two places:

1 - if you are using the image alignment settings, they need the field-type class.

2 - the default styles for taxonomy term fields, that uses the field-type class also.

No big deals really.

MXT’s picture

Version: 7.x-3.x-dev » 7.x-3.1

Hi all,

I don't know if something has changed in last 7.x-3.1 but now I encountered the following inconsistency: the more external wrapper (that one that includes the field itself and its label) disappear at all.

Case 1-> resulting html for a field with fences module disabled:

<section class="field field-name-field-ref-decorator field-type-entityreference field-label-inline clearfix view-mode-full">
  <h2 class="field-label">Decorator:&nbsp;</h2>
  <div class="field-items">
     <div class="field-item even">
       <a href="/en/professionals/decorator-1">Decorator 1</a>
     </div>
   </div>
</section>

.

Case 2-> the same field with fences module enabled and "Wrapper markup" setted as "Paragraph - <p> - paragraph":

<span class="field-label">Decorator:</span>
<p class="field field-name-field-ref-decorator field-type-entityreference field-label-inline inline view-mode-full">
    <a href="/en/professionals/decorator-1">Decorator 1</a>
</p>

Notice that the wrapper <section ...>...</section> has disappeared and the label tag becomes a <span>

.

Case 3-> the same field with fences module enabled and "Wrapper markup" setted as "No markup - no wrapping html":

<span class="field-label">Decorator:</span>
<a href="/en/professionals/decorator-1">Decorator 1</a>

Notice that correctly no wrapper is printed around the field, but the major external wrapper <section ...>...</section> still is not present.

For all above cases the Fences global setting "Default “div” markup for unconfigured fields" is setted to " Use the default wrapper markup from Drupal (nested divs).".
But the result is the same if this is changed to "Override the default wrapper markup with Fences’ lean markup (single div wrapper)"

  1. What do you think about that?
  2. Why the more external wrapper disappears?
  3. Why the label is modified from <h2> to <span> ?

Thank you very much

MXT’s picture

Status: Active » Closed (works as designed)

All the above results are by design from Fences module.

(you can create your own field templates in "Fences" mode as described in Fences project page)

So there is no conflict with adaptivetheme

MXT’s picture

Status: Closed (works as designed) » Active

ooops, I have to reopen this because there is a issue with taxonomy fields.

Applying a fences wrapper markup on taxonomy fields does not have any effect: this is completely ignored: why?

(Fences "Default classes" global configuration is setted to "Use Drupal’s default classes (field, field-name-field-NAME, field-type-TYPE, field-label-LABELTYPE, clearfix, field-item, odd, even)."

Jeff Burnz’s picture

Read #1, because AT blows away its changes in the theme. Themes always have last crack at theme functions and templates.

AT did this before Fences module was built, so changing this now is a bit problematic, it might change in a 7.x-4.x version of the theme, for now and especially for image fields I can't change this, it would break a lot of sites.

Jeff Burnz’s picture

AT did this before Fences module was built, so changing this now is a bit problematic, it might change in a 7.x-4.x version of the theme, for now and especially for image fields I can't change this, it would break a lot of sites.

Tried to edit my comment above, d.o is freaking out and not saving my comment edits.

MXT’s picture

So what do you suggest for an momentanea workaround? I have to re-implement adaptivetheme_field__taxonomy_term_reference($vars) in my subtheme template.php ?

Jeff Burnz’s picture

Yes, add the function to your template.php file and go to town.