Disclaimer

To report a problem in this issue

  1. Make sure you have tested this module with the referenced version in this issue (currently 7.x-1.x-dev).
  2. Specify the exact versions of the modules you are using for: ctools, panels, link and any other Panels related modules, such as Panelizer and Fieldable panels panes.
  3. Specify the Drupal Core version.
  4. Screenshots are optional, but greatly appreciated.

For example:

  • image_link_formatter-7.x-1.0+6-dev
  • panels-7.x-3.5+21-dev
  • ctools-7.x-1.9+4-dev
  • drupal-7.43
  • link-7.x-1.4

 

When changing the formatter in panels you do not have the option of selecting the link field of the entity. You only have options for file and content. It would be good to have the formatter available in panels.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DYdave’s picture

Category: feature » support
Status: Active » Needs review

Hi nooysters,

Thank you very much for posting this issue.

Yes, indeed.... I think this is an issue for the current stable version 7.x-1.0.
(To be honest, I'm still trying to squeeze in the simpletests for the module before tagging a new release 7.x-1.1.... I really need to move faster on this, because the dev branch already has many important patches)

Could you please try upgrading to 7.x-1.x-dev and try testing again?

I would greatly appreciate to have your feedback on this issue, since I have recently committed a patch related to that, see #1932184-5: Views integration and perhaps #2017407: Error in formatter style form might very well be related as well.

Feel free to let me know if you would encounter any further issues with this feature, I would certainly be glad to provide more information or look at this issue in more details.

Thanks very much to everyone in advance for your testing, reviews, comments and feedback.
Cheers!

Alaa Rihan2’s picture

The issue is not resolved in 7.x-1.x-dev ...

DYdave’s picture

Hi adamsultan7,

Thanks for your feedback, testing and follow-up on this issue.

So I did a quick test again with Panels, Image Link Formatter (dev version from 2013-Jul-12, at revision 034d6db) and ctools Page Manager, to override a custom content type node template with Panels and didn't encounter any issues to configure or display the node.

Please find attached the screenshots, resulting from these tests:

  1. Created a node page template variant at: admin/structure/pages/edit/node_view and selected to display the image field from the node type Page in a Pane:
    20130805DO_image_link_formatter_panels_page_override_rev1.jpg
     
  2. Formatter settings in the Page template variant Panel Pane configuration, select the Image Link Formatter:
    20130805DO_image_link_formatter_panels_page_override_rev2.jpg
     
  3. Click continue to proceed with further configuration of the image link formatter display settings:
    20130805DO_image_link_formatter_panels_page_override_rev3.jpg
     
  4. Example of display of a node with the saved settings:
    20130805DO_image_link_formatter_panels_page_override_rev4.jpg
    the field displays as expected in the pane added through the Page template variant customization.

 

If you still encounter any issues with this ticket, could you please provide much more information than you did?
For example: URLs of the pages where the problem would occur, complete testing scenario to reproduce your issue, modules versions, Drupal Core version, screenshots would help greatly as well, etc...

Feel free to let me know if you would encounter any further issues with this feature, I would certainly be glad to provide more information or look at this issue in more details.

Thanks very much to everyone in advance for your testing, reviews, comments and feedback.
Cheers!

Alaa Rihan2’s picture

when I use panelizer & fieldable panels panes it doesn't working.

I'll do some tests and feedback again.

but please test it with panelizer & fieldable panels panes.

nikkwong’s picture

Issue summary: View changes

Has this been fixed? specifically as it relates to panels user profile fields

slcp’s picture

FYI, the dev version fixes this issue for use in panelizer as far as my use case goes.

lightning_cal’s picture

Link field attributes not working in Panels

I'm having two issues after setting the "Image Linked to:" dropdown in Panels to link the image to a Link field on my node type.

1) My Image is linked to a Link field with a value set to a token [site:url] but it gets rendered as "/%5Bsite%3Aurl%5D" when I view source on the page in my browser. On my Link field settings I've checked the box to "Allow user-entered tokens"

2) the Link Target value is not being rendered as an attribute on the link. On my Link field settings I've clicked the checkbox next to "Open Link in New Window" so I was expecting a target=_blank in my link but its not there.

