tag:blogger.com,1999:blog-8257012011174718720.post7123124748845571045..comments2024-03-28T00:35:17.905-07:00Comments on Stefan Stanev's SharePoint blog: XsltListViewWebPart & ContentByQueryWebPart – ParameterBindings, localization and embedded server controlsStefan Stanevhttp://www.blogger.com/profile/08627530356349625319noreply@blogger.comBlogger25125tag:blogger.com,1999:blog-8257012011174718720.post-53472003470336899482021-03-02T04:18:42.354-08:002021-03-02T04:18:42.354-08:00Thanks a lot Stefan!
Location="ServerVariabl...Thanks a lot Stefan!<br /><br />Location="ServerVariable(LOGON_USER);WPVariable(_LogonUser_)" saved me 10+ years after You published this article :)<br /><br />All server variables stopped being populated accidentally in my 2013 farm. Not only LOGON_USER, but all I've tried, i.e. SERVER_NAME or URL. But WPVariable which I've never heard before is still alive :)<br /><br />I'll post here if ever find out why all my server variables are R.I.P.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-79122079849098912172015-12-02T15:02:38.387-08:002015-12-02T15:02:38.387-08:00HI Stefan, this is the most useful thing I've...HI Stefan, this is the most useful thing I've read in my search to pass site title into a dataformwebpart and I feel I'm very close. You mention above creating a custom control for displaying the title, but there is one in the SharePoint namespace (SharePoint:ProjectProperty ID="localsitecontrol" runat="server" Property="Title" /) The problem I have is there doesn't appear to be a property to 'give' this - the default Text property doesn't exist. I can't create custom controls, have only sharepoint designer to work with. Any help?- Kevinhttps://www.blogger.com/profile/04511686633948019915noreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-52457709006642570292014-04-07T17:35:01.702-07:002014-04-07T17:35:01.702-07:00Hi Stefan,
nice article, I know its a littl...Hi Stefan, <br /> <br /> nice article, I know its a little old now and you probably doesn't check it anymore, but if you do...<br /><br /> The Querystring parameter can be used to filter the XsltListViewWebPart query? If so, how?<br /><br /> And if it can't, is there a way to filter it without the use of a Filter WebPart?<br /><br /> Thanks,<br /><br />CaioCS_RJhttps://www.blogger.com/profile/09225551453458496472noreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-74768410134762600422014-03-14T09:37:38.730-07:002014-03-14T09:37:38.730-07:00Hi,
Great article..! Is there way to apply string...Hi,<br />Great article..! Is there way to apply string manipulations inside parameterbinding .I want to parse Pagetitle from ServerVariable(URL) before assigning it to the parameter.Any advise appreciated. <br />Thanks in advance,<br />AnilAnilnoreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-12677103732347323982013-10-07T21:57:58.245-07:002013-10-07T21:57:58.245-07:00Hi, I have found the best Web Design Cochin progra...Hi, I have found the best <a href="http://www.theosoftindia.com/" rel="nofollow">Web Design Cochin</a> program for this purpose is a step by step, point and click web page design program.Thanks....Anonymoushttps://www.blogger.com/profile/09701377984223022528noreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-55456574572775364922012-11-23T13:52:00.499-08:002012-11-23T13:52:00.499-08:00Amazing,thanks a lot!!!! i will try them.Amazing,thanks a lot!!!! i will try them.Jorgenoreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-36930392026748377572012-07-21T05:08:32.139-07:002012-07-21T05:08:32.139-07:00Hi Anonymous,
I couldn't find a suitable para...Hi Anonymous,<br /><br />I couldn't find a suitable parameter binding which directly returns the title of the current site. It will be possible to achieve this using the Control(XXXX) binding type but this will require some additional work. You will need to create a custom control which should be placed on the same page as the CQWP web part. This custom control should have a public property which returns the title of the current SharePoint site (using code like SPContext.Current.Web.Title). If the property's name is say "WebTitle" and the ID of the control is "MyWebTitleControl" then the parameter binding will be Control(MyWebTitleControl,WebTitle).<br /><br />Greetings<br />StefanStefan Stanevhttps://www.blogger.com/profile/08627530356349625319noreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-90615035809662792582012-07-19T12:57:16.451-07:002012-07-19T12:57:16.451-07:00Hi Stefan,
Can the Site title be obtained from on...Hi Stefan,<br /><br />Can the Site title be obtained from one of these location options? I would like to filter items from a list based on the site's title. <br /><br />Thanks!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-91868863244024268632012-06-29T13:16:28.990-07:002012-06-29T13:16:28.990-07:00Hi ViliB,
From the approaches that you mention:
- ...Hi ViliB,<br />From the approaches that you mention:<br />- 1 works only for the XsltListViewWebPart, not for the ContentByQueryWebPart<br />- 2 will also normally work for the XsltListViewWebPart, but obviously has some side effects when you use it for the ContentByQueryWebPart (or an inheriting web part class as you have in your case)<br />- 3 works for the standard ContentByQueryWebPart - you need to make sure that you have all bits set up correctly as described in the posting - the ParameterBindings property, the xsl:param elements in your ContentQueryMain.xsl and finally the xsl:value-of elements which display the values of the xsl:param elements.<br />I am not sure though whether the fact that you use a custom class inheriting the standard ContentByQueryWebPart is not causing some problems with the last approach. Can you check the same setup with a standard CQWP web part?<br />On the other hand - if you already have a custom inheriting class, I would recommend that you use a fourth approach which will be much easier to maintain and faster to implement than the previous one. This approach was described in detail in this nice posting by Waldek Mastykarz: http://blog.mastykarz.nl/localizing-content-query-web-part-xsl-templates/<br />Let me know if this works for you<br /><br />Greets<br />StefanStefan Stanevhttps://www.blogger.com/profile/08627530356349625319noreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-16739797973568697342012-06-25T11:24:03.064-07:002012-06-25T11:24:03.064-07:00Hi Stefan,
Thank you for this article. It is very...Hi Stefan,<br /><br />Thank you for this article. It is very useful, but I am having some trouble implementing some of the methods you describe.<br />I have created a custom Item Style XSL, based on the build-in ItemStyle.xsl, in which I am trying to read a value from my own resource file deployed to App_GlobalResources.<br />I have a custom web part, inheriting from ContentByQueryWebPart, where I reference my custom ItemStyle XSL file in the .webpart file. The web part also uses a EditorPart to allow the user to browse for the page they want to select. <br />I haven't been able to get the custom ItemStyle XSL file to pull data from the resource file without side-effects. What I've tried so far:<br />1) <xsl:value-of select="/dsQueryResponse/Rows/@resource.wss.fld_yes" /> - This hasn't worked for me, even with the wss built-in resource file. <br />2) <SharePoint:EncodedLiteral runat="server" text="<%$Resources:MyResource,MyValue%>"/> - Where SharePoint is a namespace I'm importing at the head through xmlns:SharePoint="Microsoft.SharePoint.WebControls" - This work only if the web part is in display mode. If I try to edit the web part properties, it throws an "Object reference not set to an instance of an object" error. It doesn't even get to show the web part properties tool pane. The last call before throwing that error is Microsoft.SharePoint.WebPartPages.DataFormWebPart.CreateChildControls() <br />3) Defined a section at the top of the custom ItemStyle XSL with a ParameterBinding child element pointing to the resource, then defined a parameter, and used an xsl:value to grab its value. I get an error in the web part itself with a correlation ID. According to the trace logs, it is trying to find the resource file in the Resources folder in the SharePoint root.<br /><br />Any help with this would be appreciated. <br />Thanks,ViliBhttps://www.blogger.com/profile/11588378034148645022noreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-29065763033311969472012-01-09T05:56:03.229-08:002012-01-09T05:56:03.229-08:00Hi,
I just checked the BDL web part and got this w...Hi,<br />I just checked the BDL web part and got this working (I expected this to work since the BDL inherits the DataFormWebPart which provides this functionality). So you have to use the approach with the ParameterBindings (as it is in the CQWP, the other approaches work only for the XLV web part):<br />1) you need to have a resource ParameterBinding element in the ParameterBindings property of the BDL web part, e.g.: <ParameterBinding Name="myres" Location="Resource(wss,noitemsinview_doclibrary)" /><br />2) then you have to place a xsl:param element somewhere at the top of the part's XSL - its "name" attribute should be the same as the "Name" attribute of the ParameterBinding element: <xsl:param name="myres"></xsl:param><br />3) then place an xsl:value-of element somewhere in the XSL where you want to display your resource: <xsl:value-of select="$myres" />Stefan Stanevhttps://www.blogger.com/profile/08627530356349625319noreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-66473053729957388622012-01-05T11:10:32.560-08:002012-01-05T11:10:32.560-08:00Hi Stefan,
Thanks for this post! However, none of...Hi Stefan,<br /><br />Thanks for this post! However, none of the above techniques works when dealing with the business data list webpart. So, if you apply a custom XSL to the BDL, it's not able to grab the information from the resource files.<br /><br />Any clue?<br /><br />ThanksAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-60923384280016321872011-01-05T08:54:39.890-08:002011-01-05T08:54:39.890-08:00Hi Hendrik,
Unfortunately you can't get the va...Hi Hendrik,<br />Unfortunately you can't get the values from the SPWeb.Properties/SPWeb.AllProperties in the parameter bindings of the XLV web part. The only option for such global parameters is to use ... resource files (*.resx file(s) in the App_GlobalResources subfolder of the physical location of your SharePoint web site). It is a bit ugly and the scope of the values in the resource files is the whole web application, not a specific site collection as it is in your case.Stefan Stanevhttps://www.blogger.com/profile/08627530356349625319noreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-30482414203458816562011-01-05T06:11:38.854-08:002011-01-05T06:11:38.854-08:00Hello Stefan
Great post.
I have a question.
I wou...Hello Stefan<br /><br />Great post.<br />I have a question.<br />I would like to store global parameters in my sharepoint site collection. That way I can access them in all my lists and it will be much easier to update them.<br />How can I best do this? I've heard about web.properties -> can you access them with paramaterbindings location servervariable ?<br /><br />or do you have a better suggestion for these "global paramaters".<br /><br />Thanks a lotHendriknoreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-59395617250698389472010-12-12T03:25:36.014-08:002010-12-12T03:25:36.014-08:00Hi Anonymous,
If I understand correctly you are tr...Hi Anonymous,<br />If I understand correctly you are trying to add the XLV to another control and you are missing the ribbon when you select the web part. I myself have seen this problem but I don't know how this can be fixed or whether this is fixable at all. I may have a closer look at this one shortly.Stefan Stanevhttps://www.blogger.com/profile/08627530356349625319noreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-39036276930376810572010-12-08T14:49:22.399-08:002010-12-08T14:49:22.399-08:00hi excelent post !! 1 question
I tried to make a...hi excelent post !! 1 question <br />I tried to make a webpart that displays a dynamic list. but the List toolsis lost when <br /><br />I click do not show<br /><br />I trying the XsltListViewWebPart show the List tools in the ribbon.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-39037468582621831312010-12-08T14:48:56.746-08:002010-12-08T14:48:56.746-08:00asdaasdaAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-73755172645782709592010-12-06T10:48:43.565-08:002010-12-06T10:48:43.565-08:00Hi Prashant,
If you have in mind the standard Aver...Hi Prashant,<br />If you have in mind the standard AverageRatingFieldControl control - I don't think that it will work properly in the CQWP. The reason for that is that it is an inheritor of the BaseFieldControl class and will work with the SPContext.Current.ListItem, which will always be the page that contains the CQWP and not the individual items that you display in it. So, unfortunately, you will have to go for a custom solution - either reflecting the code of the AverageRatingFieldControl control and creating a modified custom control adapting the original code, or checking the alternative implementation of the ratings functionality UI in the XLV web part. The imlementation there is mostly XSL and can be found in the TEMPLATE\LAYOUTS\XSL\fldtypes_ratings.xsl file. Unfortunately again the XSL will need substantial modifications so that it works for the CQWP.Stefan Stanevhttps://www.blogger.com/profile/08627530356349625319noreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-80502730203397847442010-12-05T03:35:48.597-08:002010-12-05T03:35:48.597-08:00Hi Stefan,
Is it possible to display rating contr...Hi Stefan,<br /><br />Is it possible to display rating control (SharePoint 2010) in CQWP.<br />Please let me know how I can do this?Prashantnoreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-72832864918806744192010-11-30T07:54:16.841-08:002010-11-30T07:54:16.841-08:00Hi Nick,
Can you provide the sample powershell cod...Hi Nick,<br />Can you provide the sample powershell code (or bits of it) that you are trying to use. And also it wasn't clear to me what you meant with the last sentence about you having trouble accessing the item - which item is that.Stefan Stanevhttps://www.blogger.com/profile/08627530356349625319noreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-91808049901291176702010-11-29T02:32:15.468-08:002010-11-29T02:32:15.468-08:00Hi Stefan,
I am struggling to modify the DefaultV...Hi Stefan,<br /><br />I am struggling to modify the DefaultValue of a parameter binding via powershell.<br /><br />I have a collection of sites that each use a dataview web part that looks at a list. The list GUID has changed while migrating, and need to programatically update the defaultvalue for the web parts datasource.<br /><br />I'm having trouble accessing the item. Can you provide any input?<br /><br />Thanks,<br />NickAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-55149008838543560142010-11-17T04:40:01.868-08:002010-11-17T04:40:01.868-08:00Note that the targetted resource file in cannot co...Note that the targetted resource file in cannot contain any '.''s (dots). I looked this up in reflector and it searches for the next . it meets and determines the resource file name with that:<br /><br />@resource.AB.C -> finds resource key C in file AB<br />@resource.A.B.C -> Tries to find resource file A, and fails if it does not exist<br />@resource.C -> finds resource key C in wss.resxTibodnoreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-3727730214213145872010-10-13T01:40:41.736-07:002010-10-13T01:40:41.736-07:00Hi Stefan:
Thanks for taking the time (and so fast...Hi Stefan:<br />Thanks for taking the time (and so fast!). I implemented a custom Field type with a custom property (the MS bug on custom Field properties was a.p.i.t.a.) and it works for the Display, Edit and Delete Form (form pages) but of course the list view is handle by the XLV, and there is no way i can get it at the fldtypes_.xsl level becouse i can not get either the custom Field property (where it is stored the SPGroup that is suposed to view the field) neither the user´s role. Right now i´m trying with custom content types-list to see if i can hook some how into the view, but i must say there no much information, in fact i could only find such as deep topics in your blog. Thanks for giving back to the comunity!<br />YanselUnknownhttps://www.blogger.com/profile/16853791771650525161noreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-4927220183677194382010-10-12T13:48:24.271-07:002010-10-12T13:48:24.271-07:00Hi Yansel,
unfortunately you cannot subclass (inh...Hi Yansel,<br /><br />unfortunately you cannot subclass (inherit) the XLV web part - its class is defined as "sealed". I was thinking of the possibility to use custom XSL to achieve column level permissions - for that you will need the value of the SPList.EffectiveBasePermissions property available in the XSL. I checked the $XmlDefinition XSL parameter but though it contains most of the source SPList's properties it doesn't contain this one. If I have time I will check several other things and if I find something I will let you know.Stefan Stanevhttps://www.blogger.com/profile/08627530356349625319noreply@blogger.comtag:blogger.com,1999:blog-8257012011174718720.post-50686051138066141002010-10-12T02:15:19.503-07:002010-10-12T02:15:19.503-07:00Hi Stefan:
Is the
XsltListViewWebPart extendable?...Hi Stefan:<br />Is the <br />XsltListViewWebPart extendable? That is to say, can i inherit from it?<br />I would like to render custom field properties and the user credentials (im trying to implement column-level permisions in sp2010)<br />Thanks in advance!<br />neoglezUnknownhttps://www.blogger.com/profile/16853791771650525161noreply@blogger.com