Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > How do I add plain, clean html and xml files? View modes: 
User avatar
Member
Member
rlull - 1/2/2014 11:33:16 AM
   
How do I add plain, clean html and xml files?
I want to add a folder to the root of our site. Within this folder I want to add 2 html and 2 xml files that don't inherit any content from the master page.

I've tried several approaches and even though I select the option to NOT inherit content on the page template, it still renders all of the ancillary html, js and css to the browser even though it's not visible - you can see it when you view source. I want plain, clean xml and html.

Is there an easy way to do this through CMS desk? I know I can do it through Visual Studio but prefer to handle it through CMS desk so I can push changes out through the staging module.

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 1/2/2014 11:50:13 AM
   
RE:How do I add plain, clean html and xml files?
Create a new template and mark it as a master template. Then in your content tree create a page using this new template and put all your pages below it inheriting nothing. Create a stylesheet (with as much or as little styles as you need) and in the page's general tab, select the stylesheet for it. You're still going to get some of the asp.net content rendered because it's an asp.net website and not a straight HTML page. If you want straight HTML, then you'd have to create the page manually outside of the CMS.

User avatar
Member
Member
rlull - 1/2/2014 12:02:24 PM
   
RE:How do I add plain, clean html and xml files?
Thx. I tried the approach you suggested but it's not as clean as I'd like. Looks like I'll have to go the other route.

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 1/2/2014 12:59:31 PM
   
RE:How do I add plain, clean html and xml files?
Then you'll have to manually add the files in the file system. Make sure you put them in a sub directory and ensure in Site Manager that Kentico doesn't process them. You can add the path and/or file in SiteManager>Settings>URLs & SEO>URL Format>Exclued URLs.

User avatar
Member
Member
rlull - 1/2/2014 1:18:08 PM
   
RE:How do I add plain, clean html and xml files?
Thx, again. Will do.

You know what would be handy is a way to create a custom document type that would render pure HTML or XML to the browser via a text writer or something along those lines. Probably not necessary for a typical CMS user but from a developer standpoint, might be useful. I'm sure it may be possible to create a custom user control do something along these lines but may not be worth the LOE.

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 1/2/2014 1:40:23 PM
   
RE:How do I add plain, clean html and xml files?
Pretty sure a custom webpart would be the best bet for that. In fact, if you look at the Custom Response webpart, I think it does something similar. /CMSWebParts/General/CustomResponse.ascx. You might take a look at that before you get to excited about creating an HTML page.

User avatar
Kentico Legend
Kentico Legend
Accepted solutionAccepted solution
Brenden Kehren - 1/2/2014 2:02:15 PM
   
RE:How do I add plain, clean html and xml files?
Just tested the Custom Response webpart and it worked like a charm. I set the properties as follows:

Content type: text/html
Encoding: UTF-8
Status code: 200
Content disposition: <blank>
Content:
<html>
<head>
<title>Testing Page</title>
</head>
<body>
<h1>Just a test</h1>
<p>To see how I can get my HTML to render clean in Kentico</p>
</body>
</html>

If you plan to do this often, create a webpart that uses an editable text control and allows the user to select either HTML or XML as a content type and simply render it as the webpart does now. Sounds like a quick simple challenge to me if you don't want to do it, I'll create one and submit it to the Marketplace. :)

User avatar
Member
Member
rlull - 1/2/2014 2:03:55 PM
   
RE:How do I add plain, clean html and xml files?
Awesome! I tried the same thing with XML and it worked as well. Thanks, FroggEye!