http://drupal.org/node/1457174#comment-5658484

when you select the "replacement title" (field/title_field) instead of the "original title" (field/title), the option "Link this field to the original piece of content" in the field settings is not available (see a screenshot of the two configuration windows attached: the "original title" is on the left), and you cannot link the "replacement title" to its node.
A solution that I found is to add a "Link" field to the list of view fields after the "Title", to rewrite the output of this field with [title_field] token text, check "Output as a link" option, and to exclude the "Title" field from display.

Is it Title or Views issue?

Files: 
CommentFileSizeAuthor
#6 title-views_integration-1541414-6.patch3.42 KBpeximo
PASSED: [[SimpleTest]]: [MySQL] 186 pass(es). View
#4 title-views_integration-1541414-4.patch3.21 KBplach
PASSED: [[SimpleTest]]: [MySQL] 186 pass(es). View
#2 title-views_integration-1541414-2.patch3.25 KBpeximo
FAILED: [[SimpleTest]]: [MySQL] Invalid patch format in title-views_integration-1541414-2.patch. View

Comments

plach’s picture

Version: 7.x-1.0-alpha2 » 7.x-1.x-dev
Category: bug » feature

Is it Title or Views issue?

It's a Title issue: we need proper Views integration for this to work.

plach’s picture

Issue summary: View changes

Fixing link

peximo’s picture

Status: Active » Needs review
FileSize
3.25 KB
FAILED: [[SimpleTest]]: [MySQL] Invalid patch format in title-views_integration-1541414-2.patch. View

Hi, this patch should provide integration with Views, by providing the link between the title field and the corresponding entity. I tested the patch both with nodes and terms.

Status: Needs review » Needs work

The last submitted patch, title-views_integration-1541414-2.patch, failed testing.

plach’s picture

Status: Needs work » Needs review
FileSize
3.21 KB
PASSED: [[SimpleTest]]: [MySQL] 186 pass(es). View

Rerolled

plach’s picture

Status: Needs review » Needs work
+++ b/views/title.views.inc
@@ -0,0 +1,14 @@
+ * Replace field default handler (views_handler_field_field) ¶
+ * ¶

Missing blank line above and the trailing dot. Moreover trailing white spaces are everywhere :)

+++ b/views/title.views.inc
@@ -0,0 +1,14 @@
+  if (isset($data['field_data_title_field'])) {
+    $data['field_data_title_field']['title_field']['field']['handler'] = 'views_handler_title_field';
+  }
+  if (isset($data['field_data_name_field'])) {
+    $data['field_data_name_field']['name_field']['field']['handler'] = 'views_handler_title_field';
+  }

I think this can be made work for any entity by inspecting the 'field replacement' key in entity info.

+++ b/views/views_handler_title_field.inc
@@ -0,0 +1,50 @@
+   * Provide link to entity option

Missing trailing dot.

peximo’s picture

Status: Needs work » Needs review
FileSize
3.42 KB
PASSED: [[SimpleTest]]: [MySQL] 186 pass(es). View

Done.

plach’s picture

Status: Needs review » Reviewed & tested by the community

Great work, thanks!

plach’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed, thanks!

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

Emphasize the solution

  • Commit 9e593f8 on 7.x-1.x, workbench authored by peximo, committed by plach:
    Issue #1541414 by peximo, plach | int_ua: Added No 'Link this field to...