SP Saturday Melbourne – SharePoint + jQuery
Today was my session about jQuery and SharePoint – and all my demo’s worked – phew !
The main “take-aways” from the session were :
- jQuery + SharePoint work nicely together – it’s all comes down to HTML in the end…!
- Easy to create animations WITHOUT needing Flash, Silverlight – or HTML5
- Use DVWP – and external XSLT – to construct the HTML you want
- NB. This is a great way to display/layout data – regardless of whether you use jQuery or not !
The main steps from the slides were :
- Upload the files to SharePoint (JS, CSS)
- Include a script reference to use it
- Add a DataViewWebPart – to a list (eg. Announcements, Product List)
- Configure the XSLT to get the HTML you need/want
- Include JavaScript (jQuery syntax) to do Accordian, Click, Hover, Cycle, etc…
The session today showed three main demos – which I’ll blog about ‘separately’ :
- SharePoint Announcements list – Accordian
- SharePoint Image list – Image Rotator (photos of bikes/mountain bikes)
- SharePoint Announcements list – News Rotator
I’ve uploaded the files from today’s session (to SkyDrive) :
- Slide Deck (PPTX) : 396 KB
- ZIP containing jQuery + scripts + XSLT : 109 kb
- Click here to go to the SkyDrive folder for these files…
If you were at SharePoint Saturday – let me know any comments/feedback.
And – keep an eye on my blog/twitter – for an in-depth run-down of each of the demo’s…
Cheers !
![]()
I’m presenting – SharePoint Saturday Melbourne
This coming Saturday is Melbourne’s turn for SharePoint Saturday – after some great events in Brisbane, Canberra and Sydney – over the last few months
SharePoint Saturday (SPSat) has become an amazing ‘movement’ within the SharePoint community – the day is free for all attendees – including lunch – thanks to generous sponsors, and a lot of hard work from the organisers (thanks – btw !)
This weekend also has SharePoint Saturday’s happening in Manila, Minnesota – and Minsk (Belarus – near Russia).
Make sure you don’t go to the wrong venue – NOT at the Hotel Victoria !
For *MY* presentation this Saturday, I have re-jigged my session from TechEd – showing how to implement jQuery within a SharePoint 2010 environment.
I’ll show a quick overview – and then onto some demo’s :
- Include jQuery within the Master Page
- Add a DataView WebPart
- Change some XSLT
- Add some jQuery (JavaScript) statements
- And voila !
- Animations without using FLASH…(!)
The demos will cover three main functions/features :
- Accordian
- Image Rotator
- News Rotator
Each of these are easy to get working – with some great tips & tricks for data views as well – DON’T write code for rendering out data ! I’ll show you why/how.
After SharePoint Saturday, I’ll write up a little more about the demo’s – and have some code/samples to download. But – for now – you’ll just have to come along and see !
Here are the main details :
- Register via EventBrite : SharePoint Saturday Melbourne – Oct. 22nd
- Venue : Cliftons, 1/440 Collins St, Melbourne
- Click here to check out the schedule (PDF) – with the list of speakers and topics – and timeslots
- And – if you can’t make it along – follow the action via Twitter – using the hashtag #SPSMEL
P.S. This event is being presented/supported by the “Melbourne SharePoint User Group” (MSPUG).
Click here for more information – and to subscribe to the newsletter.
Hope to see you there – Viva la SharePoint Saturday !
![]()
Promoted Properties from InfoPath – LESS is BEST
When developing a SharePoint form + workflow solution, the best choice (IMHO) is to use InfoPath + Nintex Workflow. There are many (MANY) considerations – but I’m just touching one that I think it worth a call-out.
When you publish an InfoPath form – you can choose which columns to ‘promote’.
These become SharePoint columns within the list – and that’s great for doing FILTER and GROUP functions – or for use in DVWP’s.
But – they can be a headache – especially when deploying forms from DEV, to UAT, to PROD.
If you’re not careful, you can end up with duplicated column names – with internal names like “Department0”, “Department1”, “Department2”, etc.
The trick is to “take your time” when pushing the form to another server environment. Make sure to follow these steps
- Double-click the column name
- Change the dropdown from “Create New” – to “This Form Library”
- Choose the column – ie. match the InfoPath column with the (existing) SharePoint column
================================================================
BUT – as the topic of this blog post tells – you don’t need to (shouldn’t need to) promote LOTS of fields – especially if you don’t need to.
*IF* you are simply promoting fields for use within a Nintex Workflow – then STOP. There is a better way.
- Don’t promote the field (eg. Date Commencing)
- Within the Nintex Workflow – use the “Query XML” action to get the value
- The field will still be WITHIN the SharePoint item (InfoPath form)
- It’s only ONE step to get the value – then use the variable within the workflow ‘logic’
It’s THAT easy ! Don’t believe me….?
Well, lemme show you…
================================================================
Get the XPath for the field you need
- Within InfoPath – find the field you need/want – within the Data Source (Main)
- Right-click and choose “Copy XPath”
- Nothing will happen – but the full XML schema node structure is copied to your clipboard
eg. /my:myFields/my:MarketingActivity/my:DateCommencing
Retrieve the value within Nintex Workflow
- Within your Nintex Workflow, add a “Query XML” action – within the “Integration” section/group
- Click “Configure”
- Leave the dropdown for “Current Item” – ie. the InfoPath form (XML)
- Change the second dropdown for “Process Using” – to be “XPath”
- Paste in your value copied from InfoPath (as above)
- Define a variable – and select it (eg. DateCommencing)
================================================================
That’s it ! You can now use the variable/value – within the workflow.
This is only ONE extra step to get the value – very easy via “Query XML” – and, no need for a promoted field.
And that is a VERY good thing – when it comes to deployment (to PROD).
Hope that helps – it’s certainly one of my favourite features – no more promoted fields !
(Having said that – it’s valid to have promoted fields for List ‘views’ – grouping, filtering, and search/indexing).
![]()
SharePoint 2010 – how to hide BLOG fields – using jQuery
Within SharePoint 2010, I’m making use of the BLOG site template, to create an easy-to-use communication channel for the marketing people at the client.
There are a bunch of fields – but some are only relevant to the under-lying Nintex Workflow – and so I want to be able to hide these fields :
As they are CHECKBOX fields – you can’t actually set them to be HIDDEN – via the Content Type – I tried !
Also – if you set them to HIDDEN, they’re gone from any Views, or other screens – so, I’m just wanting to hide on the NEW and EDIT pages.
The answer is to use jQuery :
- Add the JS library – and include some SCRIPT tags
- Select the section of HTML (from the DOM)
- Set to HIDE
Here’s what you need to do – step-by-step. (thx to Ken Zheng for the idea + sample JavaScript).
This premise works the same as adding a “Content Editor WebPart” – but within the page itself – meaning that no-one will be able to accidently (or deliberately) delete it off the page.
(1) Get jQuery onto your SharePoint site
- Go to the jQuery website – and download the latest file (v1.6.4 at the moment)
- Upload this JS file to your root site (Site Collection)
- I usually upload to the “SiteAssets” folder
(2) Open the site within SharePoint Designer
- Open SPD, and ‘open site’ to the URL : eg. http://server/SM/
- Go to the LISTS section
- Find the “Posts” list – this is what I need (blog posts)
- NB. The list/folder may be different for what YOU are needing to do.
(3) Edit the page : NewPost.aspx
- This is the web page for the list that allows for new blog posts to be entered
- Find the HTML markup for “ContentPlaceholderMain”
- Enter the SCRIPT text within this section
- >> Include the reference to the JS
- >> Include the ‘jQuery’ syntax
- Scroll below for the specific text – to copy+paste
- This does a ‘selector’ on the TEXT that I’ve specified – and then determines the TR that it is ‘within’
(4) Repeat the same steps for EditPost.aspx
- Yep – gotta do the same for ‘Edit Post’
That’s it ! Make sure you SAVE the page/s you’ve edited – and you can then try it out.
See ! The fields are gone – that’s nice & easy, eh ?
![]()
==================================================
Here’s the SCRIPT you’ll need – as shown above :
<script type="text/javascript" src="/SiteAssets/jquery-1.6.4.min.js" > </script>
<script type="text/javascript">
/*
* Hide form fields in SharePoint
*/
$(document).ready(function() {
$('nobr:contains("Newsletter – Can Be Added")').closest('tr').hide();
$('nobr:contains("Newsletter – Approved Flag")').closest('tr').hide();
$('nobr:contains("Newsletter – Has Been Emailed")').closest('tr').hide();
});
</script>
TechEd Wrap-Up
Exactly three weeks ago, I was headed up to the Gold Coast for Microsoft’s TechEd conference. Has been a fortnight (since) with sick kids, and me too (!) – and have only just managed to catch-up on emails & such.
My TechEd this year was a little different – as it was the first time I was to be presenting a Microsoft session.
But, first of all, I had a session entitled “SharePoint + jQuery – bring da bling” – in the AvePoint interactive theatre.
My objective was to show how quick & easy it was to include jQuery within a SharePoint page – and then display some animations – with data sourced from a SharePoint list.
This was foiled somewhat by my VM playing up – and running super-slow – annoying !
Anyway – the session ended up covering :
- What is jQuery – and how to get it working in SharePoint (files)
- Accordian – using a News library (Announcements)
- Image Rotator – using a SharePoint Picture library
I had to skip the actual “News Rotator” piece – due to time & troubles – BUT – I will (hopefully) be re-doing this session at SharePoint Saturday in Melbourne (Oct. 22nd)
Sorry to those who have contacted me – asking about slides & demo material – I’ll make this available just after SPSat.
The second session I was to be doing at TechEd was related to Office 365 – From Zero to Productivity with Office 365.
Ben Walters & Lee Hickin were my co-presenters – we had the ambitious goal of setting up and configuring Office 365 LIVE…
My piece was related to SharePoint – covering “what it is” – and the configuration and management aspects – as well as a demo of the Public Facing website component.
The session is now available for viewing – Microsoft have released these on Channel 9.
** Skip forward to about 45 mins – for the SharePoint piece. Do I really sound like that !??! [LOL]
Apart from the sessions that *I* was presenting – I had a bunch of great topics & sessions that I really enjoyed – and learnt a lot – here’s a link to the videos for the sessions I think are worth watching :
- OFS 201 – Building Office 365 Solutions with Azure
- WPH 201 – What’s new in Windows Phone 7.5 for End Users and Enterprises
- OFS-OFC 215 – Microsoft Office 365: The Future of Productivity
- OFS 310 – The SharePoint Developers Guide to Project Server 2010
- OFS 307 – High Octane Internet Sites on the SharePoint Platform
- COS-OFC307 – Exploring the Office Developer Story in Microsoft Office 365
There were also some great sessions in the AvePoint theatre – about Authentication within SharePoint – and Business Intelligence – and a few ask-the-experts panels.
AND – I had a lot of fun with the session about Developing for the Kinect SDK – XBox for developers…!
As well as some great discussions & conversations – and lots of fun at the closing party. And don’t forget the StormTroopers !
Thanks TechEd – you were a great event, yet again.
And thanks Microsoft, of course !
![]()
Presenting at TechEd
With only two weeks until Tech Ed 2011 is in full swing, I’m sure there’s a whole swag of activity around Australia, with presentation preparation – and a bunch of geeks checking out the agenda + schedule.
This year, I’m presenting TWO sessions – as well as participating on the “ask the experts” panel.

