pnp search results
2 TopicsHow to format a column in the PnP Search Results Web Part
I'm trying to get a column in my PnP Search Results web part to be blue or grey for the background color, depending on the content in the column. The Visit Page column should be grey if the page is coming soon or blue if the page is available, so it should look like this: For the Visit Page column, this is what I have: <!-- If the URL length is less than or equal to 53, make the background grey --> {{#if slot item root.slots.PreviewUrl.length <= 53}} <a href="{{slot item root.slots.PreviewUrl}}" target="_blank" style = " padding: 10px 10px 10px 10px; cursor:pointer; border:none; color:white; font-weight:550; background-color:#A4A4A4; text-decoration:none; font-size:14px; text-align:center; display: flex; justify-content: center; "> {{slot item root.slots.VisitPage}} </a> <!-- If the URL length is greater than 53, make the background blue --> {{else}} <a href="{{slot item root.slots.PreviewUrl}}" target="_blank" style = " padding: 10px 10px 10px 10px; cursor:pointer; border:none; color:white; font-weight:550; background-color:#0078d4; text-decoration:none; font-size:14px; text-align:center; display: flex; justify-content: center; "> {{slot item root.slots.VisitPage}} </a> {{/if}} When I try the code above I get a parse error:1.2KViews0likes0CommentsResult search query to exclude items without values in a managed property
Hi all, I am trying to configure a PnP Search Results WebPart to show all recently modified site pages that contain a value in a managed property, any value that isn't blank. For context, this is for a wiki SharePoint site where all users can make changes and submit for approval. After they are approved, I would like to show on the home page the most recently updated pages. What I would like the query to do: Search for all pages from the path below that contain any value in the RefinableString00 property. path:https://xxx.sharepoint.com/sites/wiki/ A refinement filter is also set in the WebPart so that results only show site pages: FileType:aspx Results are also sorted to show the most recently updated pages first, using the property: LastModifiedTime My issue is that there are pages that don't have a value in the managed property RefinableString00 showing. I would like for these pages to not show. The question being how would I achieve this? Any suggestions would be appreciated5.5KViews1like2Comments