How to add pre-generated HTML pages in Kentico 13 - kentico

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.

Related

How I can save a Page in a Page Template in Kentico Xperience13

In Kentico Xperience13, when I go in the Page Template application they said we need to use the Page Application to create a page and save it as a Page Template. But when I create a Page I don't see the place where I can save as a Page Template. So when I came back in the Page Template application the list is always empty.
To use Page Templates in Kentico Xperience 13, you either need to create default templates through code - see Developing page templates, or you can save widgets that have been added to a page as a custom page template - see Saving pages as custom page templates
As someone currently working on a site in Xperience 13, you may want to consider taking a class or two on Pluralsight to give you the basics of MVC and .net core. I am new to those but have been using Kentico for over 10 years. This change to MVC has been a bear to learn. But the Pluralsight courses have helped me get a better understanding of the structure.
Kentico does use content based routing as an option (and I think it is default in 13) you can learn more about it here https://docs.xperience.io/developing-websites/implementing-routing#Implementingrouting-Contenttree-basedrouting
when you build page types you don't have to worry about the model and the controller portion, kentico handles it, you just need to build the view.
this tutorial covers the basics https://docs.xperience.io/13tutorial/asp-net-core-development-tutorial

Using Kentico CMS with pre-generated HTML

I have a huge amount of content that is in pre-generated static html pages. I am working with an organization that runs their web site using Kentico (11) on IIS. They wish to host the pregenerated HTML, but to have a consistent look and feel on the pre-generated pages.
Is there a way to includes tags etc inside the pre-generated html that gets kentico to process the content to give the standard look and feel for the website, without having to convert the content (potentially 100k+ pages) to normal kentico content (it just doesn't seem like a feasible approach, since the content is refreshed from the source regularly)
There is definitely no out of the box way to that. I also agree it is not a great approach overall. However, if someone was very determined to make it work and if you really had to, custom programming could make that happen.
You could create some custom logic and use the Kentico API (maybe in a scheduled task if the content is periodically refreshed). The custom code could possibly build out a content tree that is based on the folder structure of the files (if portal), or build out some routing logic (if mvc) to route requests. Those requests that match the ~/filename.html could then be intercepted by Kentico and your custom code, read the contents of that filename.html from disk, and use it as a datasource type of webpart (if portal engine) or a repository / model (if MVC), then use that info to populate the presentation layer of the response of the final html to the browser. That way you could wrap that pre-generated content in a master page with some level of control of what the header and footer look like (if portal engine) or a shared layout (if MVC).
Again, I don't recommend it. It might be very slow and tedious to attempt as well as have performance and scalability issues.
It could be a cleaner approach to somehow get that content into a SQL database and then use standard programming to deal with it in the Kentico layer / website.

Importing a static website on to Kentico CMS

I've been developing an static website (just html, css and js files) for a client who now wants to load the site on to Kentico CMS.
I don't know anything about this CMS. Is this a practical way to import the completed code into this system?
Thanks.
I would do things the way Kentico expects.
Take your header/footer and put them into the master page (template).
Take individual template HTML and create Layouts and Templates from them.
Use Kentico Web Part where possible
For dynamic content areas, use the Editable Content Web Part.
For the menu use the CSS Menu Web Part.
Use the Portal Engine technique. Don't use ASPX pages unless you really have to.
Here is some documentation from version 8: https://docs.kentico.com/display/K8/Creating+portal+engine+master+pages.

Duplicating web content for several pages

I'm using Liferay CE 6.1 ga3, I finished developing themes + structures + templates for my pages now this is my problem:
I have to create several empty pages for the writers to fill content, I'm wondering if there is any manipulation to create pages with empty web content (only structure + template specified) so the writer have just to log and and edit the content for exp:
I have 80 pages that have header + product description + footer I have to create the 3 web contents empty for every page that is very exhausting.
It shouldn't be too hard to implement custom code to do this. As a starting point I recommend the 7cogs sample code. You might need some adoption to newer API versions, but in general I see it as the easiest way to learn about Liferay's API.

Which is the Liferay equivalent of a IBM WebSphere Portal / WCM Menu?

I've developed with WPS and WCM for several years and now I am also learning Liferay. I can't help but compare the features and I understand that in Liferay some things are done differently.
I would like to know the best practices to manage the following simple example:
A simple page with a carrousel with several images and links
Google analytics inserted in the page (Reusable in most pages)
The following is how I'd solve it in IBM WPS:
A HTML component with the Google Analytics code that is called in every page (I can't find how to do this in Liferay)
A content definition of an image and a link.
Create several contents for each image and link.
Create a menu that shows the list of content in the form of a carrousel (I can't find how to do this either in Liferay)
I am aware that Liferay has a list portlet and content that has repeatable items. I know I could use these, however its much more usable if I can have on content for each image/link and one reusable HTML snippet of code.
How should I solve this in liferay in the most efficient way?
Thanks!
You have to use Liferay Web Content portlet for creating the carousel. This is available in Control Panel. For your particular requirememnt you have to create a dynamic web content, which involves using of Velocity language and javascript to iterate over a set of images. Infact if you see Liferay's website, the home page has this kind of stuff.
For Google Analytics there are two ways. Liferay is not just meant for creating one site, it caters creation of multiple sites. Each site has a group of pages. You can create site from Control panel again. In the site settings you have this option to add google analytics id. So with each site can have different google analytics id.
If you want to do it at a global level, we add the google analytics script snippet in the Theme of liferay.
To get a better understanding of all the jargons used in Liferay, you have to atleast go through Liferay's documentation. And while going through it you have unlearn what you have previously learned. Liferay has hell lot of features than Websphere portal.
http://www.liferay.com/documentation/liferay-portal/6.1/user-guide

Resources