Posts

Showing posts from May, 2012

Umbraco - C# - Redirect a Umbraco Page to an external web site.

Umbraco - C# - How to Redirect a Umbraco Page to an external web site. Two create a redirect from a Umbraco page to an exteral site you need to:   (this is very simple)

 Step 1) Add the page to Umbraco that you want to rediect. (You may want to Hide this page from navigation)

 Step 2) Create a new Web Form in C# Visual Studio
     (this web form will be placed in the route of the site)

 Step 3) Update the Web Config to include the new file mentioned in step 2
     (or you will get a Server error in appliaction)

 Step 4) Add a Url redirect to the UrlRewriting.config,  from the Umbraco page (created in step 1), to the web form (created in step 2).

Step 2: Here is the C# Code (my-redirect-example.aspx) form for step 2: (it is basically a blank form)

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="my-redirect-example.aspx.cs" Inherits="my_redirect_example" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" &qu…

Umbrcao - Macro - .Net - c# - Create a one time Pop Up in Umbraco using c# to display a message about cookies

Umbrcao - Macro - .Net - c# - Create a one time Pop Up in Umbraco using c# to display a message about cookies
Two create a One time pop up in umbraco to display a message, For example to warn that your site uses cookies, you need to.

1) Create a .Net user Control.
2) Add the .Net user Control to Umbraco Macros
3) Add the Macro to your Main Page Template, so that it displays on ever page.

Here are two methods for doing the one time pop up.  

The first method displays on every page until the user clicks "Click here to remove this message".  Clicking on "More information about cookies" will take them to the a page displaying your Privacy section, but will not remove the message.

The Second method displayed once and the user does not have to click anything. The message will appear on any page the user first lands on and then not be shown again.

Method 1 For Creating a One time Pop up warning about Cookies being used: 1) Create a user control called "WeUseCooki…

Umbraco - Google Maps - XSLT - Macro

The Following Macro allows you to insert a Google Map on any Umbraco Page:


1) Create a XSLT file and accopanying Macro called "GoogleMap.xslt":

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
<xsl:stylesheet
  version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:msxml="urn:schemas-microsoft-com:xslt"
  xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" xmlns:CWS.Twitter="urn:CWS.Twitter"
  exclude-result-prefixes="msxml umbraco.library Exslt.…

Umbraco - RSS Feed for every page.

Part 1: Create A XSLT Macro for RSS Feeds:

a) Create a new XSLT Macro and Select 'RSS Feed' for the template.  Call it RSS.

b) Ammed the line that starts <xsl:variable name="SiteURL" to what ishighlighted below to create a feed on every page:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
  version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:rssdatehelper="urn:rssdatehelper"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
  xmlns:msxml="urn:schemas-microsoft-com:xslt"
  xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.…