The AddAspxExtension property in Sitecore V6

by Aboo Bolaky 11. February 2009 07:53

In Sitecore 6.0, a new Link Manager class has been added. In the web.config, a few properties affect the functionality of the Link Manager. I've already posted on the EncodeNames property (fyi, default value : false).

The AddAspxExtension Property

On the surface, I can clearly relate to the functionality of this property. If this is set to false, we are instructing Sitecore to render links (i.e via <sc:link>) without any extensions. This is (alledgedly) GREAT NEWS for SEO experts. If you leverage this functionality with some Url Rewriting (either via Helicon Isapi Rewrite Lite (free)  or UrlRewriter.Net ), you must be thinking that you will have a Sitecore front-end website without any extensions.

The Glitch...

If you spent most of your time in implementing regular expressions to rewrite (under the hood) those extensionless links to .aspx and feed them back to Sitecore, Well...I'm afraid you have wasted your precious time (no matter how cool your regex expressions are!!). The moment you try to access the Content Editor in the CMS, you  simply receive some weird error messages. Sometimes, it's the dreaded YSOD (Object Reference not set to an instance of an object) or occasionally a 404 page welcomes you. With the AddAspxExtension property set to false, you might end up with a fancy looking frontend and NO backend support at all. Not very usefull... Did a bit of research on SDN5, turns out that the symptoms are correct

This has led me to believe that, in the midst of tackling problems that vary in programming complexity and requirements , always take a step back and test both the front end and back end when dealing with "unchanted territories".

And then...

The search to build an SEO friendly website in Sitecore continues.. Surely, I'll get the better of this (it's just a matter of time...why not build up the suspense?)  and will let you know how I did it !!!! 

Back to Sitecore now....

Tags:

.Net | Applications | Sitecore | Tips & Tricks

SEO Friendly Urls in Sitecore -Remove spaces in Url (2)

by Aboo Bolaky 2. December 2008 11:03

This post is merely a follow up on my previous post : SEO Friendly Urls in Sitecore -Remove spaces in Url .

Even if you use the encodeNameReplacements settings in your web.config, this may well not be enough to get you going with clean urls. Although it will allow you to access an item by replacing the spaces with a dash (.i.e. if you chose to replace a space with a dash in the encodeNameReplacements element) in the url, the links that are rendered on the page (either by doing sc:link in xslt or the usual .net code) will still contain "%20" characters.

Now, this is the bit where I "kind of" messed up. In Sitecore V6 , we have the concept of LinkManager in the web.config. By default, the EncodeNames property is set to true. This is correct and you SHOUD NOT CHANGE IT. If the EncodeNames property is set to false, you will end up having "%20" characters in your hyperlinks.

The big question for me is when and why did I change the EncodeNames to false? I don't know.. Maybe I thought, at some point in time, that toggling the key to a value of false would solve some other problem that I was experiencing?

Anyway, had I not changed EncodeNames to false , I would have never the known the actual meaning and implications of EncodeNames. We learn from our mistakes... Cool

While we're here, you can remove the language code in the urls (http://hostname/en/node1/child.aspx) by changing the key languageEmbedding to "never". In that case, you will end with a url that looks like http://hostname/node1/child.aspx.

Back to Sitecore now..

Tags:

.Net | Applications | Sitecore | Tips & Tricks

The WebUtil Class in Sitecore

by aboo bolaky 30. November 2008 06:36

For those Sitecore lovers..

When you code against Sitecore, whether against renderings or sublayouts, I'd suggest you have a look at the very useful methods defined in Sitecore.Web.WebUtil Class. Those methods will help save you some time and prevent you from re-inventing the wheel. Some methods worth mentioning are :-

string AddQueryString(string url, params string[] parameters)
string AddQueryString(string url, bool xhtml, params string[] parameters)
string ExecuteWebPage(string url)
string ExtractFilePath(string url)
string ExtractUrlParm(string name, string url)
Placeholder FindPlaceholder(string key, Control root)
HtmlAnchor GetAnchor(Item itm, string linkField)
Control GetErrorControl(string error, string details)
Control GetFormControl(Page page)
string GetFormValue(string fieldName)
string GetFullUrl(string url, string serverUrl)
string GetHostIPAddress()
string GetHostName()
string GetQueryString()
string GetQueryStringOrCookie(string key, string defaultValue)
void RedirectToErrorPage(string text)
string RemoveQueryString(string url)
void ReloadPage()
string ReplaceUrlParameter(string url, string replace, string withtext, bool append)

