alter title path in views (that contain fractions)

Events happening in the community are now at Drupal community events on www.drupal.org.
Anonymous's picture

Okay, can anyone help with this one?

I created a view, am using the title as a field, outputting this field as a link.

Problem is the title names contain fractions (i.e., 1/2, 1/4, etc.) so, the link uses the slash in the url and thus can't find my title that contain fractions.

Using Drupal 7.

Thanks,

Katie

Comments

Strips Slashes

whthat's picture

I believe Drupal will strip slashes found in titles so "1/2" would be "12" if you added as a node title.

Test above, but you might also try "%2F" where the slash should like "1%2F2" for "1/2" to locate the node atleast.

Going forward you might try rewriting the fractions to dashes or something else. Slashes can get troublesome to use in url's because they are a delimiter typically.

field: path

theitgirl's picture

Thanks @whthat.

I think I solved it.

I added a field: path, "Rewrite the output of this field" to [title] and "output this field as a link" to [path]. And, now I am re-aliasing my titles to remove "content/".

Ya, not my choice to have "/"s in titles...I'm using my client's existing data. It's been fugly.

same problem

Loter's picture

How did you solved the problem of fractions in Contextual Filter?

same problem

theitgirl's picture

@loter: unfortunately i ended up swapping all the "/"s to "|"...

stupiddingo's picture

For example ¼ works in a linked title. Tested in D7.

....

Loter's picture

I use custom fields.. that's a big problem.. I have something like
asdasd_4/5/6 in contextual filter.. :(

Boise

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: