SOLVED

Display Site Pages Similar to Doc Library

Occasional Contributor

Our communications director would like to create site pages for newsletters, which is fine, but we also need to keep an archive of them, displayed on a page.  I am using the Highlight web part grid view to display the top few and then the Highlight list view to display the rest.  If I were able to use the document library web part, I could set up a view with sorting and grouping, but because they are site pages I have very limited controls.  Is there a better way of displaying a listing of site pages within a page?

 

Here are the only filtering, sorting and grouping controls the Highlight web part offers (far less than a doc library view):

Ukiman1014_0-1660681015728.png

 

19 Replies
best response confirmed by Ukiman1014 (Occasional Contributor)
Solution

Hello @Ukiman1014 

 

the control and setting in the highlighted content web part are limited.

 

For a fully customized web part view, i recommend the PnP Modern Search Web Parts. In there, you can customize the query, sort and visualization from your web parts.

 

Here are more information: https://microsoft-search.github.io/pnp-modern-search/

 

Regards, Dave

Thank you, Dave! I have heard of this before but had not understood how I could use it. I've installed it and will start experimenting. Please let me know if you have any guidance or tips.

Hello @Ukiman1014 

 

good to hear. You have more guidance in the scenario tutorial: https://microsoft-search.github.io/pnp-modern-search/scenarios/

 

When it not help, come back here, we will try to help you ;)

 

Regards, Dave

@David Mehr I am struggling a bit right off the bat. I have an existing "Category" column in my Site Pages.  I only want PnP Search to display a list of pages with a specific category. In the second scenario it says that in order for anything to be filtered by the search, it must be a managed property.  The column was originally just created by clicking "Add New", not going to Site Columns and clicking "Create", as stated in the instructions.  So it seems that I need to create a new column as per the instructions and then go through and set that column to match the values of my original column.  Is that correct?

 

It seems strange to me that columns created in the usual manner aren't available to search, because they're not considered Managed Properties.  Am I missing something?

Hi @Ukiman1014 

 

every column, site and list, will be crawled as "Crawled Property", but only site columns will be automatically added to "Managed Properties". For your list column a Crawled Property is created, but not a Managed Property. 

If necessary, you can set the managed properties so that the properties are available as a refinement, can be used in the queries, etc.

 

In your case

Map your list column to an existing RefinableStringXX property, after that you can use your mapped RefinableStringXX in your search. In the default RefinableStringXX properies are the settings active, to use it in search scenarios.

 

I prefer

1. use site columns - with a unique prefix, and withoud spaces or special characters

