Hello, I have a fairly simple thing here: the purpose is to have a textfield linked to its content (for example people can choose to write "read more.." or "sign up" in the textfield when creating a node but it is only used for the name of a link below the content teaser to go to the node).

Now in views:
- when I add the field and click "Rewrite results" I can "Output this field as a link" but I cannot select "link to content" (as with an image field). Then I tried adding a field "Content: Link" from views it gave only the link "view" which is the label of Content: link.

- Then I tried the other way around: adding a "Content: Link" and trying to change the "Text to display" but this doesn't accept replacement patterns...

- Now ofcourse the easy way for someone who knows views is to solve this by adding the "Content: title" - which has an option link to piece of content - and then rewriting the field using my textfield.

But this makes no sense to people who don't know views!


So my opinion would be to do one of the following things:
- add an option "link to own piece of content" under "Rewrite results > Output this field as a link".
- make the label of the "Content: Link" accept replacement patterns so that people can add other fields.

Comments

dawehner’s picture

Status: Active » Fixed

First step: Add a node: nid field which is hidden.
Second step add the field you want to link
Third step. configure and "output this field as link" and use node/[nid] as path. That's it.

Status: Fixed » Closed (fixed)

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

hexabinaer’s picture

Component: Miscellaneous » User interface
Category: bug » feature
Status: Closed (fixed) » Active

Sorry for reopening, but I think Wappie08's suggestion would be a great usability enhancement. dereine, thanks for your solution, too - but I guess you wouldn't want intermediate site-builders all go searching for a solution in the issue queue ...

The reason I think this option will be more and more looked for: obviously we'll have to build more and more sites suitable for handhelds. Why have our users tip-targeting on the title if we could offer links to "original piece on content" on every teaser element? Body summary text would offer a much larger target for this.

dawehner’s picture

At least it would be somehow possible because there is the function entiy_uri which would allow to link to anykind of stuff.

meichr’s picture

Version: 7.x-3.0-rc1 » 7.x-3.2

Hi,
first, besides MerlinofChaos and others fundamental work I want to thank dereine to have stepped in to help with Views support and updates and thus providing a very well felt response time for this important module.

I also had a use case where to link from a text field to the content.

First, I found the Views field (handler) "Content: Path" which provides the path alias as a simple text string. I could then rewrite the text field to link to the path alias provided by a hidden "Content: Path" field and thus to the content via this detour. Bye the way. this Views field outputs the path with a preceding "/", thus needing "Use absolute path" to be set, to work around the problem, that the created [path] token can't be properly used for rewriting another text field otherwise. But that's another issue.

So, secondly I found the "Content: Link" Views field and thought to use this similarly to link directly to the "node/[nid]" content path. But, this one didn't allow me to rewrite (the same problem as the thread creator had) to the path, only to the title text "view" of the views field as it happened to Wappie08.

So, wouldn't it be an easy solution to provide a "Content: node path" views field with only the text of the path, but not the link html around it? At least the intermediate Drupal Views user (knowing about rewriting a views field) would find a solution without looking into the issues.
Just a thought.

Otherwise, I also like the suggestion of Wappie08 best, as it provides the best usability for the case.

And, of course, I use dereine's suggested solution as a work around.

dawehner’s picture

first, besides MerlinofChaos and others fundamental work I want to thank dereine to have stepped in to help with Views support and updates and thus providing a very well felt response time for this important module.

Thanks!

You have summarized the problem good: content: path just returns the content of url(), so this doesn't really help for output this field as link.

I think you can achieve everything by using some kind of combination of multiple fields.

* One hidden nid field
* One field which has the actual content you want to show
On this field use "node/[nid]" as path in "output this field as link" and you have what you want.

About the feature request: We could add a small check in the content: path field which basically removes the base_path() from the front of the url.

meichr’s picture

Thanks, dereine. I'll use the described node/[nid] solution.

Also, adding the check to the path Views field to remove the absolute base path is a very nice usability improvement in my opinion.

dawehner’s picture

Title: Link textfield to content » Add a option to content: path to not include the base_path
Category: feature » task
Issue tags: +Novice

I actually fear that adding this option wouldn't really help, because if people don't know the node/[nid] problem they might not see the remove base_path() checkbox, which will not be active by default.

jedihe’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

Talked to @dawehner on IRC about this, given that #1 addresses this use-case, this won't be implemented.