I have a sitewide issue: '&' is replaced by %2526 in URLs...

I create Taxonomy Term: PG&E

the taxonomy term link is: category/employer-label/pg-e

I reference this taxonomy term in my content type

I create view, add taxonomy term and output as link: company/[term]
but the outputted link is mysite.com/company/PG %2526 E

How do I get this link to be mysite.com/company/pg-e ????

Can someone explain to me what's going on? Or can you direct me to a source that I can read up on this? Does this have anything to do with Transliteration file? Can I set my settings differently in pathauto? If, for instance, I go to puncutation and remove &, or replace & with separator, nothing happens...

Comments

calefilm’s picture

My Fix:

I utilized a simple URL alias "Add Alias" technique using Pathauto. And then, to extend the technique further, I utilized Rules (Step 4)...


STEP 1:
Because I'm using a panel page, I set the context of the argument inside my panel to: Taxonomy term: ID, with an argument type: Term ID

my panel path is: company/%company-term

Next, go to the view I want to display in this panel page and set argument to Term ID, so when user types in mysite.com/company/345 the view displays in the panel page.


STEP 2:
Create Taxonomy Term:
Label: PG&E
Description: pg-e


STEP 3:
Within Automatic Alias, make sure under punctuation, "Ampersand &" is removed.
Next, go to Add aliases
Existing System Path: company/345
Path Alias: company/pg-e


IF YOU ARE CREATING MULTIPLE TERMS (Skip Step 3)

STEP 4:
Go to Rules
Add Rule: Auto Add Alias Company Term
Event: After Saving New Term

Add a condition: User has Role - Site Administrator

Add an action: Load a Term
Choose Vocabulary
Find token for "Replacement patterns for created term" ( [term:tid] )
within form box, "select by term id" enter: [term:tid]

Add an action: Create or delete an URL alias
Existing system path: company/[term:tid]
Path alias: company/[term:cat-description]




RESULT: For every Term you create and save, a URL Alias will automatically be created, converting the 'term label' to whatever 'term description' you provided, resulting in the link: yoursite.com/company/pg-e

note: When working with Auto Node Title, make sure you use 'raw' output Tokens, instead of just the name, otherwise, '&' will turn into 'amp;'

dave reid’s picture

Status: Active » Closed (works as designed)

Your original problem is a Views issue because it's creating the incorrect link to the term, not Pathauto.

calefilm’s picture

Oh I see. Thanks.