SPDisplayRelatedInfo supporting hyperlinks

Coordinator
May 6, 2011 at 5:10 PM

From mooters in the Issue Tracker:

Hi, great site by the way - perfect for a 'non-developer' like me.

I'm using SPDisplayRelatedInfo to display columns related to a listform field dropdown in a custom Newform.aspx - I'm using WSS. I want to display a description and icon (linked to a document template) but I'm making do with displaying the icon and the document URL column seperately

I'm having a bit of trouble getting the function to return formatted hyperlinks. my related list has description, icon and URL hyperlink columns - linked on the title. The function is working and returning these fields; the Icon column (basically a url to an image folder in the site) is returning the icon but the hyperlink is being retuned as text with the mask test appearing after a comma.

Can SPDisplayRelatedInfo support hyperlinks or can I somehow embed some html to show the ican linking to the doc or a working hyperlink? attached is a snippet of my code for the CEWP and a screenshot of the form and relatedinfo list.
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="http://[mysite]/System/Resources/jquery.SPServices-0.6.1.js"></script>
 
<script language="javascript" type="text/javascript">
$(document).ready(function(){
$().SPServices.SPDisplayRelatedInfo({
            columnName: "QTCognos",
            relatedList: "RelatedInfo",
            relatedListColumn: "QTCognos",
            relatedColumns: ["Description","Icon","URL"],
            displayFormat: "table",
            headerCSSClass: "ms-hidden",
            debug: true
            });
});
</script>
Coordinator
May 6, 2011 at 5:21 PM

mooters:

Glad you like the site!

SPDisplayRelatedInfo ought to format the URL correctly for you, so there must be something amiss somehow. I've checked the code and it ought to work fine, and I also tested it in my environment and got the expected results. Are you sure that the "URL" column is of type "Hyperlink or Picture"?

M.

Coordinator
May 9, 2011 at 2:24 PM

If you want the link to be on the icon rather than the text hyperlink, you can do some post processing in completefunc. Whatever code you add there will be called after the related info is displayed.

M.

May 11, 2011 at 5:12 PM

Thanks again M.

One further hurdle I've found. SPDisplayRelatedInfo works great when I'm logged in as site owner but the relatedinfo does not appear if I log in as a test user account (with basic permissions). Are there minimum permission requirements on the item list, related list, code library folder or on the whole site for SPDisplayRelatedInfo? Generally the test users (my customers) have only read or contribute permissions for more content on the site. As far as I can tell there is difference (other than permissions) between the site owner group and the customer group.

Coordinator
May 11, 2011 at 5:56 PM

Your users need to have the same permissions they would need if they needed to access the content through the UI. In other words, they must be able to read the items you expect to display. This includes any scripts, CSS, and list items involved in the process.

M.

Feb 22, 2013 at 6:49 PM
Hi all.

I receive the same issue using a hyperlink, part of the URL & the Text shows up as follows:

+ontario&hl=en&ll=45.249996,-76.766667&spn=0.022811,0.055575&sll=45.454545,-75.6945677&sspn=5.812056,14.227295&hnear=Somewhere,+Renfrew+County,+Somewhere&t=m&z=15, Somewhere

and my script

$().SPServices.SPDisplayRelatedInfo({
           columnName: "City", 
           relatedList: "{251864CB-6094-4695-8C1B-F0FD6B77CC0B}",
           relatedListColumn: "Title",
           relatedColumns: ["Title", "Latitude", "Longitude", "Map", "Note"],
           displayFormat: "list", 
           debug: true
});

The "Map" site column is just a simple hyperlink field.

Tx

Carl
Coordinator
Feb 22, 2013 at 7:53 PM
Carl:

Can you give me the full text of the Hyperlink or Picture column in this case? I've never been able to reproduce an issue here. If you are comfortable doing so, you could send me the list saved as a template at marc [.] anderson [@] sympraxisconsulting [[dot]] com.

M.
Feb 25, 2013 at 5:12 PM
Hi Marc. I can probably be a lot more succinct than that now. I solved the issue.

Originally the Map field was named Google Map which gave me the error. Each time I removed that field the info would show as expected. I then deleted the field and created a new one called Map then presto, it works as expected now. It must have something to do with the way spaces are handled, and I tried three methods of inlcuding the space such as: %20 etc.

CW
Coordinator
Feb 26, 2013 at 8:20 PM