Hello I am facing a problem with the Rewrite Result property on a text field.

I would like to make my test field a link, and format the url that way : company-search/[node:field_company_name]

I explain, I created a content type containing a company name, I would like, when I click on that field, to link to a view, where I will show many blocs concerning that company, list of the members of the company, list of the jobs proposed, description of that company... I already created that view depending the parameter into the Url and it works well, but now I am not able to create the link to go to. The system doesn't transform the [node:field_company_name] with the content of the field.

How could I do, what did I forget ?

Thank you for your precious help.

Regards.

Comments

audrey78’s picture

The good link should be company-search/[node:field_company_name:value] but system doesn't understand the token.

ral1239’s picture

I believe the Token Insert module does exactly what you want. When you configure a field, you'll see a checkbox with "Use Token Insert for this field ", which allows tokens to be used on that field.

audrey78’s picture

Thank you for your answer,

But regarding what I understood, that Token Insert allows to use tokens into a field, but what I want is to create a field Autocomplete normally and use the value of that field when I show it into a view, into the "Output this field as a link" field. That feature allows to transform any field into a link, the problem is I want that url to be dynamic and use the value of the field I transform into a link.

If somenone has another suggestion.

Thank you

ral1239’s picture

Ah sorry, I missed the part where you said in the "Output this field as a link" section.

I haven't seen a module out there for this, but if you do go the custom module route, you can use this as a reference to list tokens on the form of the view by extending views_handler_field and overriding options_form (views_handler_field::options_form), which has the ''Output this field as a link'' form element then you could use the token_replace() function in a custom tpl file for this view so it'll use that selected token when displayed.

Not sure if this helps, hopefully someone else may be able to provide some guidance.