Want to help develop Google Maps Umbraco package?

There are 2 outstanding bugs in the Google Maps for Umbraco package. Would you like to help us fix these bugs and collaborate on the project?

My current workload is high and I am aware that there are 2 major bugs that need fixing on the Google Map data-type. With my heavy involvement on the uComponents project, it’s unlikely I will fix these bugs any time soon, hence the ‘call for help’.

If you have been wanting to get more involved with the Umbraco community and earn some karma, this is an ideal way to get involved.

The Google Maps data-type source-code is available on my BitBucket repository, feel free to make a fork and submit any pull requests!

Update: Sam Moore came to the rescue and squished the 2 bugs! #h5yr Sam!

Posted in blog | Tagged , , , | 6 Comments

uComponents: 100 karma votes and 10,000 downloads!

Very proud and happy to announce that uComponents has reached 100 karma votes and 10,000 downloads! (that’s not including the additional 4,000 download from our CodePlex project)

A huge thank you to the uComponents team for developing a great set of Umbraco components – and an even bigger THANK YOU to the Umbraco community for use it! #h5yr

Posted in blog | Tagged , , , , , | Leave a comment

uComponents: Render Macro data-type

Developed a new data-type for uComponents called Render Macro. Watch the screencast for a brief demonstration.

Posted in blog | Tagged , , , | 2 Comments

WordPress 3 Plugin Development Essentials

wordpress-3-plugin-development-essentials It has been a while since I last developed a plugin for WordPress. With the release of version 3, I have been eager to learn about new improvements with plugin development. Having recently got hold of a copy of WordPress 3 Plugin Development Essentials (Packt Publishing, 2011), I’ve shaken the dust off my WordPress skills!

Whether you are a newcomer to WordPress, as long as you have some basic PHP knowledge, WordPress 3 Plugin Development Essentials provides a good solid foundation for how to develop your own plugins for WordPress. The book provides practical hands-on tutorials, best coding guidelines and good architecture advice for developing original plugins.

The first two chapters are aimed to ease you into preparing for WordPress, understanding the framework, setting up a development environment and an anatomy of a plugin.
Next few chapters are examples of specific plugin functionality. With the remaining several chapters focusing on the deployment, distribution and maintenance of your plugins.

If you are looking to get into plugin development, I’d recommend picking up a copy of WordPress 3 Plugin Development Essentials – while it is not intended to teach you PHP or MySQL, there focus is more on the core concepts, so even regular users of WordPress can delve into making their own basic plugins.

Having previous read (and reviewed) WordPress Plugin Development: Beginner’s Guide, (Vladimir Prelovac, Packt Publishing, 2009), there are many similarities between both books. I’d say that WordPress 3 Plugin Development Essentials offers a broader scope and range of topics.

In particular I was impressed with the level of detail on how to use Subversion (Chapter 8), especially with how to overcome various errors and reverting to previous versions.

Standardized Custom Content (Chapter 6) is also a good resource if you are interested in pushing the boundaries of WordPress towards being a custom content management system.

Having had a fair amount of experience with developing WordPress plugin in the past, I was already familiar with most of the concepts – this book helped to reinforce those principles. If you are interested in learning more how to develop your own WordPress plugins, I would recommend that you pick up a copy of this book.

Posted in blog | Tagged , , , , , | Leave a comment

Discounts on WordPress books during June at Packt

Packt Publishing are having a special discount on their range of WordPress books during June. If you are doing WordPress development or are interested in starting out, then take a look at their selection.

They’ve just released “WordPress 3 Ultimate Security“, which should be essential reading for anyone wanting to protect their hosted WordPress installs!

To see the discounts, go to Packt’s WordPress Month page.

| Tagged , , , , | Leave a comment

Running Umbraco from a USB drive

With the release of Umbraco 4.6 (Juno), users now have the option of using Microsoft’s new embedded database engine, SQL CE 4. This means that you don’t need to depend on using a database server (such as SQL Server [Express] or MySQL), you can run Umbraco exclusively from the file-system!