2. use sharepoint search admin center for search administrations (it's also possible to do it on site level, but in big environments it can become confusing)

 

Hope this helps. 

 

Best, Dave

very interesting idea

@David Mehr 

Thanks, Dave. I didn't understand that I had to map it to a RefinableStringXX property in order for it to work with PnP search.

 

Is there a way for columns that were added directly in a doc library or list to become site columns, and then managed properties? I am surprised that if a user adds a column to a list or library there's not an easy way to get that to work with PnP Search. I am assuming I'd need to go into Site Columns, create it there and then follow the steps. I'd then have to migrate the existing user-created column's data to the new managed column. Is that correct?

Hi @Ukiman1014 


i don't know a process for list columns to become automatically a managed property. 

 

In practice you need a SharePoint governance. When you like documents or items from different sites or libraries in one search, you need to use the content type hub to rollout the same column on different places....or create site columns, as admin.

 

When nobody should be create columns, do not give permissions to others for that, only contribute, but not edit permission. With that users can manage content, but not new columns

 

Here are more about permission levels: https://docs.microsoft.com/en-us/sharepoint/understanding-permission-levels?source=recommendations


When you like, that users can create their own lists and columns, give them a training and define a governance, what they can do and when they need to use company terms from the tenant level term store.

 

Good luck.

 

Regards, Dave

Thanks, Dave. I just wanted to be sure there wasn't some way to easily convert a user-created column to a managed property.

To be honest, users don't really create columns very often at all, but I'll take locking things down under advisement. It hasn't caused any issues until this point.

@David Mehr I would like the PnP search results web part to display all items in Site Pages with a certain managed property, unless a value is entered in the PnP search box, then I'd like those results to be displayed (still filtered by the managed property).  I think of it like the default search field would be a wildcard unless another value is entered.  Is that possible?

Hello @Ukiman1014 

 

i'm not sure i understand you correctly, but i try...

 

I have configured the Refinement filters in the search results web part, i will only show elements with RefinableString00 is MWCP.

My Query in Refinement filters: RefinableString00:equals("MWCP")

DavidMehr_0-1663156605621.png

 

After that configuration, the filters is set to Event MWCP, it's mapped to RefinableString00 in my environment, but you can also enter your search terms into the Search Box. The results web part will use MWCP and your Serach terms:

DavidMehr_1-1663156679028.png

 

Is that, what you looking for?

 

Regards, Dave

Thanks @David Mehr. I had found a different way to go about it, without using the PnP search filters web part. The reason I did this is because it's such a limited search already that there's really no need to filter further.  On the first page of the search results, I specified the search terms from the search bar and my refinement filters.

Ukiman1014_1-1663709435507.png

On the third page, I entered a default value of "*".  

Ukiman1014_2-1663709474224.png

This seems to work well, other than it does show results for "*" at the top.

Ukiman1014_3-1663709524751.png

 

Thanks again for your help!

-Steve

 

 

@David Mehr, I have this working pretty well, but I'm running into an issue that might be a limitation.

 

There is a repository of site pages that I need to display in the order of a date field, "Date Published", which I created and made a managed property.  (I can't sort by the built-in date created or modified fields, or I would have just used the highlighted content web part.)

 

I can't seem to get PnP Search Results to sort by that field.  I can see the field, "DatePublishedOWSDATE", in the list of fields to filter, but it doesn't display in the list of fields for sorting.  I've tried to manually enter it in, including the managed property it's mapped to, "RefinableDate00", but that gives an error.

 

Is there some special way to get it to sort by a managed property date field?  Or is sorting only limited to RefinableString fields?  If so, how can I sort by a custom date field?  Basically, the page is a copy of the contents of a weekly newsletter, so the "Date Published" field is when the content was originally sent out, not when the page was created.

Hello @Ukiman1014 

 

i have created a custom date field in the page library:

DavidMehr_1-1666079247248.png

 

 

And mapped to the RefinableDate00, it's not possible to create your own date managed property, you need to map it to a default:

DavidMehr_0-1666079120697.png

 

In my result web part (PnP Serach 4.8.0 Beta ;) ) i have configured the sort field, i have typed it manual and saved it:

DavidMehr_4-1666079407442.png

 

Also i have added the property as column for the visualization:

DavidMehr_3-1666079398092.png

 

It works fine with this configuration and i can sort to the custom date field.

 

As special way you can try to create a result source and sort by your custom field. Then use your result source in to your result web part. 

 

Beste regards, Dave

Thanks, Dave. I've done the same thing, but for some reason it's just not sorting by that property. I am not sure if maybe I created it in the wrong way or something. I am starting over to see if it helps.

I need to ask another question. What is the proper way to upgrade from version 4.7 to 4.8? I tried uploading the newer version to the SharePoint App Store but it didn't upgrade. It said that the name needed to be the same. I wasn't sure if it literally meant the file name. I didn't want to break anything, so I just deleted the beta app.

One more question, LOL. How can I get my new date property to show up in the search results? I tried modifying a few things but I couldn't figure it out. Is there a simple way to do that? This can be very frustrating.

Hello @Ukiman1014 

 

ok, I am confident that you will succeed :flexed_biceps:

 

Update

Yes, use the same name and the solution will be updated. Best way is to do your procedure on a test tenant.

 

Show up property in search results

As first you need to add your new property to the selected properties (PnP - Search Results Web Part on page 1) and press enter:

DavidMehr_0-1666259550160.png

 

 

After that you can choose and add your new property under managed columns (PnP - Search Results Web Part on page 2):

DavidMehr_1-1666259613813.png

 

Hope this helps.

 

Best, Dave

Thanks, @David Mehr.  Oh how I wish I had a test tenant here :crying_face:.  Unfortunately PnP Search is currently broken for me.  Opened a GitHub issue: Failed to load component "544c1372-42df-47c3-94d6-017428cd2baf" (pnpSearchResultsWebPart) - The file...

@Ukiman1014 - you can to it with https://cdx.transform.microsoft.com

 

More Information :backhand_index_pointing_right: https://www.solutions2share.com/create-an-office-365-test-tenant/

 

Best, Dave 

@David Mehr, thankfully my PnP Search Results CDN issue resolved itself over the weekend :smile:.  The sorting issue also sorted itself out! :stareyes: I really am not sure what resolved it, other than possibly the upgrade to 4.8 (which really was deleting 4.7 and installing 4.8).  Both the original managed property and the new one I created can be used to sort the results, so at least it's nice to know that I didn't make some kind of mistake the first time.

 

That's good to know that I could create my own test tenant pretty easily, though I assume I'd need to use my personal Microsoft account, as it would be frowned upon by my employer.  Too bad I would only be able to use it for 90 days (for free).

What exactly would I be able to do with https://cdx.transform.microsoft.com?  When I click the link I'm told my account doesn't have the appropriate access level.