Hi,

Thanks for this great module. Sorry in advance for my bad english.

I would like to talk about a problem in Scald module : it doesn't work with Display Suite or Field group for example. Scald doesn't respect the configuration of display's scald bundles except the order of fields.

Tested module : FieldGroup 7.x-1.3

Example : After to have activate the full display for Image Atom, when we go to admin/structure/scald/image/display/full for example, we can create some field groups ... But when an atom is displayed in full mode, groups don't appear.

Thank in advance for your answers.

Comments

NiRaDo’s picture

Title: Display suite or Field Group configuration doesn't work in scald entity » Display suite or Field Group configuration doesn't work in scald entities
davidhk’s picture

Do you see the changes if you clear Drupal's cache (admin/config/development/performance)

I'm currently testing Scald, and used Display Suite to make some changes to the layout of an Atom. I found that Scald caches the Atom's display, so it didn't show changes made in Display Suite, or any changes to Display Suite fields.

My temporary workaround is to disable Scald's caching by selecting the 'Always rebuild rendered content' option at admin/config/content/scald

NiRaDo’s picture

Hi davidhk. Thanks for your answer.

I have tested what have you said on simplytest.me with last versions of scald and field group. It doesn't work.

fxfx’s picture

having same problem doesnt work with display suite nor with panels layouts

fxfx’s picture

any update on this?

jcisio’s picture

Title: Display suite or Field Group configuration doesn't work in scald entities » Support Display suite and Field Group
Version: 7.x-1.1 » 7.x-1.x-dev
Category: Bug report » Feature request
jussil’s picture

StatusFileSize
new2.71 KB

Hello, our team also stumbled upon this issue. We really felt that current scald atom render pipeline is lacking in terms of altering and options how to do the actual output. As we are using Display Suite for content itself, we wanted to use it for scald atoms, as the display part configuring is already working with DS just fine (or with little hiccups).

We went through what DS needs in order to be used in entity rendering and borrowed code and style from node. DS implements hook_theme_registry_alter that adds DS specific variables for entities. In order for DS to add these variables there must be theme that have name of entity which in this case is "scald_atom". Also when it does rendering of the scald_atom, there must be "content" so that DS can pick the content into its own regions.

What we added:

  • scald.module: New theme entry that is named "scald_atom".
  • scald.module: Default preprocess function for scald_atom that most importantly converts "elements" array into "content" array. And some other stuff that we just blindly left there as we copied the whole preprocess from node, so this might need some tuning.
  • scald-atom.tpl.php: Default template to render scald atom. Right now it just renders "content" like what scald does now, but right now we can actually have wrappers in custom templates etc.
  • includes/scald.atom.php: Made scald_atom_view to use scald_atom theme as default way of rendering atom, just like in node.

This patch works atleast for 1.3 and for dev version for now. This is somewhat tested in basic rendering from fields and when used within wysiwyg via dnd. There can be some issues with atoms being cached which is another issue, but the patch seems to solve most of the rendering needs that we have right now.

I bet that the patch wont be mergeable as it is, but should be a good starting point if you are looking for a more finely tuned control over atom rendering, just like for any other entities.

gifad’s picture

Status: Active » Needs review
jussil’s picture

StatusFileSize
new2.89 KB

Token with Display Suite requires scald_atom (entity name) in the template variables that points to actual entity (currently atom, as everywhere), so I added it. Right now there is atom and scald_atom keys pointing to same object which is not that cool I guess, but atleast Tokens work better and without bunch of notices.

nagy.balint’s picture

This is somewhat tested in basic rendering from fields and when used within wysiwyg via dnd.

As far as I understand, the problem is mainly with the view page of an atom, when the user clicks the "view" link in the dnd, and then gets to a view page where the design is currently not entirely controllable with display suite.

In wysiwyg however the complete render is done by representations, and not by fields, and therefore, not sure why the patch would have anything to do with wysiwyg.

nagy.balint’s picture

Indeed field group works fine after this patch.

There is a cache problem as indicated above, maybe after a save on the DS UI we should somehow empty the scald cache.

shiraz dindar’s picture

Super thankful for your patch, Jussil! I have my field groups back!

Incidentally, field groups in scald atoms using DS worked fine up until field groups 1.1. In version 1.2 they did a major refactor (merged in 2.x branch), and it's from that point onwards that field groups were no longer rendered for scald atoms.

I'm hoping this patch gets rolled, as, aside from the fact that it fixes fieldgroups, I agree that the "scald atom render pipeline is lacking in terms of altering and options how to do the actual output". Up until now I've actually had to hack atom_reference_field_formatter_view directly. I may be able to unhack that now this patch is in.

nagy.balint’s picture

The patch is in a good shape to get in, however we still need to solve the cache issue.

If someone can contribute the code for that, then we can get this into scald core.

Of course more testing would not hurt :)

nagy.balint’s picture

StatusFileSize
new3.21 KB

Here is a new patch that should solve the cache issue.

It will also work when the instances are updated programmatically.

  • nagy.balint committed d9d17cc on 7.x-1.x authored by jussil
    Issue #2166519 by jussil, nagy.balint: Support Display suite and Field...
nagy.balint’s picture

Status: Needs review » Fixed

Thanks, Committed.

Status: Fixed » Closed (fixed)

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