(I'm using the latest dev version that was referenced in this thread)

markabur’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Category: Support request » Bug report
FileSize
814 bytes

Tried the latest dev and it works for me, except I was seeing a similar issue to #7.2 above. In my case I had the link field Link Target option set to the default, and was getting "target='default'" in the html.

The function _link_sanitize() in Link module processes tokens and strips out the target when it's set to 'default', but it's not firing. Normally it's called by link_field_prepare_view():

/**
 * Implements hook_field_prepare_view().
 */
function link_field_prepare_view($entity_type, $entities, $field, $instances, $langcode, &$items) {
  foreach ($items as $entity_id => $entity_items) {
    foreach ($entity_items as $delta => $value) {
      _link_sanitize($items[$entity_id][$delta], $delta, $field, $instances[$entity_id], $entities[$entity_id]);
    }
  }
}

For some reason that hook is not getting called. Unfortunately I don't know why that would be, but here is a patch for image_link_formatter.module that works around the issue by calling _link_sanitize() directly.

+        // Call _link_sanitize() in order to process link attributes and tokens.
+        $link_instance = field_info_instance('node', $image_link, $entity->type);
+        _link_sanitize($link_values[$delta], $delta, $field, $link_instance, $entity);
osopolar’s picture

Just to suggest a workaround if the linking is not working: With the Clean Markup module together with the patch from #2529216: Add hyperlink to wrapper elements and context keywords you can link to whatever you want.

DYdave’s picture

Hi guys!

Thanks a LOT for following-up on this issue and I sincerely apologize for the delay of this reply.

Before getting to my test results, I would like to say something very important for this ticket (see issue summary):
If we would like to get closer to fixing this issue, we're going to have to be VERY specific with the VERSIONS of the modules related with this problem.

As the ticket references it, please ALWAYS test this issue with the referenced version, which is currently: 7.x-1.x-dev.

Also, please be VERY explicit on whether you are using any Panels related modules such as: Panelizer and Fieldable panels panes

Alright so I have tested again today with:

  • image_link_formatter-7.x-1.0+6-dev
  • panels-7.x-3.5+21-dev
  • ctools-7.x-1.9+4-dev
  • drupal-7.43
  • link-7.x-1.4

and it seemed to "kind of work". I just did a very basic test, to see if the formatter could be selected and if the related link field could be configured and displayed properly.
This seemed to work.
Now, going back to #8, I have no idea whether Link's attributes would be displayed properly, such as additional CSS classes, target, etc....

What I know for sure is that the Display Settings (Skip the first, display at most, reverse) are all undergoing a lot of changes at the moment...
Screenshot of the Entity Field Pane formatter settings form with advanced display settings: offset, limit and reversed:

So I have been doing some more tests without Image Link Formatter and found out that mostly these issues are due to panels and ctools.
A quick search in each module's tracker yielded a few interesting result, probably worth mentioning:

and probably more.... this all looks like a rather complicated and difficult problem....
So many different modules rely and interract with ctools... moving a piece here or there might end up breaking who knows what somewhere ...
That's why user testing and reporting is essential.

Therefore, so far, there's really not much we could do in Image Link Formatter....

I'm attaching to this comment a patch (mostly for myself), as this is something I wrote like 2 years ago.... so I really couldn't imagine this code could still work with the current versions of the panels/ctools modules.
(attached patch against image_link_formatter-7.x-1.x-dev at 74cfdb2, implementing Panels advanced field display settings, for image_link_formatter: image_link_formatter-panels-display-settings-2045133-10.patch)

Mostly, I would recommend users to keep reporting their issues with Panels in this ticket, keep checking whether the Link/Image markup displays properly (problem from #8), testing Panels display settings, etc...

Until the ctools/panels side stabilizes a bit and resolves most of these issues, I'm afraid we won't be able to fix any of these problems in this module and you will have to try to either:

  • debug/fix them yourselves, such as in #8.
  • not use this module with Panels, unless your requirements are very simple/basic.
  • look for potential patches in ctools/panels.

Feel free to keep reporting the problems encountered with this module in this issue, it would definitely be very helpful to all users.
Please don't forget to specify versions as this problem is very version dependent.

Please let me know if you would have any further questions, objections, concerns, or issues on this ticket or the module in general, I would surely be glad to provide more information or explain in more details.

Once again, thanks very much to everybody for testing, reporting and suggesting various solutions.
Surely to be continued......