Alternatively, you can have a peek at all the methods in the screen grab below [Click on the image for a better view..]

Tags:

.Net | Applications | Sitecore | Tips & Tricks

SEO Friendly Urls in Sitecore -Remove spaces in Url

by aboo bolaky 29. November 2008 09:50

Aliases in Sitecore

Sitecore has the concept of "Aliases", whereby each item can accessed using a specific name (rather than the default path). Aliases are turned on by default. To turn them off, you can flip the web.config settings name AliasesActive to false (But who would want to do that???? Sealed)

Space Characters in Sitecore

When you create an item in Sitecore, you free to choose the naming of your item (provided it succesfully validates against some key rules .e.g Item name cannot contain :,?.. otherwise, you will end up with a "Item xxx is not a valid name"). Most of the time, you will want to put spaces in the item name. Let's take an example:

If an item (at the root level) has an item name of "John Doe", the url of the actual page should theoretically be http://hostname/John%20Doe .

Of course, you can get rid of this spacing issue by specifying an Alias of John-Doe on the item itself. But imaging you having hundreds of items with spaces !!!..

The encodeNameReplacements element in the Web.config

This encodeNameReplacements settings allow you to globally replace any unwanted character in your url to a character of your choice. So, rather than creating an alias for each item (without spaces), we can add the following new setting.

<encodeNameReplacements>
	<replace mode="on" find="&" replaceWith=",-a-,"/> 
	<replace mode="on" find="?" replaceWith=",-q-,"/>
	.....
	<replace mode="on" find=" " replaceWith="-" />
</encodeNameReplacements> 

Job Done ! Cool

 

Tags:

.Net | Applications | Sitecore | Tips & Tricks

SpeedDials for IE7 and Firefox

by Aboo Bolaky 28. November 2008 12:47

Orginally incorporated in Opera, the SpeedDial feature has proved to be an asset for day-to-day web browsing. The whole point of the SpeedDial is to make browsing your TOP N favourite websites as easy as possible.

It didn't take long for the other competitors to follow suit.

Internet Explorer

IE7PRO has created an addon for IE7. Its FREE and packed with loads of features and configuration options (Easy Homepage <==> Speed Dial). It's just too bad that the x64 bit version hasn't yet been released. All in all, this is the ultimate plugin for IE7.

Firefox

The Firefox addon created by Josep del Rio is pretty much geared towards the SpeedDial concept (unlike IE7Pro, which has many other features). The cool thing about this addon is that you can export your settings for your speed dials and import them later on another firefox browser. The current release is Speed Dial 0.7.2.6 and can be accessed at https://addons.mozilla.org/en-US/firefox/addon/4810.

Tags:

.Net | Applications

Using Microsoft Search Server Express 2008 Web Services

by Aboo Bolaky 21. November 2008 09:39

WebService Location

The Url for the webservice is usually in the form of http://servername:portnumber/_vti_bin/Search.asmx

PS: Make sure you enter the actual server name instead of the IP address. Otherwise, you might end up with an ArgumentNull Exception when trying to invoke the QueryEx webmethod.

PS: Always call the Status Webmethod (returns "ONLINE" if the search service is up and running) prior to actually querying MSSE 2008.

Crawling Content

To be on the safe side, always add a crawl rule with a path of http://www.targetsitetocrawl.net/*  and a crawl configuration of "Crawl complex URLs (URLs that contain a question mark (?))". Otherwise, the crawler will ignore pages that contain querystrings. Big thanks go to David for pointing this out to me.

Search Scopes

You would use search scopes where you may want to query within "specific parts of a collection". This is analogous to collection/subcollections in Google Mini. The gotcha here is that if you specify a search scope in your query (either SQL-Like query or keyword based query), you might end up with an "Scope in your query does not exist. " error message. This is not the end of the world. The problem here is that you search scope is supposed to be SHARED across the Shared Services Provider. Now, how do we create a shared scope? It's kinda hard to figure this one out. When you normally create a search scope, there is no option to choose whether or not the scope can be shared.

Creating a Shared Scope in MSSE 2008.

