4
votes

I'm working in SharePoint 2010, and creating an item in an "Announcement" type list. What I want to do is insert a link with a query in it:

https://www.yammer.com/company-name.com/#/threads/inGroup?type=in_group&feedId=1234567

I'm using the built-in SharePoint HTML editor to edit my text, and I inserted the link naively as:

<a href="https://www.yammer.com/company-name.com/#/threads/inGroup?type=in_group&feedId=1234567"> Yammer group </a>

However, when I exit the HTML editor, SharePoint automatically changes the code. The ampersand, used to separate the query arguments, gets replaced by %26, and as a consequence the link doesn't work as intended.

I've tried a number of workarounds for the "&" symbol, but SharePoint always substitutes in a way that makes the link useless (in IE9 at least):

& --> %26
&amp; --> %26
&#38; --> %26
\x26 --> %5cx26

Working with webparts, e.g. a content editor webpart, is not an option (the body of the list entries is HTML only).

How do I get the link to be passed/displayed correctly? I'm grateful for any ideas!

Thanks in advance, Ben

2

2 Answers

1
votes

I came up finding the same issue and it looks like that the ampersand (&) sign appearing after the hash (#) sign is what makes SharePoint encode it. As a Google search returned this post, I am replying it even if this was an old question.

I also found that not using "type=in_group" in the Yammer URL seemed to work fine. With only one argument left (feedID), there is no need for an ampersand and this may be a workaround.

0
votes

If I understood you correctly, you are trying to write HTML directly in the text box which results in some of your symbols being escaped.

If you want to insert a link there is a hyperlink button which you can use and you wouldn't need to write the HTML markup yourself.