Just had some fun and games with the SharePoint Content Search Web Part (CSWP). I create some content, list and pages, all with there own content type. I was able to view the column "Title" content in the CSWP display, but not able to Sort by "Title" or have it as a Refiner.
So...
I used one of the RefinableString Managed Property. It was tricky to figured out which Mapped crawled property was the correct "Title". These are the ones that worked for me, for my current project.
Mapped crawled property for:
List - Basic:displaytitle
Page - ows_Title
This is my blog about SharePoint. I add interesting things that I discover about SharePoint, and “how to’s”. I really love SharePoint, and this is where I add my two cents about it. Adding to the collaboration community. I am a SharePoint Solution Specialist. I architect, configure, improve and develop Enterprise Content Management and Web Content Management Solution with Microsoft SharePoint Server.
Showing posts with label Content Search web part. Show all posts
Showing posts with label Content Search web part. Show all posts
Wednesday, 14 June 2017
Monday, 15 June 2015
Content Search Query rules to find all Sub Sites within the Current Site
Query:
contentclass:STS_Web
Path:{Site.URL}
Site<>{Site.URL}
How-to:
- This rule will only show sites. At this stage it shows all the sites across the whole environment.
- This rule will limit the results to sites with the current site. This also include the top level site.
- This rule removed the top level site, thus only showing the sub sites.
- This rule removed the top level site, thus only showing the sub sites.
How to Map the "Expires" date column in the Search Schema for SharePoint Online (Office 365)
With SharePoint Online you can’t create a New mapped search column as simply as SharePoint On-Prem. With SharePoint Online it is best to use one of the pre-created mapped search columns, created for you, by SharePoint to use. I.e. RefinableString, RefinableDate, RefinableInt and RefinableDecimal.
For this example I will be Mapping this column, for my whole SharePoint Online environment, so all my Site Collection can access this Search Mapped Column.
For this example I will be Mapping this column, for my whole SharePoint Online environment, so all my Site Collection can access this Search Mapped Column.
- Goto your SharePoint Online Admin Center
- Click "search" on the quick links menu (on the left)
- Filter by "refinabledate"
- Click "RefinableDate00"
- You can see that this column is already for searching, and has been configured to be a "Date and Time" column type
- Add an Alias to this column. This will inform other and "future you", what this column is for.
Alias: AnnouncementExpiryDate - Scroll down to "Mapping to crawl properties", and click "Add a Mapping"
- Find "Search for crawled property name": Expires
- Select "ows_Expires"
- Click "OK"
- Click "OK"
- To see the column mapped, filter again by "refinabledate"
Now you just have to wait for the SharePoint Online Crawl to run :)
Content Search Query Rule for showing item with a future Expiry Date, or have Blank Dates.
There are so many cool ways you can use the Content Search Query rule, I blog about last (Content Search Query Rule for showing Items Modified Today).
So in this example, I have a list of Announcements. These Announcements have an Expiry Date. This Expiry Date column can be blank or have a date.
The Content Search Rollup must show all item which has a future Expiry Date, or are blank.
Note: The column which is being used to compare the date, must be a mapped in the Search Schema as a DATE (Date and Time) column.
Note: The default “Expires” column is not automatically mapped, by the Search Schema. There is a mapped column called “ExpiresOWSDATE”, but this column is mapped as text.
Query Rule:
The reason this is such a cool rule, is because it show items with Blank Dates.
Please see next blog on: How to Map the "Expires" date column in the Search Schema for SharePoint Online (Office 365)
So in this example, I have a list of Announcements. These Announcements have an Expiry Date. This Expiry Date column can be blank or have a date.
The Content Search Rollup must show all item which has a future Expiry Date, or are blank.
Note: The column which is being used to compare the date, must be a mapped in the Search Schema as a DATE (Date and Time) column.
Note: The default “Expires” column is not automatically mapped, by the Search Schema. There is a mapped column called “ExpiresOWSDATE”, but this column is mapped as text.
Query Rule:
-RefinableDate00:1900-01-01..{Today}
The reason this is such a cool rule, is because it show items with Blank Dates.
Please see next blog on: How to Map the "Expires" date column in the Search Schema for SharePoint Online (Office 365)
Tuesday, 9 June 2015
Content Search Query Rule for showing Items Modified Today
I just learnt a really cool Content Search Query Rule which I just have to share.
So in the Content Search Web Part Query, you add:
The Search result will then only show you item which where modified today. Thus is removing anything from 1900-01-01 to anything created Yesterday (Today-1).
So in the Content Search Web Part Query, you add:
-LastModifiedTime:1900-01-01..{Today-1}
The Search result will then only show you item which where modified today. Thus is removing anything from 1900-01-01 to anything created Yesterday (Today-1).
Thursday, 16 October 2014
Using Javascript and the ctx element within Display Templates
So as you know I love Display Templates, using in the Content Search web part.
I just found this awesome article, showing how to do some fantastic "Higher Grade" stuff with Display Templates.
When working with Display Templates you use a combination of HTML and JavaScript/JQuery to manipulate it into doing what you want it to do. The below link, shows some nice tricks, on working with the ctx elements and the Managed Property Mapping.
Check it out:
Useful JavaScript to know when working with SharePoint Display Templates (#SPC3000)
http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2014/02/26/useful-javascript-for-working-with-sharepoint-display-templates-spc3000-spc14.aspx
I just found this awesome article, showing how to do some fantastic "Higher Grade" stuff with Display Templates.
When working with Display Templates you use a combination of HTML and JavaScript/JQuery to manipulate it into doing what you want it to do. The below link, shows some nice tricks, on working with the ctx elements and the Managed Property Mapping.
Check it out:
Useful JavaScript to know when working with SharePoint Display Templates (#SPC3000)
http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2014/02/26/useful-javascript-for-working-with-sharepoint-display-templates-spc3000-spc14.aspx
How to Create Custom Display Templates in SharePoint 2013, Content Search web parts
SharePoint 2013 display templates are the best thing since sliced bread - no, than slices cheeeese…
I have really falling in love with SharePoint all over again, using the Content Search Web Part. This now giving you the ability to show your content in any fabulous way you would like.
This video show you how to get started, check it out:
Display Template Overview
https://www.youtube.com/watch?v=yC4LZapFdfY
I have really falling in love with SharePoint all over again, using the Content Search Web Part. This now giving you the ability to show your content in any fabulous way you would like.
This video show you how to get started, check it out:
Display Template Overview
https://www.youtube.com/watch?v=yC4LZapFdfY
Subscribe to:
Posts (Atom)