Also recently released is IIS Express 7.5, (another Microsoft web technology, as part of their WebMatrix framework), which offers a lightweight version of IIS – aimed at developers as a replacement for the Cassini web-server.  One of the major features of IIS Express are that it can be launched straight from disk – it does not need to be registered/configured on the operating-system/machine.

Now, this got me thinking… Would it be possible to run Umbraco from a USB drive? Well, guess what?

Best of all its very very easy to do… here’s how:

  • Download and install IIS Express 7.5 and SQL CE 4 – the quickest and easiest way is to install WebMatrix.
  • Download Umbraco 4.6.1 (latest version at the time of writing) and also the “SQLCE4Umbraco.dll” assembly.
  • Copy the following to your USB drive:
    • Extract the Umbraco zip file, rename the “build” folder to something else – like “wwwroot”, then copy that to the USB.
    • Copy over the “SQLCE4Umbraco.dll” into the “wwwroot\bin” directory.
    • Copy the “IIS Express” directory (typically found at “C:\Program Files (x86)\IIS Express”) to the USB.
    • Copy the SQL CE 4 binaries (typically found at “C:\Program Files (x86)\Microsoft SQL Server Compact Edition\v4.0\Private”) - also copy the “amd64″ and “x86″ sub-directories - to the “wwwroot\bin” on the USB drive.
  • Once everything is in place, you should have 2 root directories, “IIS Express” and “wwwroot”.
  • Open up a command prompt, run the following command:

