Skip to main content

Posts

Showing posts with the label Sitecore

Using the Source Property

For each of the properties in your template you can set a source for it, this isn’t always used but can improve user experience drastically when done throughout a site. The source field comes in to play whenever you are using any of the following fields: Droplink, Droplist, Droptree, File, Grouped Droplink, Grouped Droplist, Image, Multilist, Treelist, Rich text field and a number of others. There are various ways of setting these up to achieve different results – but in general you are using the source to limit the set of items that can be used, and this requirement can also help you determine what kind of field to use. For example, if you have a Set of items all split down into sub folders and want the content editor to make use of the tree, you could use a TreeList or Drop Tree, but if you just want a set of items without the opportunity to see where those items are – multilists or droplinks are the way to go. For Images you’re generally just specifying where to look for and put th...

Getting Started with Breadcrumbs

Breadcrumbs have been covered by just about everyone so there are lots of examples that all seem to do things a Little differently. With that in mind I’m going to keep this short with my example and two other examples I’ve found that might also meet your needs and cover the basics for just about every xslt breadcrumb example you’ll find. The general idea: you’re at item c, in your tree the path is something like:  /sitecore/content/a/b/c and you want to display a pretty html list for a » b » c anywhere on your site.  You’ll always be dealing with the ancestors of your current item so you’ll be making use of $sc_currentitem/ancestor-or-self::… somewhere. You’ll need to go through each ancestor item and display it, probably checking to see if you’re at the last item so you don’t display a ‘»’ after the final item. You also need to make sure to not display unwanted ancestors in your breadcrumb, being /sitecore and /content in our case. So onto the examples! First is the Sitec...

Links as Items Redux!

Previously I had posted on how to set up items in your content tree to act as external links to other pages (for use with Navigation mainly – for example if you have a blog elsewhere but still want it listed in the main navigation). However, Ivan Buzyka pointed out some issues with the simple implementation so I added creating a better redirect to my ‘to do’ list for the blog. The time has come! Let’s pretend we are modifying an existing site, we don’t want to change the navigation so that won’t be covered here – we just want to update our layout to work a little more universally. Our new items need to be able to link to an internal, external or Media item reliably for display in our navigation. Our template will consist of similar things to last time: Link: General Link Nav Title: Text -> standard values: $name In Navigation: Checkbox ->standard values: checked Create the template, add in standard values for it with the above settings and now we can create our Layout which shou...

Adding your own Icons

I have returned from blogger oblivion – stay tuned for more frequent updates! I’m looking forward to meeting people at Dreamcore this year – I’ll  be sure to update as that is happening. Back to the topic: adding your own icons! As you may have noticed, items can be configured to have an icon – and Sitecore provides an extensive list of them. But you may want to add your own for whatever reason. To do this you’ll need an image suitable for making into an icon, and the ability to resize this image to the correct sizes (Paint.net, Photoshop, GIMP). For our example we’re making an Arke Icon and we're going to say our largest icon will be 128x128, so we have a transparent png called logo.png to work with:  The image you want to use should have a transparent background unless you want the icon to be a square, and ideally not overly detailed as it will be very small. Next, we need to make this image into various sizes, and put logo.png into the appropriately named directories, t...

Setting and Customizing the Rich Text Field Editor

When it rains it pours… I’ve been so busy that I haven’t had a chance to update this as much as I’d like! However, here’s a little tidbit that I struggled with before learning the better way of doing it through Sitecore training: how to make the rich text editor a bit snazzier! This is well documented in the Sitecore documentation and elsewhere, but I always forget where so this post is definitely for my own benefit (and anyone else like me who doesn’t know where to look right away). There are two ways of changing around the rich text editor that I’ll cover, I’ll start with the easier one: 1. Setting the source property for the rich text field on your template I was pretty thrilled to learn this, just go into your content editor or template manager, open up the template with the rich text field that you want to set this for and choose one of the following options as the source (in italics ). Rich Text Default: /sitecore/system/Settings/Html Editor Profiles/Rich Text Default T...

Custom Error Pages

One of the important steps of any website is setting it up to fail Nicely. Sitecore has done a lot of this for us with their error pages, but that may not be the look you want your visitors to see! And what if Sitecore isn’t able to help at all? Not so pretty with ASP.NET error pages… But do not fear! With the configuration files Sitecore makes available, this is a snap to set up and fix.*** ***You Will need to change the web.config file, so please back it up before making any changes suggested here! The first and hardest step – make your error/not found pages that you want your visitors to see – these can be html pages, aspx pages, or even an existing page within Sitecore. Quick Edit!-- As a commenter pointed out: using Sitecore pages for your 404/page not found type errors can allow you to make use of the Sitecore features for multilingual sites as well as analytics. Not to mention, it makes it very easy for business users to make the changes. Usually Sitecore will handle you...

Sitecore Training: Sitecore 6.2 .net Developer Series Experiences

At the beginning of August, I was able to go out to Mill Valley, CA for the .net developer series training at Sitecore USA Headquarters. The course was 4 days of Sitecore goodness, with a certification and a day of hands-on building with Sitecore. Once I found out I would be heading to training, I spent a fair bit of time trying to find out what it would be like and searched for details of the certification without much luck. So for those out there who want to know a little bit more before you’re in the thick of things, here is what happened for me! The quick and dirty description, for those who want to avoid the wall of text: I’d say this training is a must for any developer switching over to Sitecore – without it, it can be really hard to get the whole picture of the product and really see what it is capable of. Even for those of us who had been using Sitecore for a bit before training (there were a number of us in the class), it was very useful to see how to do things the ‘Sitec...

A Simple Site Map

Similar to creating a menu – creating a site map is even easier, there are modules that can do this but with a little preparation it can be very easy to create yourself. To start we are assuming every template used for the pages includes some ‘base template’ for common aspects for all pages. To do this, create (or select if already created) the Base Template with the information you want to have and to that base template, add: InSiteMap: Checkbox Then create or modify the Page templates with the other information you want. From those templates, click to the Content tab, and select the Base template to be included: In the Standard values for the base template, you may want to have InSiteMap checked so that it will be on by default for all the pages. For the sitemap itself, we’re going to create a rendering and then we can place it wherever we would like. The rendering creates a basic nested list of all the items that have InSiteMap checked. < xsl:template match = " * ...

A Simple Single Level Menu with Rounded Edges

After taking some time to figure this out, I thought I’d share my approach to a simple single level menu rendering with rounded edges. Initially, the idea here is very straight forward – create a list, style it, voila! Unfortunately, Round edges and dynamic content make it a little less forgiving. Here is an Example of what we are trying to achieve: Each of these items would be a sub item in the site, all at the same level  under ‘/Sitecore/Content/Site’ In our XSLT  rendering we need to grab the list, and apply the appropriate styles to the appropriate items, notably: The first item needs to have a round corner on the left, the Last item needs to have a round corner on the right, and the inner items need to have borders around them all – and we need to be able to Hover for a different effect. To do this I did the following: < xsl:template match = " * " mode = " main " > < ul id = " MainNav " > < xsl:for-each select = " $Sit...

Web Forms for Marketers: Send Email

To have the save action for your form actually send email, you will need to change one of the settings, otherwise you will receive this error whenever submitting the form: We experience a technical difficulty while processing your request. Your data may not have been correctly saved. Also in your log (/data/logs/newest log file) you will see this error after the form has been submitted: Exception: System.Net.WebException Message: The remote name could not be resolved: 'example.host' Source: System at System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6, Int32 timeout) at System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 timeout, GeneralAsyncDelegate asyncCallback) at System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asyncCallback) at System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralA...