Surendra Sharma

Surendra Sharma

Search This Blog

Thursday, April 30, 2015

How to add HTML page in Sitecore?

My client requested to add HTML page in Sitecore project and link it to one of the item in footer. I asked to myself WTF, what kind of requirement is this? How to do this?

But finally I completed this. Here are the quick steps.

1. Add HTML page in any folder of your .NET project. Let’s say it is "/HTMLPages/faq.htm"
2. Add complete path of this HTML page in “IgnoreUrlPrefixes“ in web.config file so that Sitecore should not process this page request and ignore it. Let’s ASP.NET should serve this page request without using Sitecore.

<setting name="IgnoreUrlPrefixes" value="/sitecore/default.aspx|/trace.axd|/webresource.axd|/sitecore/shell/Controls/Rich Text Editor/Telerik.Web.UI.DialogHandler.aspx|/sitecore/shell/applications/content manager/telerik.web.ui.dialoghandler.aspx|/sitecore/shell/Controls/Rich Text Editor/Telerik.Web.UI.SpellCheckHandler.axd|/Telerik.Web.UI.WebResource.axd|/sitecore/admin/upgrade/|/layouts/testing|/HTMLPages/faq.htm"/>

3.    Specify this page in General Link field of Sitecore item. But the problem is it’s neither the internal link nor the external link. So how to provide the link so that it should take protocol and domain name automatically.

Here I use the Insert JavaScript option of General Link field as

javascript:window.open(window.location.protocol + "//" + window.location.host   + '/HTMLPages/faq.htm');

Here is screenshot of the General link field setting



Now when it renders, the item open this page in new window and take this page as a part of current website.

Sometimes client requirement plays a major role to improve our skills.

Please leave your comments or share this trick if it’s useful for you.

5 comments:

  1. It is able to craft high-quality results through a collaborative and open process. The team is creative, talented, and responsive.
    user experience consulting

    ReplyDelete
  2. Experts at app development, they provides useful feedback and sets realistic goals.
    branding San Francisco

    ReplyDelete
  3. There were no delays, and everything was done according to the schedule
    UX research companies

    ReplyDelete
  4. Outstanding blog, in my opinion site owners should acquire a great deal out of this blog its very user welcoming.
    top UX designers

    ReplyDelete