Nibble

Archive for August, 2008

Custom document type icons/thumbnails 4

When creating or editing a  document type you are able to select an icon and a thumnail image from a dropdown.

shopdocumenttype

The icon will show up in the content section and the thumbnail will be used in the ‘Create Page’ dialog. Giving different document types a different icon/thumbnail is a good way to keep the content section a bit more editor friendly.

It’s also verry easy to add your own custom icons/thumbnails the only thing you need to do is add your images to the folders where these images are stored

Thumbnails:

\umbraco\images\thumbnails

Icons:

\umbraco\images\umbraco

So to add this icon shop  to the icons dropdown I just need to copy it into the right directory. Afterwards it will show up in the icon dropdown and I can use this on my document types.

customicon

Why Umbraco rocks - alternative templates 14

The main building blocks of umbraco are as you know document types and templates. When creating a document types the umbraco interface will give you the options to also create a templates that is then setup as the default template on that document type. If you open up the details of a document types you’ll be able to see the ‘allowed templates’ part on the info tab.

image

Document types aren’t limited to 1 template and this is great! You can easily swith to an ‘alt template’ by simply editing the url of your page.

So if you would have a homepage.aspx and you want to apply templatex on it you can do this by changing the url to

homepage/templatex.aspx

another option is this

homepage.aspx?alttemplate=templatex

In the beginning I didn’t use alternative templates that much but it’s a great way to keep your content section clean.

For example an email to a friend page, instead of making this a new documenttype and adding it to the content en then passing the id of the page you want to email…

You can simply add an email to a friend template and call it up as an alternative template, that way you won’t need to pass the nodeid because you are still on the same node !