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.
saDx
ReplyDeleteIt is able to craft high-quality results through a collaborative and open process. The team is creative, talented, and responsive.
ReplyDeleteuser experience consulting
Experts at app development, they provides useful feedback and sets realistic goals.
ReplyDeletebranding San Francisco
There were no delays, and everything was done according to the schedule
ReplyDeleteUX research companies
Outstanding blog, in my opinion site owners should acquire a great deal out of this blog its very user welcoming.
ReplyDeletetop UX designers