3

In view I call the field field_store_car_model

settings of this field:

formatter: link result URL is:veyron-164

So far as expected.


But I need this URL: vehicles/veyron-164. Because of this I have to rewrite the link.

I check rewrite result, format is plain text, I write in the field vehicle/[field_store_car_model]

Result here: vehicles/veyron-16.4.

Now I have this punctuation in the URL! where does the decimal point come from? From my vocab because view grabs the term BEFORE pathauto cleans it up.

So how can I get rid of the decimal point? I am sure there is some PHP but WHERE I have to put the PHP code?

Any ideas?

0

1 Answer 1

-1

I'm not sure I completely understand your question. But I'm guessing this is what you're looking for.

  • In Views, under FIELDS, click on the name of your field
  • Click on REWRITE RESULTS
  • Enable Output this field as a link
  • In Link path, insert something like vehicles/[field_store_car_model], where [field_store_car_model] is one of the available Replacement patterns.

Hope this helps.

8
  • hello Bisonbleu, i have rewritten my question, hopefully you undestand it now the right way. maybe an idea? kind regards
    – clayevans
    Commented Mar 30, 2013 at 9:25
  • Oh, I understand now. Although it's never a good idea to store php in the DB, you could try with the Views PHP module.
    – Bisonbleu
    Commented Mar 30, 2013 at 12:50
  • hi! yes i came across this module and i am aware of not to store php in the database. therefor i googling how to use the views api. any hints in this direction?
    – clayevans
    Commented Mar 30, 2013 at 13:12
  • Another idea. You could add a field to your taxonomy vocab called 'no dot name' into which you would insert 'veyron-164'. Then in views, use that field's replacement pattern in the Rewrite result.
    – Bisonbleu
    Commented Mar 30, 2013 at 13:20
  • *hehe yea this came also to my mind. i wont do it because, i dont like the idea to do work twice. one field for the display name and one field for the internal handling. i try a solution that modifies the data before the view is rendered or something.
    – clayevans
    Commented Mar 30, 2013 at 13:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.