The only way I found to create a shared Scope is to create a search scope using the normal approach (Scopes for this search Server ->New Scope). Once you return to the View Scopes page, notice that there is no Create Shared Scope on the drop down list for the target search scope. The current url looks like : http://servername/_layouts/viewscopes.aspx?mode=site. Substitute the mode=site querystring key pair with mode=ssp and hit Enter. You are now in Shared Services Provider mode. When you view the items in the drop down for your search scope, you now have an option to "Make Copy as Shared". Once this is clicked, a Shared Scope with a name of "Copy of .." is created. Of course, do not forget to add rules to your search scope.

You can then manually update your new search scope on the Search Administration Home Page. Once the update is complete, you can use your name of shared scope in your Query XML. One thing i noticed is that there is no place where I can update the name of the Search Scope. weird.. If you know how to do this, please drop me a few lines. i'd be interested to know :P

Word Stemming

This is disabled by default. To enable stemming, you need to perform a basic search on the Search Center Site. On the result page, go to Site Settings -> Edit Page. Edit the webpart Search Core Results (Modify shared webpart). Expand Results Query Options. Make sure the checkbox Enable Search Term Stemming is checked. Voila !!

I hope this is enough to get you going with Microsoft Search Server Express 2008. Cool

 

Tags:

.Net | Applications | Tips & Tricks

Creating a nested html list for the Category List in BlogEngineNET - Part Two

by Aboo Bolaky 12. November 2008 10:09

Quick Recap:

Part One : Outlines the steps required to build an nested HTML List for the Categories in BlogEngine.NET. The List can then be used on the FrontEnd section of the site.Full details of the walkthrough can be found here.

I've been working on Part Two of the solution (obviously,this builds upon the work done in Part One), which is about binding the Categories collection to a treeview control, thus making life a lot easier on the backend page. Walkthrough of Part Two

I do reckon that there is a lot to read on those two articles ..but I hope it's well worth it !! Cool

 

Tags: ,

.Net | Applications

Creating a nested html list for the Category List in BlogEngineNET - Part One

by Aboo Bolaky 8. November 2008 12:18

I've been following up the success of BlogEngine.Net closely and amongst its successful releases, I noticed that the Category List control has hardly changed at all.  Am I being too fussy here or is it time for a change?  I must admit that BlogEngine.Net is based on a rock-solid platform and has indeed exceeded my expectations in terms of architecture and extensibility.

[Kudos to the BlogEngine Team]

The purpose of this article is to outline the steps required to produce a nested list of categories from BlogEngine.Net.

UPDATE (08th November 2008):

WHERE is the article? I realised that the article is too lengthy to be included as a post. So i decided to create a Page instead : Creating a nested html list for the Category List in BlogEngineNET

I'm currently working on PART TWO of the article. Well, you ask, what is PART TWO about? In a nutshell, it will allow you to bind the Category List to a treeview control (for use in the admin section). 

Please let me know what you think. Cool

  

UPDATE (12th November 2008):

Part Two has just been published. You can access it here

Tags: ,

.Net | Applications

Sitecore-Compelling Web Experiences

by Aboo Bolaky 4. November 2008 08:44

Over the past few weeks, I've had the opportunity to use Sitecore to build a website. Whilst i still consider myself to be a novice in Sitecore, I'm afraid I won't be able (at least for the time being!!!) to shed more light on this powerful Content Management System.

However, he're is a video that will help you "understand" what Sitecore is REALLY about. Great marketing stuff!!!

PS: Sitecore isn't just a CMS...

 

Anyways, I'll keep you all posted about my learning journey with Sitecore. So far, it's been GREAT!!

Tags:

.Net | Applications | Sitecore

Cropper crashes on Windows Vista x64

by Aboo Bolaky 18. October 2008 09:02

Just installed Cropper (Release 1.9.1) onto my x64 machine. A Bad Image Exception is thrown at runtime. Consequence : Control Panel ->Programs and Features -> Uninstall Cropper.

Click to enlarge

Thankfully, Jeffrey Palermo has done a nice job in submitting a patch  [Change Set :18136] on CodePlex. Now, all you need to do is download the Change Set 18136, build the CropperSetup project and use the resulting msi file to install Cropper back again and there you go.....Bob's your uncle.

PS: Cropper rocks ...Thanks again Jeffrey  Cool

Tags: , ,

.Net | Applications

Tag cloud

Flash Player 9 required.

About Me

I wish I could write something here..
//TODO: ElaborateMe