Display Link Library from subsite on Home page with CQWP RRS feed

  • Question

  • Does anyone know what the CustomViewFields are for a link libary?  I go to the link list settings and see Title (hidden), URL, Notes, Created By and Modified By.


    I'm trying to use the Content Query Web Part to view the links in the library.  They are external links.  When I try to list the links there, CQWP shows "Blank" and links to the item in the list instead of the URL.  I want to be able to show the Title of the URL and link to the actual URL and not the list item.


    I've messed around with the ItemStyle.xsl, but apparently, the URL and the Title of the URL have CustomViewFields that I can't find.  I thought the URL view field was simply URL.  Apparently not.


    Anyone have any experience with this?  I wrongly assumed that something this simple CQWP would do out of the box. 



    Friday, August 17, 2007 5:30 PM

All replies

  • <P align=left><FONT face=Arial size=2>Hi,</FONT></P>
    <P align=left>&nbsp;</P>
    <P align=left>Actually the CQWP does do this out of the box. It may seem complex to get it working at first, but after that it will be quite logical.</P>
    <P align=left>&nbsp;</P>
    <P align=left><a href="http://www.heathersolomon.com/blog/articles/CustomItemStyle.aspx">Heather Solomon has a brilliant blog post</a> on how to solve your problem. BTW, it is not CustomViewFields that you need to modify, but the CommonViewFields property. It is not stated in her post, but if you are using Sharepoint Designer, you can actually modify the CommonViewFields attribute of the CQWP instance from the page that it sits on rather than exporting it and modifying the xml that way.</P>


    Hope this helps.

    Saturday, August 18, 2007 12:13 PM
  • My mistake... CommonViewFields... I misspoke.  But, that's my problem.  I can't seem to identify the CommonViewFields for a Link Library.  I am familiar with the link you give, I used it to create a custom display of articles in one sub-site to display on our home page.  That worked fine.  But, my problem is no matter what I try I can't get the name of the Link to display (the title says "Blank" - assuming I'm pulling from a blank-field in the list - or non-existant) and the link is to the link item... not the actual link.

    Monday, August 20, 2007 2:08 PM
  • I don't know if this was the best way to do it or not, but I edited the ItemStyle.xsl and added the @URL customfieldview to the CQWP.  Works well enough for me!  Smile


        <xsl:template name="LinkList" match="Row[@Style='LinkList']" mode="itemstyle">
            <xsl:variable name="SafeLinkUrl">
                <xsl:call-template name="OuterTemplate.GetSafeLink">
                    <xsl:with-param name="UrlColumnName" select="@URL"/>
            <xsl:variable name="DisplayTitle">
                <xsl:call-template name="OuterTemplate.GetTitle">
                    <xsl:with-param name="Title" select="@URL"/>
                    <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
            <xsl:variable name="TheLink">
       <xsl:value-of select="substring-before($DisplayTitle,',')"/>
            <div id="linkitem" class="item link-item bullet">
                <xsl:call-template name="OuterTemplate.CallPresenceStatusIconTemplate"/>
                <a href="{$TheLink}" target="_blank" title="This link opens in a new window">
                <xsl:value-of select="substring-after($DisplayTitle,',')"/>
    Monday, August 20, 2007 8:27 PM
  • I'm wondering if anyone else has found a more straighforward solution to this issue?  It seems like it should jsut be a matter of getting the settings right in the Content Query Tool Part but I have not been able to solve this yet.


    Monday, October 15, 2007 8:31 PM
  • Actually the content query webpart is quite an drag to work with, i use dataviewwebpart mostly, because its more flexible in comparison to CQW, but lacks caching. Unfortuantly, afaik at some point you need to edit the XSL Indifferent

    Sunday, October 21, 2007 11:32 PM