I have a function who list me all the page in a site with a Rooturl.
But we are on a multisite instance and i don't know how to filter on a specific site .
I tried to change the provider for the page manager but i don't know how to do it .
Please try to use the sample code from the below KB article in order to filter the pages by a specific site in a multisite project:
Hi Sabrie ,
thank you very much.
It works .
But why do you use this line ?
pageManager.Provider.SuppressSecurityChecks = true;
By design in order to create content through the API the user should be logged in as administrator in the backend of the project.
If you are not logged as administrator you can set the SuppressSecurityChecks property of the provider to true, in order to skip the permissions check of the provider and to be able to execute the code with anonymous identity.
However, in your case you can comment out the lines that set the SuppressSecurityChecks property since in the sample code we query pages from the database and this code can be executed by an anonymous identity. I updated the KB article accordingly.