Friday, December 16, 2011

Things to do when a Umbraco site goes live

1.    Set release mode in visual studio for any projects and then compile and deploy DLLs.
2.    Configure a 404 page. Set the ID of the error page in /config/umbracosettings.cofig file. The following section need to be modified –
<errors>
            <!-- the id of the page that should be shown if the page is not found -->
            <!--        <errorPage culture="default">1</errorPage>-->
            <!--        <errorPage culture="en-US">200</errorPage>-->
            <error404>1</error404>
</errors>
3.    Also change the notification section in the /config/umbracosettings.config file. This email address (from address) will be used by Contour as well.
<notifications>
            <!-- the email that should be used as from mail when umbraco sends a notification -->
            <email>info@barangaroo.com</email>
</notifications>
4.    Add google analytics for the site
5.    Add google mobile tracking for the site. To add the ga.aspx page in the root, the ga.aspx page need to be added to the following line in the web.config file (appSettings section). <add key="umbracoReservedUrls" value="~/config/splashes/booting.aspx,~/install/default.aspx,~/config/splashes/noNodes.aspx,~/ga.aspx" />
6.    Set umbraDebugMode to false in the web.config file (appSettings section)
<add key="umbracoDebugMode" value="true" />
7.    Set customerrors mode="RemoteOnly" in web.config file
8.    Set debug to false in the web.config file
9.    In the system.web/trace section set enabled to false
10.    Modify the connection string in web.config file according to the live server credentials
11.    To reset the ClientDependency cache, delete the ClientDependency folder from App_Data
12.    If there are any form built by Contour package, use the following regex to validate the email.
\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*
13.    Change the admin password to something very strong password.

Friday, February 18, 2011

Compare date in XSLT for Umbraco 4.5

Simply compare dates in the XSLT (umbraco 4.5).

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> ]>
<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" xmlns:umbraco.contour="urn:umbraco.contour"
exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets CWS.Twitter umbraco.contour ">

<xsl:output method="xml" omit-xml-declaration="yes" />

<xsl:param name="currentPage"/>

<!-- Don't change this, but add a 'contentPicker' element to -->
<!-- your macro with an alias named 'source' -->
<xsl:variable name="source" select="/macro/source"/>
<xsl:variable name="numberOfItems" select="/macro/numberOfItems"/>
<xsl:variable name="datenow" select="umbraco.library:CurrentDate()" />

<xsl:template match="/">

<!-- The fun starts here -->
<ul id="whatsOnButtons">
<xsl:for-each select="umbraco.library:GetXmlNodeById($source)/* [@isDoc][((eventFrom!='') and umbraco.library:DateGreaterThanOrEqual(eventFrom,$datenow))]">

<!--<xsl:sort select="@updateDate" order="ascending"/>-->
<xsl:sort select="eventFrom" order="descending"/>
<xsl:if test="position() <= $numberOfItems">
<li>
<a href="{umbraco.library:NiceUrl(@id)}"><xsl:value-of select="eventHeading"/></a>
</li>
</xsl:if>
</xsl:for-each>
</ul>

</xsl:template>

</xsl:stylesheet>

Sunday, January 9, 2011

Windows command

Found a great link about commands in windows. Finds the link below -
http://en.kioskea.net/faq/403-command-prompts-for-windows#control-panel

Thursday, December 23, 2010

Manual Umbraco installation (step by step)

Note: I run the following to install Umbraco in IIS6 (Umbraco 4.5.2 for .Net 3.5)

1. Download Umbraco (http://umbraco.org/download). Download the manual installation one.
2. Unblock it by clicking the properties of the zip file and unblock it
3. Copy files from the build folder from the zip file and paste those to the web folder in the IIS
4. Set permission of the folders (Create a batch file with the following script and copy it to the root folder of the site)
(get the below script from the location below - http://our.umbraco.org/wiki/install-and-setup/set-umbraco-folder-permissions-from-command-line )

:: Hope you enjoy this one
:: Sets up the right folder permissions for Umbraco to run
:: Inspired by http://blog.mattbrailsford.com/2010/08/01/adding-a-windows-context-menu-item-to-set-umbraco-folder-permissions/
:: from the boys at Offroadcode.com
ECHO OFF
SET which_user="%computername%\ASPNET"
ECHO ON
cacls "%CD%" /E /G %which_user%:C
cacls "%CD%\app_code" /E /G %which_user%:F
cacls "%CD%\app_browsers" /E /G %which_user%:F
cacls "%CD%\app_data" /E /G "%which_user%:C
cacls "%CD%\bin" /E /G "which_user%:R
cacls "%CD%\config" /E /G "which_user%:C
cacls "%CD%\css" /E /G "%which_user%:C
cacls "%CD%\data" /E /G "%which_user%:C
cacls "%CD%\masterpages" /E /G "%which_user%:C
cacls "%CD%\media" /E /G "%which_user%:C
cacls "%CD%\python" /E /G "%which_user%:C
cacls "%CD%\scripts" /E /G "%which_user%:C
cacls "%CD%\umbraco" /E /G "%which_user%:R
cacls "%CD%\usercontrols" /E /G "%which_user%:R
cacls "%CD%\xslt" /E /G "%which_user%:C
cacls "%CD%\web.config" /E /G "%which_user%:C
::Uncomment below if testing
::PAUSE

5. Run the batch file to set the permission to the folder (For IIS 7 see the section “Setting Permission for AppilcationPoolIdentity” - http://our.umbraco.org/wiki/install-and-setup/set-umbraco-folder-permissions-from-command-line )
6. Create a website in IIS (not virtual directory).
7. Create a separate application pool for Umbraco
8. Click website properties in the IIS and click on the ASP.NET folder and make sure that the ASP.NET version
9. 2.0.50727
10. Create a database in SQL server
11. Set a username and password for the database
12. Run the default.aspx file from the root folder now
13. User the same database name and user credentials that you created in the SQL server
14. Now follow the instruction on screen to complete the installation

Happy Installing :)

Sunday, February 14, 2010

Add a identity column in the table in a database

alter table CustomersTest add ID int identity


CustomerTest is the table name and ID is the column name