Content query webpart use a part of the URL as filter

Hey,
I have on root site in the site collection a list. Now I like to build up a site template (from which the user can create sub sites form the root site in the site collection.
In this site template I like to bring on the homepage a content query webpart. The content query webpart has to show one item from the list on the start site.
How can I configure that the content query webpart use a part of the URL as filter?
Url is like:
http://Server/SiteCollection/ID/home.aspx
The ID must be the filter criterion in the content query webpart. How can I do this?
Thanks for your help
Stefan
Viele Grüße Stefan
Kontakt unter [email protected]

Hi Stefan,
You can create your own CQWP by subclassing the default one.
Then you can override the CAML query to add criteria found in the URL.
Here is more information and sample:
http://www.andrewconnell.com/blog/archive/2008/02/18/Subclassing-the-Content-Query-Web-Part-Adding-Dynamic-Filtering.aspx
http://msmvps.com/blogs/laflour/archive/2008/05/29/subclassing-content-query-web-part-to-override-caml-query.aspx
Regards,
Ludovic Caffin

Similar Messages

  • Using Content Query webpart for specific Document library with multiple managed metadata - Document with multiple metadata tags not showing up

    Hi,
    I am having an issue where when I insert a Content Query webpart into a page, and filter to managed metadata, all the right documents show up except one document that happens to have two metadata tags attached to it.  The content query webpart is set
    to only look through a specific document library.  I'm not sure what I am doing wrong.
    Here is the one document with two metadata tags:
    Below is the Content Query:

    Hi,
    As I understand, you did not get the results with multiple metadata tags through Content Query web part in SharePoint 2013.
    Check things below:
    1. Check if you have set the item limit more than the display items in Presentation section of the web part. If the item number more than item limit, the rest items will not show.
    2. Check if the item you cannot find uses the content type you have set in the content type section of content query web part.
    When you edit the properties of the item, you will see the content type the item is using.
    Best regards
    Sara Fan
    TechNet Community Support

  • Content Query Webpart For Slider

    I'm trying to create a simple jquery slider with the help of Content Query Webpart in sharepoint 2013. Can anyone help me on this with a simple video or example like how I can achieve this.

    Hi Sreejith,
    To display the search results as a slider in Content Query web part(CQWP), we can upload the
    JQuery plugin to SharePoint and create a Custom ContentQueryMain.xsl and ItemStyle.xsl to render the results.
    Here are some examples about the detailed steps for integrating a Slider with the Content Query Web Part in the links below for your reference(same for SharePoint 2013):
    http://www.nothingbutsharepoint.com/2012/06/18/sharepoint-integrate-a-slider-with-the-content-query-web-part-part-1-what-does-my-slider-need-to-work-aspx/
    http://www.nothingbutsharepoint.com/2012/07/10/sharepoint-integrating-a-slider-with-the-content-query-web-part-part-2-setting-up-my-content-source-aspx/
    http://www.nothingbutsharepoint.com/2012/08/27/sharepoint-integrate-a-slider-with-the-content-query-web-part-part-3-integration-with-the-cqwp-aspx/
    https://www.pena.id/2014/08/adding-slider-sharepoint-using-content-query-web-part-cqwp/
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • Sharepoint 2013 Content query webpart translation "BUG"

    I want to use a CQWP form my SharePoint(online) site in order to show all links in the link webparts. The site is in the Dutch language. What I want to do is described here:
    http://www.its-on-the-internet-so-it-must-be-true.com/2013/01/sharepoint-link-list-content-query.html So in the properties of the webpart I want to do this:
    In Dutch this looks like this (image 2 in my comment):
    Link; URL [Basiskolommen];
    Title: Comments;
    The field "Comments" is ok, this is a part of the URL when I go to the properties of that field "89%7D&Field=Comments"
    When I press apply in the properties the result is fine. The webpart return the link to a external site where the description of the link is the "Comments" field (in this example "SharePoint blog") (image 3):
    However, after that, when I press save (page). This is changes: Now I see the complete URL and not the description anymore (image 4)
    When I check the properties of the webpart I see that the field "Comments" is translated.
    Now is says "Opmerkingen". I do not have any clue how to avoid this translation.
    Any suggestions?
    thanks, Mike

    Hi Mike,
    According to your description, there is an unexpected issue occur when using a Content Query Web Part to query the Link list in your online environment.
    This is what I have done in my environment: in a Dutch site, create a Link list, add a column “Comments” into it. Then insert a Content Query Web Part into a page,
    set the “Presentation” as “Title: Comments;”, apply and save the page.
    It turns out that the “Title: Comments;” stay the same without being translated.
    In the web part properties panel:
    I would suggest you create another page and Link list and make the test again to see if it is an issue of the page in use.
    Feel free to reply if there any progress.
    Thanks
    Patrick Liang
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support,
    contact [email protected]
    Patrick Liang
    TechNet Community Support

  • Custom Column Name in Webpart file and Itemstyle for Content Query WebPart

    I was trying to incorporate  a custom column in the content Query WebPart.
    The name of the column displayed in the list is "Risk Score"; a calculated column.
    I right clicked on the field in the list settings and copy hte short cut which is pasted below:
    http://<mainURL>/_layouts/FldEdit.aspx?List=%7BFE4CC761%2DE9B8%2D487C%2D8B92%2D1E42539144C4%7D&Field=Risk%5Fx0020%5FScore
    Could you please let me know what can i type in the WebPart file exported and then to be imported in the section:
    <property name="CommonViewFields" type="string"></property>
    Also, please let me know what should i enter in the itemstyle.xsl in the section
    <td style="width:30%; font-size:10px;font-family:Verdana;color:#007EB6; border-style:solid; border-width:medium;border-color:#E1E1E1;">
    <xsl:value-of select="@Risk%5Fx0020%5FScore" />
    </td>
    Tnx

    Ok.
    Use like this
    <property name="CommonViewFields" type="string">RiskStrore,Lookup</property>
    and include like this in the itemstyle
    <td >Risk store
         <xsl:value-of select="@RiskStore" />
        </td>

  • Content Query Webpart show blog post with no of comments

    Hi to All,
    I want to show blog posts using content query webpart along with no of comments to that post
    but comment column in the Posts list is lookup column so how to show no of comments using content query webpart.
    Please help me.
    Thanks,
    Rohit Warghade...

    I am not sure why, but I am getting
    The site or list column "# Comments" does not exist or is not valid.
    What could I be doing wrong?
    Thanks!

  • Content Query Webpart not getting displayed in Mobile view

    Hi,
    I am having a Content Query Webpart in my page.
    In the mobile view it is not getting displayed.
    I read that you can create mobile adapters for the control. But I didnt get how to do it for Content Query Webpart.
    Any help appreciated..

    Is deactivate "Mobile view" a option for you? if then then CQWP will work in same page. You can deactivate that feature from site feature.
    Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply.

  • In content query webpart columns are not displaying after clicking on edit webpart.

    Hi,
    I created a content query webpart. I added one custom item style in ItemStyle.xsl. This template having some date operations. Some date comparisons. The issue is, template containing some variables but after selecting my template it is not showing the variable
    names to enter the list column. What will be the issue? Below is the code..
    <xsl:template name="BirthdayList" match="Row[@Style='BirthdayList']" mode="itemstyle">
        <xsl:variable name="SafeImageUrl">
            <xsl:call-template name="OuterTemplate.GetSafeStaticUrl">
                <xsl:with-param name="UrlColumnName" select="'ImageUrl'"/>
            </xsl:call-template>
        </xsl:variable>
        <xsl:variable name="DisplayTitle">
            <xsl:call-template name="OuterTemplate.GetTitle">
                <xsl:with-param name="Title" select="@Title"/>
                <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
            </xsl:call-template>
        </xsl:variable>  
    <xsl:variable name="EmployeeDesignation">
            <xsl:value-of select="@EmployeeDesignation" />
        </xsl:variable>
        <xsl:variable name="Birthday">
            <xsl:value-of select="@Birthday" />
        </xsl:variable>
        <xsl:variable name="dateTimeBirthday" select="ddwrt:FormatDate(string($Birthday), 1033, 3)" />     
                    <xsl:variable name="dateOfBirthday"  select="substring-before(substring-after($dateTimeBirthday, ', '), ', ')"
    />
                    <xsl:variable name="monthOfBirthday" select="substring-before($dateOfBirthday, ' ')" />
                    <xsl:variable name="yearOfBirthday"   select="substring-after(substring-after($dateTimeBirthday, ', '), ',
    ')" />
                    <xsl:variable name="TodaysDateOfBirthday">
                        <xsl:value-of select="ddwrt:FormatDate(string(ddwrt:Today()), 1033,3)"/>
                    </xsl:variable>
                    <xsl:variable name="TodaysDateOfBirthdayyy"  select="substring-before(substring-after($TodaysDateOfBirthday, ',
    '), ', ')" />
                    <xsl:variable name="TodaysmonthOfBirthday" select="substring-before($TodaysDateOfBirthdayyy, ' ')" />
                    <xsl:variable name="TodaysyearOfBirthday"   select="substring-after(substring-after($TodaysDateOfBirthday,
    ', '), ', ')" />
                     <xsl:if test="($dateOfBirthday)=($TodaysDateOfBirthdayyy)">
                     <xsl:if test="($monthOfBirthday)=($TodaysmonthOfBirthday)">
         <div>
            <div>       
        </div> 
        </div> 
        <table width="100%"> 
        <tr width="100%">
                    <td width="80%">
                                    <table>
    <tr>
     <td><b><xsl:value-of select="$DisplayTitle"/></b></td>
                       </tr>
    <tr>
    <td>  <xsl:value-of select="$EmployeeDesignation"/>
    </td>
                       </tr>
                                    </table>
                    </td>
                    <td width="20%">
                                    <table>                                               
    <tr>                      
    <td valign="top">
       <img width="60" height="60" src="{$SafeImageUrl}" alt="{@ImageUrlAltText}" title="{@ImageUrlAltText}" />                                                  
     </td>       
                                    </tr>
                                    </table>
                    </td>
       </tr>
        </table>
    </xsl:if>
           </xsl:if> 
    </xsl:template>

    Hi,
    Based on your example above, which columns / variables are not appearing when editing the CQWP that you want to bind managed properties / list columns to?
    Eric Overfield - PixelMill -
    ericoverfield.com -
    @EricOverfield

  • I recently created a video in iMovie that I later uploaded to YT. I had a message from YT a day later saying that the music I used in my video was detected as 3rd party content. I used music found in the music and sound effect section. What happened?

    I recently created a video in iMovie that I later uploaded to YT. I had a message from YT a day later saying that the music I used in my video was detected as 3rd party content. I used music found in the music and sound effect section. The artist is listed as Apple Inc. What happened?
    This is the message I received:
    Your video may include the following copyrighted content:
    Disputed claims 
    "Kadeem UIM-Trust Issues (Instrumental)", sound recording administered by:INgrooves Your dispute awaiting response by 12/08/12
    What does this mean?
    After your dispute has been submitted, your video will soon be available on YouTube without ads for third parties. This is a temporary status and might change at any time.Learn more about copyright on YouTube.

    This question comes up from time to time. YouTube and Facebook are both wrong.
    There are a number of con-men who think that they can earn a quick buck from claiming that they own the copyright to Apple’s royalty-free jingles and sound effects included with the iLife applications. These are all free to use, as clearly stated in section 2.C of the iLife Software License Agreement:
    “You may use the Apple and third party audio content (“Audio Content”) contained in or otherwise included with the Apple software, on a royalty-free basis, to create your own original soundtracks for your video and audio projects. You may broadcast and/or distribute your own soundtracks that were created using the Audio Content, however, individual samples, sound sets, or audio content may not be commercially or otherwise distributed on a standalone basis, nor may they be repackaged in whole or in part as audio samples, sound files, sound effects or music beds.”
    http://images.apple.com/legal/sla/docs/ilife09.pdf
    You should this (also providing the above link) when following the dispute process with YouTube.

  • Query Tuning - using CASE statement in the WHERE clause - Duplicate Post

    Duplicate Post by mistake.
    Please check
    Query Tuning - using CASE statement in the WHERE clause
    Edited by: Chaitanya on Jun 9, 2011 2:45 AM
    Edited by: Chaitanya on Jun 9, 2011 2:46 AM

    Duplicate Post by mistake.
    Please check
    Query Tuning - using CASE statement in the WHERE clause
    Edited by: Chaitanya on Jun 9, 2011 2:45 AM
    Edited by: Chaitanya on Jun 9, 2011 2:46 AM

  • Whenever i upload my website using ftp, the site name ends up being part of the url, Can this be fixed?

    Whenever i upload my website using ftp, the site name ends up being part of the url, Can this be fixed?

    Publishing to a local folder is shown here...
    http://www.iwebformusicians.com/iWeb/Publish-Website.html
    ... and how to upload the files here....
    http://www.iwebformusicians.com/Search-Engine-Optimization/Upload.html

  • Using the URL to filter a list

    All,
    I am using the URL to filter a list, for example, FilterField1=Writer&FilterValue1=Chris%20Tobey.
    In this method, we need to provide the FilterField which is the column name. Can we do the filter for all column? For example, I would like to search all items in the list which
    contains "hello" in any column by using the URL?
    Thanks

    Hi,
    The query string in URL won’t be able to meet your requirement.
    The OOTB
    Search box for a list can be found above the list view, it can search items contains the keyword in the current list:
    http://community.office365.com/en-us/f/154/t/171565.aspx
    Or if you want to do more customization, work with
    Search API programmatically would be required:
    http://msdn.microsoft.com/en-us/library/microsoft.office.server.search.query.keywordquery.aspx
    http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2013/01/03/how-to-use-the-sharepoint-2013-search-keywordquery-class.aspx
    Here is a code demo in this thread can
    search items in a particular document library with specific keyword
    for your reference:
    http://social.technet.microsoft.com/Forums/office/en-US/41699f4b-f1a5-4449-b121-01fbb862436f/how-to-fetch-item-from-document-library-using-query-search-in-sharepoint-2010-?forum=sharepointdevelopmentprevious
    Best regards,
    Patrick
    Patrick Liang
    TechNet Community Support

  • CSS loadbalancing based on parts of the URL

    HI,
    I've to do loadbalancing based on parts of the URL.
    The URL will look like this:
    www.myserver.com/a/b/c/d/x=12345/bdc/*.htm
    If the x=<digits> is includes I've to use server1-3 1 if the x is not included I've to use server 4-6
    I can right now think of two (2) methods:
    1) url ="/x=*"
    2) using a header-field group with field "request-line" and the operator contains.
    Now my two questions:
    - Is it enough to define in method 1 only "/x=*" or do I have to write down the whole path (/a/b/c/d/x=*) or is it possible to do url="*/x=*".
    - Is there any other way to have this sort balancing done?
    - Which method is best practise?
    Thanks in advance for answering.
    Kind Regards,
    Joerg

    Hi Gilles,
    thanks for your reply.
    So both methods are possible. From my point of view method two is more flexible even if less specific. Is there any other draw back you can think of using method two, the one with the header group.
    Kind regards,
    Joerg

  • Firefox no longer displays any part of the URL that I am visiting. How do i get it to display?

    I'm referring to ANY part of the url. It just shows a blank page. Running Win XP Pro

    Is there any evidence that there is text on the location bar when you type something and try to select and copy the text (Ctrl+A and Ctrl+C)?
    Does it help if you open a new window?
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    You can check for problems caused by a corrupted localstore.rdf file.
    *http://kb.mozillazine.org/Corrupt_localstore.rdf

  • Url used to show in the url box when opening from a shortcut or email, but now it's not there. If I refresh the page it is. How do I get this back the way I like it?

    The url of the website that I'm visiting used to show in the url box when I opened from a shortcut or email. But not it's not there unless I refresh the page. I've looked and haven't found a way to set this so that it works like it used to. I liked being able to click in the address bar and copy the link, or even to look there and see where I am.

    I'm unable to check it in safe mode because the only time it happens is when I click a link and have not firefox open. For example if I would click a link in my email right now, it would open in another tab and show the address of the link I clicked. But if I didn't not have this window open and clicked alink, it would open a new window and I wouldn't be able to see the url.
    Here's a screen shot.
    [http://chibitude.com/gallery/albums/userpics/10001/firefoxSSForAddressProblem.jpg firefoxSSForAddressProblem.jpg]

Maybe you are looking for

  • Help needed with Sun Java Studio Creator and EJB in a Portlet Project

    Hi I have created an web-application with JSF in Sun Java Studio Creator 2. The web application uses a lot of EJB's which acts as the dataProviders. In a typical jsp page i have more that one data providers(the EJB's) getting used. When i run the pro

  • BW Report iView Drag&Drop

    We have configured a BW Report iView.  The report appears to be generated correctly.  However, drag & drop functionality does not seem to be available.  When using the URL iView, the drag & drop is supported. Appreciate if you could advise how to mak

  • How do i transfer video from iphone to all devices?

    i have photo stream on, but none of my videos came through.  Can't I get these to transfer to my other devices?

  • Records in a table that are not older than two weeks

    Hey everyone, I have a mysql table which has a column DATE which contains the date the enty was inserted I need to write a script which keeps only those records that are no older than two weeks. Can this be done in sql? I can do it in Java but I gues

  • VF01-- Billing not generate accounting document

    Hi, experts. I have one sale order using billing plan. the plan include three down payment request and one closing invoice.for the first and second down payment request,using transaction 'VF01' generate accounting document, but for the third down pay