Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
For now, the body field of our product content types is "Long text with summary".
Issue :
- When the summary is filled, the main body is not displayed on the product page.
- The main body is not entirely displayed on the product page.
On the product page, we want the body to be trimmed to a maximum length, and display a "read more" option which will display the end of the body.
The solution might be to set the body field to "Long text" and display the entire body field when clicking on "read more".
Comments
Comment #1
HazaPatch for that have been commited for review https://code.drupalcommerce.org/48
Comment #2
HazaIt has been merged.
Comment #4
michfuer CreditAttribution: michfuer commentedThere's a problem with Features that arises from changing the type of the 'body' field. Now if you try to install a Feature that creates a content type there's a high chance of a field type collision since most people will be developing their features with a standard Drupal install (instead of Commerce Kickstart), and the default 'body' type is 'text_with_summary'. Is there any reason why the field name couldn't be adjusted to avoid collisions?
Comment #5
RKS CreditAttribution: RKS commentedHow do you remove the "Read More" link? I have yet to even hear of anyone asking for this and yet here it is. Every paragraph in my product description is trimmed with a read more after. I haven't come across any sites that trim their product descriptions and I want mine to have a full description and not a lot of Read More links floating around.
How do you change this and display just full descriptions on the product pages? Thanks.
Comment #6
capnjav CreditAttribution: capnjav commentedAnd somehow I'm experiencing the opposite as RKS. I can't seem to turn on the "Read More" link in the product display similar to what is seen on the demo.
Comment #7
advix CreditAttribution: advix commentedI believe the missing Read More link is related to this issue: http://drupal.org/node/1803732 - Missing wrappers for new fields.
Comment #8
bojanz CreditAttribution: bojanz commentedWorking on this.
Comment #9
DSquaredB CreditAttribution: DSquaredB commentedtag
Comment #10
jjclint CreditAttribution: jjclint commentedNeed a patch for this asap, shame cause I really wanted to use the kickstart distro. for this project.
Comment #11
fhdrupal CreditAttribution: fhdrupal commentedHow can I revert body field to "Long text and summary" type?
Comment #12
silkogelman CreditAttribution: silkogelman commentedWill this be changed to 'Long text' or 'Long text and summary' ?
Comment #13
silkogelman CreditAttribution: silkogelman commentedrelated to this:
Blog summaries are not saved, therefore unusable as Meta Tag meta descriptions (or og:descriptions), and currently unusable as descriptions for the items on Blog category pages.
Comment #14
vasikehere is patch that should revert body field to text with summary type:
- correct the field type in instalation
- rebuild of body field features
- adapt the migration field mapping
- update script that forces this change in the DB + revert features
Comment #15
jsacksick CreditAttribution: jsacksick commentedWe shouldn't do that, this will revert unwanted features, we should either revert specific features and only the field component or not revert them at all.
We should also update the formatter settings of the body field for the teaser view mode and use (Summary or trimmed) instead of default.
Comment #16
jsacksick CreditAttribution: jsacksick commentedYou also need to update commerce_kickstart_product_ui.js.
The expander is broken with that change (The read more/read less) on the product display page.
$('.node-product-type .field-name-body .field-item').expander() to $('.node-product-type .field-name-body').expander();
Comment #17
vasikehere is a new patch with solutions for #15 & #16 included.
@jsacksick : thanks for support
Comment #18
jsacksick CreditAttribution: jsacksick commentedI committed a slightly different patch, I don't use the div fences wrapper in order to keep the default drupal field markup for the body. Thanks to that we no longer need to update the js.
The attached path is the one that I've committed, thanks for the good job vasike!
Comment #19
jsacksick CreditAttribution: jsacksick commentedSame patch with small modifications on the blog feature.
Comment #20
Drupa1ish CreditAttribution: Drupa1ish commentedAfter running update with function commerce_kickstart_update_7216, I get PHP Fatal error: Call to undefined function commerce_product_reference_node_types() /profiles/commerce_kickstart/modules/commerce_kickstart/commerce_kickstart_product_ui/commerce_kickstart_product_ui.module on line 71
Comment #21
jsacksick CreditAttribution: jsacksick commentedThat would mean your commerce_product_reference_module is disabled, this update doesn't disable it.
Comment #22
Drupa1ish CreditAttribution: Drupa1ish commentedLast night, the last commit wasn't available in the main package http://ftp.drupal.org/files/projects/commerce_kickstart-7.x-2.x-dev-core....
So I took it from git clone --branch 7.x-2.x http://git.drupal.org/project/commerce_kickstart.git.
This was the cause of errors. After upgrading with main package today works as designed.
Thanks!
Comment #24
Staler75 CreditAttribution: Staler75 commentedis there a way to get the "read more" option on product display in standard commerce (without kickstart) ?
Comment #25
Atec Zhou CreditAttribution: Atec Zhou commentedIf I input Chinese/Japanese text, it won't work. "read more" link won't be displayed. Maybe issue on checking text length?