Here’s the details of the sessions I’m doing – hope to see you in the crowd !
===========================================================
AIT005 | SharePoint + jQuery – bring da bling!
- Level-200
- AvePoint SharePoint 2010 Interactive Theatre
- Wed, 31 Aug – 1:15pm
- Chris will show a fully sick SharePoint solution with cold-hard-chillin’ eye candy guaranteed to bring all the cool cats to check the funky shizzle on your SharePoint site. He will use jQuery/JavaScript along with DVWP’s, XSLT and HTML to show some animation effects, hovers & sliders – to pimp out the plain ol’ News Rotator like never before ! Word.
LOL ! Yep…!
This one should be a bit of fun – or I’ll crash-and-burn in a ball-of-flames.
Either way – it should be entertaining… Don’t miss it !
![]()
===========================================================
OFS-OFC309 | From Zero to Productivity with Office 365
- Level-300
- Ben Walters, Lee Hickin, Chris O’Connor
- Thu, 1 Sep – 08:15am
- Office 365 is the ideal platform to get your business up and running with the best productivity suite on the market. In this session you will witness the birth of a full infrastructure offering watch as Exchange 2010, Lync and SharePoint are provisioned and configured ready for use right in front of your eyes. Attendees will take away key learning’s on how to get started with the Office 365 Platform from day one.
I’ll be showing-and-telling the SharePoint aspects of Office-365 – and the administration aspects, and public-facing site configuration, etc.
This will be a very informative session – we’ll be getting up-to-speed LIVE – with lots of demos – and minimal slides….
===========================================================
AIT011 | Ask a SharePoint Expert: final Q&A Panel
- Interactive Session
- AvePoint SharePoint 2010 Interactive Theatre
- Dan Holme, Mark Rhodes, Chris O’Connor
- Fri, 2 Sep – 11:00am
I’m looking forward to this session – it will be great to ask some questions from Dan Holme & Mark Rhodes (from me !).
This will be an enjoyable and valuable session for those working with SharePoint – or hoping to test-the-waters.
===========================================================
See you on the Gold Coast – in less than two weeks…!
XsltListViewWebPart Date Format using DDWRT
The new way to do a SharePoint 2010 DataViewWebPart (DVWP) is to use a XsltListViewWebPart (XLV).
The premise is still the same – using SharePoint Designer, you add a data source (eg. Shared Documents) – and then format the output and so forth.
There are a bunch of differences, I resisted using the XLV, and kept using the old-school DVWP – but have been switching over to use the ‘new way’.
Anyways, I’ve been having some troubles with the way that DATES are being formatted within the new XLV.
The basic XSLT to use (and works great else where) is this :
<xsl:value-of select="ddwrt:FormatDateTime(string(@Modified), 3081, ‘dd-MMM-yyyy’)" />
This should then display dates in AUSTRALIAN (3081) format – where I’m located – not a standard U.S. Date.
BUT – I’m seeing the following
- Date : 08/06/2011 – showing as 06-AUG-2011
- Date : 30/05/2011 – showing as 30-MAY-2011 (correct)
It looks like the DDWRT format is changing dates “if it can” – into a U.S. format date. (BUG !?)
Any dates with a “DAY” less than 12 is being flipped – 1st of a month becomes JANUARY, etc.
I tried a LOT of different syntax :
- ddwrt:FormatDateTime(string(@Modified), 1033, ‘dd-MMM-yyyy’) – same problem
- Format as “ISO” date – and then re-format as ‘dd-MMM-yyyy’ – same problem
- Made sure the RAW date is correct – 07/06/2011 11:13 AM [ <xsl:value-of select="@Modified" /> ]
*aaarrrggghhhh*
See the screenshot here (click to view)…>
After a few HOURS of fiddling – I am convinced that there’s a BUG with the SharePoint 2010 XsltListViewWebPart – when using the DDWRT FormatDateTime
Perhaps the product team only tested with the U.S. date format – for 1033….?
Solution
In a moment of ‘desperation’, I ended up creating my own ‘date format’ routine – and then I can have FULL control over the values being displayed.
You could change this to suit your own needs – and then don’t need to use the DDWRT methods.
This basically does the following :
- Input param of a date
- Get the first part – which will be the DAY – before the /
- Add a leading “0” if needed
- Get the second part – which will be the MONTH – and set as the short date value (JAN, FEB, MAR, etc)
- Get the third part – which will be the YEAR
It now looks like this – which is CORRECT :
Here’s the XSLT :
<xsl:template name="formatAustralianDate">
<xsl:param name="dateValue"/> <!– expects raw date : eg. 31/05/2011 3:22 PM –>
<xsl:variable name="day" select="substring-before($dateValue,’/')"/>
<xsl:variable name="month" select="substring(substring-after($dateValue,’/'),1,2)"/>
<xsl:variable name="year" select="substring(substring-after(substring-after($dateValue,’/'),’/'),1,4)"/>
<xsl:choose>
<xsl:when test="string-length($day)=1">0</xsl:when>
</xsl:choose>
<xsl:value-of select="$day" />-
<xsl:choose>
<xsl:when test="$month=’01′">Jan</xsl:when>
<xsl:when test="$month=’02′">Feb</xsl:when>
<xsl:when test="$month=’03′">Mar</xsl:when>
<xsl:when test="$month=’04′">Apr</xsl:when>
<xsl:when test="$month=’05′">May</xsl:when>
<xsl:when test="$month=’06′">Jun</xsl:when>
<xsl:when test="$month=’07′">Jul</xsl:when>
<xsl:when test="$month=’08′">Aug</xsl:when>
<xsl:when test="$month=’09′">Sep</xsl:when>
<xsl:when test="$month=’10′">Oct</xsl:when>
<xsl:when test="$month=’11′">Nov</xsl:when>
<xsl:when test="$month=’12′">Dec</xsl:when>
</xsl:choose>
-<xsl:value-of select="$year" />
</xsl:template>
And – here’s how to CALL to it – for the “Modified” field (default SharePoint column)…>
<xsl:call-template name="formatAustralianDate">
<xsl:with-param name="dateValue" select="@Modified" />
</xsl:call-template>
—————————————
And – that fixed my problem. I’m sure there HAS to be another way – and/or a bug-fix or patch – but I thought I’d share this solution – and hopefully, it will help YOU also.
…. and let me know if you find a FIX for this annoying problem !
![]()
As a SharePoint developer, I though it was time to branch out and check out some of the new “cloud computing” development – and recently attended a Windows Azure ‘getting started’ training day.
We had some discussion & presentations – and then delved into a lab.
Check out the Windows Azure Platform Training Kit for some great material – labs, SDK, project types, etc.
The development environment is Visual Studio 2010 – working locally – with an “emulator” for the COMPUTE and STORAGE machines – which will be ‘in the cloud’ when deployed to Windows Azure.
My development project was progressing OK – until I got a nasty exception – and simply hit a wall. The lecturer was scratching his head also – and so I thought I’d relay the solution – for other folk, and for my own future reference.
When my project would run – I’d get a .NET ‘yellow’ screen error :
The error was happening when I was trying to read the “configuration” information – which uses the ‘RoleEnvironment’ class libraries – within the GLOBAL.ASAX.CS file.
RoleEnvironment.GetConfigurationSettingValue
For some reason – the RoleEnvironment was showing as “unavailable”.
But – when looking at the ‘emulator’ running on my local PC – they’re both running – STORAGE – and COMPUTE.
Even if I stop and re-start – and an IISRESET – still the same problem.
So – I tried shutting Visual Studio – and re-opening – but same problem.
This is a little odd though – showing nothing in the “Compute Emulator” – hhhmmmm.
To cut to the chase, it turns out that I’d done an ASP.NET developer style “oops” – by setting the “startup” project to the ‘WebSite’ – which you’d ordinarily do. I’d chosen the “WebRole” as the startup project :
Once I changed this to be the ‘globe’ project – the configurator one (?) – then all was happy !
And – you can now see the list of projects/executables within the “Compute Emulator” :
So – if you’re getting a ‘yellow screen’ error – and/or problems with the “RoleEnvironment” – then check/change the startup projects – it should look like this (BOLD) :
Hope that helps – and saves you some headaches with DEV’ing inside Visual Studio – w/ Azure.
![]()
Managed MetaData “ampersand” values (termset)
The new Managed MetaData Service App within SharePoint 2010 is great for creating taxonomy, folksonomy, and for allowing people to tags documents with values – aside from just a normal list look-up – or choice field.
But – I came up against a pretty nasty scenario (bug ?) when using a CAML query – and attempting to use one of the Managed Metadata values.
Case in point :
I have a termset for “Division”. This has termset values for “HR”, “IT”, “Finance”, “Research & Development” and “Purchasing”.
When I have a dataview webpart – I use a CAML statement like this (ie. WHERE Division = Finance) :
<Eq>
<FieldRef Name="Division" />
<Value Type="Text">Finance</Value>
</Eq>
This works perfectly – every single time – for “Finance”. And – the same for “HR” and “IT” and “Purchasing”.
BUT – when I need to use the value for “Research & Development” – I was striking a problem.
Hhhhmmmm – why is that ?!?
Aaaah – it has an ‘ampersand’ in the value – that’s cool – I’ll just use THIS :
<Eq>
<FieldRef Name="Division" />
<Value Type="Text">Research & Development</Value>
</Eq>
Now – THAT would normally work for any other field within SharePoint – Choice, Text, etc – right ?
Sadly – NO. Not for Managed MetaData.
For some strange reason – it’s not actually an “ampersand” – like you’d type with SHIFT+7 on the keyboard.
Instead – it’s a wierd unicode value – have a look here :
The value is actually :
Research & Development
Instead of :
Research & Development
Can you spot the difference ?? No – that’s not a strange font, it’s a different CHARACTER… (WTF !)
So – the way to use within a CAML query – is to refer to the exact character :
<Eq>
<FieldRef Name="Division" />
<Value Type="Text">Research & Development</Value>
</Eq>
Of course !! “Well, there’s your problem” – as the MythBusters would say !
UPDATE : Just realised that the above character is being encoded – dammit !
What you need to include is :
Research [#]65286 Development
** You will need to remove the square brackets (!)
Thanks Wikipedia for the assistance with that one.
Hopefully – YOU don’t have the same hair-pulling exercise that *I* had – and you can get your DVWP + CAML to sing & dance the way it should – using the termset values.
![]()
Further Discussion :
This is a essentially a “data related” issue – it’s a problem because of some of the actual ‘values’ I have in my Managed MetaData termset – rather than anything wrong with Managed Metadata itself.
The BIGGER question is – should I be using the “&” value at all ??
Maybe the termset value should be :
Research and Development
This is being discussed within my development & “business analyst” team – with the thinking that we should NOT use any punctuation – or XML’ish values – even if the SharePoint UI allows it.
** Just because you CAN – doesn’t mean you SHOULD.
Your thoughts on this !?? Leave a comment – I’d be interesting to know your views. Is it a bug perhaps !?
CQWP with more than THREE filters
The Content Query WebPart (CQWP) is great for quick ‘Data View’ style content roll-ups, and is very easy to configure. Very easy to choose the WEB, and LIST and CONTENT TYPE to use.
But – it’s a little limited, in that you can only have THREE set of filter criteria.
Edit Page > Edit WebPart > Query
Once you’ve hit that limit – then you almost need to start all over again – using SharePoint Designer – and add a DataView or ListView webpart.
BUT – there is a way you can include MORE filter criteria – and you don’t have to change the other settings within the CQWP you’ve got in place – often important with regard to style/layout/etc.
Here’s the steps to do it :
- Edit Page > Export WebPart
- Save it somewhere you’ll remember – eg. SPR1.webpart
- Open the file in Notepad – or within Visual Studio (easier to see/read)
- You’ll see the FILTER fields within there :
- FilterField1, FilterField2, FilterField3
- FilterDisplayValue1, FilterDisplayValue2, FilterDisplayValue3
- FilterValue1, FilterValue2, FilterValue3
These will be populated depending on what you’ve chosen in the CQWP user interface (as above)
There is another property in there entitled : QueryOverride
<property name="QueryOverride" type="string" />
This can be used to add MORE filters (where clause) and will be used instead of the 1,2,3 filters.
You just need to (eek) define the CAML to put inside the property – and then save the .WEBPART.
Here’s an example that I pieced together :
<property name="QueryOverride" type="string">
<![CDATA[<Where>
<And>
<And>
<And>
<Or Group="true">
<Leq>
<FieldRef Name="PublishingStartDate"/>
<Value Type="DateTime">
<Today/>
</Value>
</Leq>
<IsNull>
<FieldRef Name="PublishingStartDate"/>
</IsNull>
</Or>
<Or Group="true">
<Gt>
<FieldRef Name="PublishingExpirationDate"/>
<Value Type="DateTime">
<Today/>
</Value>
</Gt>
<IsNull>
<FieldRef Name="PublishingExpirationDate"/>
</IsNull>
</Or>
</And>
<Eq>
<FieldRef Name="Document_x0020_Type" />
<Value Type="Text">Notice</Value>
</Eq>
</And>
<Eq>
<FieldRef Name="Meeting_x0020_Category" />
<Value Type="Text">Board Meeting</Value>
</Eq>
</And>
</Where>
<OrderBy>
<FieldRef Name='Created' Ascending='FALSE' />
</OrderBy>
]]>
</property>
It looks like a LOT – but it essentially does this :
WHERE (PublishDate < TODAY or PublishDate = NULL)
AND (ExpiryDate > TODAY or ExpiryDate = NULL)
AND (Document Type = Notice)
AND (Meeting Category = Board Meeting)
ORDER BY Created DESC
So – we can use that XML (CAML) within the CQWP webpart – by replacing the “QueryOverride” tag.
Next step is to copy that piece of XML into the .WEBPART file – and save it.
** Remember to include the CDATA tags – and also – ditch the original “QueryOverride” tag.
Also – remember that the 1,2,3 filter values are now IGNORED – so you’ll have to do it ALL in the CAML query.
Now, go add the updated webpart to the page :
- Edit Page
- Add WebPart
- Import WebPart > Browse
- Choose the file (.WEBPART)
- Click Upload
- THEN – have to re-click the “Add WebPart” button (this step is a little crap, IMHO)
- And then you’ll see it listed in the “Imported WebParts”
And – that’s it – hopefully (if you master’ed the CAML), it should be working OK.
If you’re having trouble with CAML, a good approach is to use SharePoint Designer – add a ListViewWebPart, and then add some filter values – via the point+click UI.
Then – switch to CODE VIEW – and see what it’s created.
OR – use the U2U CAML Builder tool.
And – there you have it – you CAN have more than THREE filter values for a CQWP – just have to use the ‘override’ property.
It’s a little tricky – but very powerful.
![]()

