For newly created fields (body, text, any field...) there are missing wrapper

s. I mean those with classes "field-items" and its nested "field-item even". The fences module is set to default. Is this a bug for all or just me?

Comments

advix’s picture

Missing divs breaks the "Read more | Read less" function.

capnjav’s picture

Thanks for the advice on the likely root of my problem with missing "Read More/Read Less" links from here: http://drupal.org/node/1660968

How do we add the wrappers or make them available? field-items and field-item are definitely not available for me either.

Body for my custom product type I have it set to: "division -- < div > -- Generic container; only use as last resort"

Which is what the Body for example "Tops" is set to. (Mind you Tops doesn't display the "Read More/Less" either).

advix’s picture

Didn't yet figured out how to solve this. Hope somebody can help.

advix’s picture

So. With Fences module disabled the missing divs are back. As quick fix OK, I don't know what will cause the disabled module in the future. Make sure, your text in body contains "p" tag and choose a text format Filtred HTML to make it work.

To solve this issue correctly, the javascript function Drupal.behaviors.bodyReadMore needs to be modified. From $('.field-name-body .field-item p') to $('.field-name-body p') hence you can turn on the fences module.

uking’s picture

I have had the same behavoir (no readmore readless button in custom products) in the 7.x-2.0 version. With the modification in the javascript function Drupal.behaviors.bodyReadMore from $('.node-product-type .field-name-body .field-item') to $('.field-name-body p') and a text format Filtred HTML it works fine.

Many Thanks to "advix" for the fix.

fhdrupal’s picture

What is the path to this JavaScript file?

vaccinemedia’s picture

modules/commerce_kickstart/commerce_kickstart_product_ui/commerce_kickstart_product_ui.js

realskorpion’s picture

Hi

I'm having a similar issue when I create a new variation type in drupal commerce kickstart 2
http://www.drupalcommerce.org/discussions/7042/issue-styledisplay-new-va...

Is that related to missing wrappers for fields?

Thanks,
Oscar R

vaccinemedia’s picture

Exactly! You can either disable the fences module or remove the "field-item" selector from the jquery file mentioned above

realskorpion’s picture

Hi,

Oh my god this works.
If I remove the "field-item" from the jquery file then the issue with the read more/read less is solved.
But that didn't solve the issues in the shopping cart (color label and color name shown in different lines)
But if I disabled the fences module everything works fine.

Thanks a lot

jsacksick’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

macman911’s picture

Hi,

I've added a description field to a variation type, however I can't get the read more/less button to work. I've changed $('.field-name-body p'). to $('.field-name-NEW_FIELD_NAME p'). but that doesn't work. Any thoughts? Thanks