Create Modern Page inside custom library in SharePoint Online - sharepoint-online

I am using ConvertTo-PnPPage function in PnP PowerShell to convert classic page to modern page. I saw that if the page is inside Site Assets or any other custom library, then after conversion the page is created inside Site Pages library and within a folder named with the library name.
Can we create/convert modern page in the same library where the source page is present? Or Is there a restriction that modern pages are only available in Site Pages library? I tried finding about this in the documentation. But couldn't find related information.
Thank you!

Related

How to add pre-generated HTML pages in Kentico 13

My Designing team use to generate static HTML pages (html files, css, JS, fonts etc) and use to share zip with us.
We are looking forward to add these pages in Kentico 13 Core.
I have created the custom page type having one field of type File.
Use to upload pre-generated HTML file from Pages app using above created page type.
But it use to attached as attachment and dont use to show contents. It did work with Kentico portal engine but didnt find ant option under Kentico 13 Core.
Please help!!
It's not entirely clear to me what type of behavior you are looking for, but if you are expecting to be able to customize HTML, CSS, and JavaScript in Kentico Xperience or Kentico 12 MVC the way it works in Kentico Portal Engine, that's just not possible.
Using MVC requires either:
Templates be coded ahead of time in Razor .cshtml files
Templates be designed as composable pieces that can be built up as Page Builder components (like Sections, Widgets, Page Templates)
Content Managers then will create Pages in the Content Tree and add their content to those Pages. Those Pages either have Razor Controllers/Views associated with them to render their content (and related content) or use the Page Builder to combine components that display content.
If you want to display Attachments in a Page, you can follow the instructions in the documentation.
If you want Content Managers to be able to upload HTML, CSS, and JavaScript files to be displayed/rendered on the site, you'll need to come up with a custom solution - potentially using Media Libraries and a custom coded solution.

New pages aren't being published to the right library (SharePoint 2010)

I created a new pages library, "News Pages", on one of my subsites.
Beforehand, I created some custom site columns, added those to a site content type, and then created a new page layout using those site columns. This page layout is used by default when a new page is created.
But when I create a new page, fill out the fields and publish, it's appearing in the subsite's default "Pages" library, NOT my "News Pages" library.
How would I go about changing my setup so that any new pages are published to "News Pages" library instead?
The SharePoint Publishing Infrastructure is built to handle only one Pages library per web site. This means that you will run into problems trying to add an extra library (believe me, I've tried ;))
The only way to have multiple pages libraries is to create a sub site and use it's pages library.

How to using SharePoint sdk grab data from pages library?

what is the best practice on how to programmatically get the pages data from multiple pages libraries (from different subsite)
please provide me some link on that, thank you.
Use a SPSiteDataQuery
Depending on the type of the page you could filter via the content type (e.g. "WelcomePage") or for all page types via the file extension "aspx".

Sharepoint Site using PHP code

I realise that Sharepoint in asp .net based but I have a PHP application that a user wants me to include in a Sharepoint site.
So is it possible to use PHP code inside sharepoint?
danit, when you say 'include' in the site, would it mean to be part of the site chrome (like inside the same menus etc) or just live connected with links would suffice?
I ask that because you can run php code under an IIS site but that would only keep the pages separated inside the same virtual host. if you need to actually join the functionalities you can:
Fake it with an iFrame (Page Viewer Web Part pointing to the php site for example).
you'll have to use some interop like webservices. It really comes down to what you want to do and not to if it is possible.
This is also possible by creating a web part page and adding a page viewer web part. You can link to the page, making it visible within the Sharepoint site, but it won't offer any interaction with Sharepoint itself.
Sharepoint treats the page as a shared document, however, so you can restrict access to it. I have done this in order to offer access to 'view only' content such as reports, but you can also use it for custom php apps that rely on a database other than the one(s) Sharepoint is using.

How to provision a custom page without using the _layouts directory?

I need to provision a custom aspx page which does some work and then redirects to another page. Using a _layouts page, AKA an application page won't work since I only want this page accessible to one site collection.
I looked at using pattern #4 from blog post Application Development on MOSS 2007 and WSS V3. It feels pretty hacky, and it asks you to drop the DLL. Drop it into the bin of the site collection, and upload the file through SP Designer.
I'd rather have this page be a feature that gets included in my site definition or stapled to an existing site definition. I imagine I could use a feature receiver to deploy the files to the pages SP list. One of the comments on the blog post says as much:
Pardon my ignorance on this maybe I am
missing the point completely but
wouldnt it be easier to deploy your
custom pages by programmatically
adding them to the pages splist?
I basically, had a simple .aspx page
with a user control. I deployed it via
this method.
How can a custom page be provisioned without using a _layouts page?
I guess another option is to keep using a _layouts page, but make sure the referrer is correct.
Besides application pages, you also have the possibility to create site pages.
Site pages are in nature related to application pages, but they reside in a site not in _LAYOUTS.
The welcome page (default.aspx) is an example of such a page.
In the same way as with application pages, it is possible to do codebehind in these pages (check out AC's article on this subject, Using ASP.NET 2.0 Code Behind Files in SharePoint v3 Sites)
You can read this article regarding the subtle differences between application pages and site pages: SharePoint Application and Site Pages - Part 1 of 2
You deploy this custom page using a feature, where you specify the file as ghostable (look at the example in ACs article).

Resources