• twitter status

doe mij maar een calzone aub (@ La Piazza) http://4sq.com/9qdnGZ
(08/09/10 @ 10:05)

umbraco Certified Developer umbraco MVP 2008/2009

• RSS

RSS Feed

• blogCalendar

<september 2010>
12345
6789101112
13141516171819
20212223242526
27282930

• blogCategories

Xslt debugging

Posted on donderdag 19 maart 2009 in xsltumbracoEnglishv4tip

Hi all umbracians... Yesterday, I was able to debug some xslt from an umbraco powered website. It turned out not to be as difficult as I though it would have been... Here's what I've done to get xslt debugging working using umbraco's latest nightly build combined with Warren's excellent CWS2 package

Feel free to add some comments, I'm sure other solutions are possible... It would be great to hear about those as well.

umbraco quick tip #1: umbracoUrlAlias and specifying complete new path

Posted on zondag 8 maart 2009 in umbracoEnglishv4tip

Lots of people are aware of those nifty hidden gems in umbraco. And today I'll introduce another one which I came across a few days ago. It's the 'umbracoUrlAlias' property alias. It can be useful in cases where you'd like to restructure some parts of the umbraco content tree. Let's take an news section example and start from this:

-Content
--News
---2009
----4
-----8
------A news item created on March 8th

Assume your client want to keep the tree structure as is (As it makes it easy for him/her to know when posts have been created/updated, but doesn't want users who visit the site to enter the complete path /news/2009/4/8/a-news-item-created-on-martch-8-th.aspx. Instead, the user should be able to enter /news/a-news-item-created-on-march-8-th.aspx.

In this case, 'umbracoUrlAlias' migth become the programmer's best friend. All you need to do is to have an extra property of type 'textstring', and alias = 'umbracoUrlAlias'. For each of the news item, enter news/name-of-the-item (Replace name-of-the-item with the corresponding new item's node name, NO LEADIND SLASH AND DO NOT ADD THE .ASPX EXTENSION) and the news item will also be available from /news/name-of-the-item.aspx.

Ok, got it?

Let's add another example (a real life example I ran into last week) where I am dealing with profiles (Basically, people that register on the site) and projects (People can add any number of projects). Content tree had to be structured as:

-Content
--Profiles
---Profile-1
---Profile-2
----Projects
-----Project-1
----Other stuff folder
---Profile-3

and so...

In this case, 'Project-1' is available from the address /profiles/profile-2/projects/project-1.aspx whereas the client requested that a project is always available from the address /projects/project-1.aspx.

Solution: Again, add a new property of 'textstring' type, alias = 'umbracoUrlAlias' and enter projects/project-1 in the field (for project-1 that is).

Pretty neat stuff, isn't that?

And it's not finished yet. Assume 'Project-1' has a number of child nodes as in following tree structure:

-Content
--Profiles
---Profile-1
---Profile-2
----Projects
-----Project-1
------Child-1
------Child-2
----Other stuff folder
---Profile-3

Both child nodes will be available from /profiles/profile-2/projects/project-1/child-1.aspx (/profiles/profile-2/projects/project-1/child-2.aspx) as from /projects/project-1/child-1.aspx (/projects/project-1/child-1.aspx) without the need to add the property for those child nodes.

Bottom line: It doesn't matter how deep the content is stored inside umbraco, it can always be retrieved using a much more simple url/path if you're adding a 'umbracoUrlAlias' property.

Happy coding!