"E:\IIS Express\iisexpress.exe" /path:E:\wwwroot /port:8080

  • Open a new web-browser window, go to “http://localhost:8080″.
  • If everything went to plan, the command prompt will display an output of all incoming requests.
  • Back in the web-browser window, you should be prompted with the Umbraco installer wizard.  If not, something went wrong! :-(
  • Remember to used the SQL CE 4 database engine!!! (otherwise it wont be portable)

Once I had successfully installed Umbraco, I tried out a few packages; e.g. uComponents, set up an MNTP data-type, which worked as expected! Great!

After that I removed the USB drive; booted up my old laptop (Windows XP SP3) to see if it would still work.  First try it failed! I didn’t have .NET 4.0 framework installed.  Once I installed it, re-ran the command prompt – portable Umbraco worked as expected!

One point to raise is that I did notice slower performance of the Umbraco back-office – which doesn’t surprise me – since I was using a fairly old USB drive, but still the lag wasn’t enough to be overly concerned about.

Personally I see the portability of Umbraco to be very useful for client/customer demos/meetings… for any Umbraco developers who want to showcase their favourite CMS, now there is no excuse not to have a working copy in your pocket!

Posted in blog | Tagged , , , , , , , | 15 Comments

How to use umbraco.library GetMedia in XSLT for Umbraco v4.5

This is a quick follow-up on my previous blog post: “How to use umbraco.library GetMedia in XSLT“.  At the request of fellow Umbraco South-West UK developer, Dan, that I should update the code snippets for the new XML schema in Umbraco v4.5+

First a quick notice; if you are using v4.5.0, then please upgrade to v4.5.1, as there was a tiny bug in GetMedia that caused great confusion and headaches – you have been advised!

Without further ado, the updated XSLT snippet that you came here for…

<xsl:template match="/">
	<xsl:variable name="mediaId" select="number($currentPage/mediaId)" />
	<xsl:if test="$mediaId > 0">
		<xsl:variable name="mediaNode" select="umbraco.library:GetMedia($mediaId, 0)" />
		<xsl:if test="$mediaNode/umbracoFile">
			<img src="{$mediaNode/umbracoFile}" alt="[image]" height="{umbracoHeight}" width="{umbracoWidth}" />
		</xsl:if>
	</xsl:if>
</xsl:template>

Any questions? Come join us over at Our Umbraco… we are a friendly bunch!

Posted in blog | Tagged , , , , | 9 Comments

ASP.NET System Information for Umbraco

Released a new Umbraco package today, that integrates the ASP.NET System Information Prober into the Umbraco back-office.

What is the ASP.NET System Information Prober? It is a single page that tries to get as much useful hosting information about your web-server. The concept is similar to PHP’s native phpinfo() function.

Installing the package will add a new node tree to the developer section.

Here is a quick demo video: http://screenr.com/2YC

Installing this package will add a new node tree to the developer section.

You can download the ASP.NET System Information for Umbraco package from the Our Umbraco community site.

Posted in blog | Tagged , , , | 2 Comments

Working with XSLT using new XML schema in Umbraco 4.1

Most of the Umbraco community are aware that the XML schema in the upcoming Umbraco 4.1 release has changed.

Instead of each document being a node element, the element name is the node-type alias, same with property values; they no longer use data elements with alias attributes. Here is a quick example, comparing the old/legacy with the new:

<node id="1066" parentID="-1" level="1" nodeName="Home" ... nodeTypeAlias="Homepage" path="-1,1066">
	<data alias="bodyText"><![CDATA[<p>Welcome to my homepage.</p>]]></data>
</node>

<Homepage id="1066" parentID="-1" level="1" ... nodeName="Home" path="-1,1066" isDoc="">
    <bodyText><![CDATA[<p>Welcome to my homepage.</p>]]></bodyText>
</Homepage>

Obviously for long-time Umbraco developers this will require a small shift in mindset, as we are way too familiar with writing XPath queries like;

$currentPage/descendant-or-self::node[string(data[@alias='umbracoNaviHide'])  != '1']

… which will need to be rewritten to;

$currentPage/descendant-or-self::*[umbracoNaviHide != '1']

Not that it’s a difficult thing to change/update, but I can see a lot of questions being asked on the Our Umbraco forum.

Since there are a lot of existing Umbraco packages that use the current, (soon to be legacy) XML schema, it might be worthwhile making use of XSLT itself to convert the new back to the old – in order to keep the existing XSLT templates working.  Here’s a quick example:

<!-- ROOT element -->
<xsl:template match="root">
	<xsl:element name="root">
		<xsl:apply-templates select="child::*" />
	</xsl:element>
</xsl:template>

<!-- NODE elements -->
<xsl:template match="*[count(@isDoc) = 1]">
	<xsl:element name="node">
		<xsl:attribute name="nodeTypeAlias">
			<xsl:value-of select="local-name()"/>
		</xsl:attribute>
		<xsl:copy-of select="@*" />
		<xsl:apply-templates select="child::*" />
	</xsl:element>
</xsl:template>

<!-- DATA elements -->
<xsl:template match="*[count(parent::*) &gt; 0 and count(@isDoc) = 0]">
	<xsl:element name="data">
		<xsl:attribute name="alias">
			<xsl:value-of select="local-name()"/>
		</xsl:attribute>
		<xsl:copy-of select="text()" />
	</xsl:element>
</xsl:template>

These templates would be used to transform the new schema/structure back to the old legacy schema/structure, like so:

<xsl:variable name="legacyFragment">
	<xsl:apply-templates select="$currentPage/ancestor::root" />
</xsl:variable>
<xsl:variable name="legacyRoot" select="msxml:node-set($legacyFragment)/root" />
<xsl:variable name="legacyCurrentPage" select="$legacyRoot/descendant-or-self::node[@id = $currentPage/@id]" />

Since you can’t modify a variable’s value in XSLT, it would be a case of replacing all the “$currentPage” references with “$legacyCurrentPage” (or whatever you decided to call it). But in all honesty, if you are going to start modifying your XSLT, then it would be better to refactor the XPath statements to use the new schema!

Personally, I’m looking forward to using the new XML schema in Umbraco 4.1, the structure makes more sense from a semantic perspective – and I am told it will have performance gains on the XSLT processor.

Posted in blog | Tagged , , , , , | 1 Comment

Bit.ly Url Shortener DataType for Umbraco

Over the weekend, I coded up a little treat… a Bit.ly Url Shortener data-type for Umbraco!

The new data-type lets you shorten your Umbraco page URLs using the Bit.ly API service.

For more information, go to the project page over on Our Umbraco.

Posted in blog | Tagged , , , , | Leave a comment