I'm not sure if this is a support request because I can't figure out how to do it, or a feature request because it can't be done...
I was wondering if it were possible to display a list of all the places where an atom is used. It seems to me that this would be a useful feature.
I couldn't find any such list in my test installation, so then I thought maybe a View could be created to do this - however, it is not possible to add a relationship to anything other than another atom so apparently not.
Any ideas?

Comments

nagy.balint’s picture

You can try this module: https://www.drupal.org/project/scald_index

In a nutshell:
The mee module keeps track of atoms inserted into wysiwyg fields. And atom reference fields have a list of atoms in them of course. So a list can be created using the database table mee maintains and by checking the atom reference field contents.

gifad’s picture

Status: Active » Needs review
StatusFileSize
new3.68 KB

scald_index module may be overkill, when the mee_ressource table contains needed relations.
included patch provides definition of the mee_resource table, and entity/node/revisions relations

nagy.balint’s picture

@gifad, but only for atoms inserted in wysiwygs, not in atom references.

Though granted this could be a useful addition nevertheless. Will check it later.

gifad’s picture

@nagy.balint : you can build views which shows both embedded atoms (via this patch) and atom references (via the bundle field)

Fields
(node) Content: Nid (Nid)
(node) Content revision: Vid (Vid)
Atoms: Atom Id (Id)
(atom) Atom: Type (Type)
(atom) Atom: Representation (Representation)
(node) Content: Title (Title)
Atoms: Embedding field (Field)
Atoms: Caption (Caption)
(node) Content: Reference Image (Reference Image)

...

Relationships
Atoms: Atom Id
Atoms: Content Id
Atoms: Content Revision Id

nagy.balint’s picture

Checking this definition:

  $data['mee_resource']['copyright'] = array(
+    'title' => t('Caption'),
+    'help' => t('Atom caption.'),
+    'field' => array(
+    //'handler' => 'views_handler_field',
+      'handler' => 'views_handler_field_markup',
+      'format' => 'full_html', // filtered_html, plain_text etc.
+    ),
+  );

I think that currently the copyright cannot be full_html, cause this is the caption text field from the old plugin or i guess maybe the caption editable in the new plugin?
The value comes from _mee_process_item_value()

gifad’s picture

I wish I would specify the markup rendering in the view itself (rewrite results ?), but I could not...
(need to apply the filter applied to the textarea where the atom is embedded)
So this is the only way I found to prevent views from showing the plain html markup, which would make the column unreadable.

nagy.balint’s picture

StatusFileSize
new3.58 KB

Reviewed the patch, works fine.

However I've done a little cleanup, and also changed the group name to "Resource Manager"

Mainly because if you relate to an atom, you will already have a group called "Atoms", and then i think its a lot better if this new group is separated from the entries you get in Atoms.

Also actually the resource manager can be disabled in a field, and so its not always the case that all fields are tracked.

And it is called Resource Manager in the mee module, so maybe this is what describes it best. The items tracked by the resource manager.

  • nagy.balint committed de990b1 on 7.x-1.x authored by gifad
    Issue #2475241 by gifad, nagy.balint, martin.knapp: Is it possible to...
nagy.balint’s picture

Version: 7.x-1.3 » 7.x-1.x-dev
Status: Needs review » Fixed

Thanks, committed.

martin.knapp’s picture

@nagy.balint - excuse me but I am confused: #5 suggests that there is a patch which provides a Views relationship to the bundles (entities?) in which an Atom is used, but I cannot find this anywhere.
What would be really nice would be to have the list of atoms show a column indicating how many times each atom is referenced, then clicking on the numbers references would kick off another view showing all the entities referencing the atom in question. I don't mind trying to build something like this (and contributing it of course) but is it even possible (ie do the relationships exist?)

nagy.balint’s picture

Not easy since the mee_resource table only contains the atoms used in wysiwygs where the mee resource manager is enabled.

So in case of atom reference fields, that data has to be queried separately.
(and there might be the case when panelizer is used and we embed atoms in a custom content pane, then we wont be able to track the atoms at all.)

So while that would be nice, i dont see an easy way of doing it.

The patch in this issue only provided views integration to the mee_resource table.

You can try the scald index module as well, maybe that one gives a better solution for more advanced cases. Or you can ask them about it as well.

martin.knapp’s picture

I've looked at scald_index and it does indeed seem to provide a solution. The View by default is not very attractive (no aggregation of atoms so that any atom used more than once is simply repeated in a tabular list, for example), however it also provides a relationship which can then be used in Views, and I see that the "scald_index" table has successfully included atoms that live both as Atom fields in content types, and embedded in text fields.
My concern is that it is used by very few sites, and the support for it does not seem very reactive support-wise - why not just incorporate Scald Index into Scald?

nagy.balint’s picture

Its not an easy question.

Note, that many of the modules are developed by volunteers in their free time (or for a specific project after which it looses focus). So it is quite possible that a maintainer would not have time to respond for a period.

The site usage of scald_index does not seem to be that low to me (usually its a good measure to check if you have several competing modules, but in this case its the only module for the purpose), and the last commit was 4 months ago, which is not too bad.

Status: Fixed » Closed (fixed)

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

PascalT’s picture

We are the maintainers of Scald index and would be happy to discuss / optimize the module.
Just continue the discussion here or in the issue queue of the module

si.mon’s picture

As stated above by PascalT, this discussion could be moved to the issue queue of scald_index as we'd be happy to enhance the module.