Mcbeev.com

Taking it one line of code at a time

I’ve been pretty surprised at the traffic, mention, and email feedback that my last post, 7 Things you might want to check after launching a new Kentico CMS website, has received. In fact I was presented with a very good question in my inbox today about a detail from the fourth item in that list.

Pretty much the question boiled down to, why after submitting the Google site map URL to Google’s Webmaster tools, was the specified website’s pages not showing up in the resulting index or when viewed at the sites ~/CMSPages/GoogleSiteMap.aspx page.

Since the question came in from a friend, I decided to dig deeper and lend a hand. As soon as I logged into the site’s CMSDesk I quickly noticed what was up. Most of the content pages were using Custom Document Types. I was actually impressed to see this because it is sort of an advanced feature to use inside Kentico and normally an under utilized feature as well.

The output of the GoogleSiteMap.aspx page looked something like this, only the normal Menu Items from the CMS Tree:

 

Kentico CMS Google Site Map default

 

So after some quick research I found the devnet article on how to integrate the Googe site map feature. After reading the second paragraph of that article I knew exactly what was up. Turns out that by default the Google site map feature from Kentico only includes the “Page (menu) item” Document Types. This makes sense for someone that doesn’t have a lot of custom Document Types or dynamic content.

However, if you use custom Document Types, and you should, they rock, then you need to pop open your favorite text editor and add a very small amount of code to make the custom pages show up. Open up ~/CMSPages/GoogleSiteMap.aspx. The server tag in question that we are looking to change is the <cms:GoogleSiteMap> tag.

Default:

 

<cms:GoogleSitemap runat="server" ID="googleSitemap" TransformationName="CMS.Root.GoogleSiteMap" CacheMinutes="0" OrderBy="NodeLevel, NodeOrder, NodeName" /> 

 

Now what we need to do is add in whatever custom Document Types that we have, into a ClassNames property, chances are it is not there already. Let's use BizStream.TeamLeaderProfile in this example.

Change To:

 

<cms:GoogleSitemap run at="server" ID="googleSitemap" TransformationName="CMS.Root.GoogleSiteMap" CacheMinutes="30" OrderBy="NodeLevel, NodeOrder, NodeName" MaxRelativeLevel="-1" ClassNames="CMS.MenuItem;BizStream.TeamLeaderProfile" />

 

Don't forget that the property can accept multiple custom Document Types delimited by a semi-colon. Now save the page and you are all set. All of your pages should show up at the GoogleSiteMap.aspx url. Go ahead and browse to it to check it out.

You should now see the extra URLs part of the page output like:

 

Kentico CMS Google Site Map with Custom Document Type

 

I’d also like to point out that the default control does not look to be using the Cache system provided Kentico, CacheMinutes=0. I would recommend upping this value from 0 to at least 30 minutes if not more. There is a small chance that 0 could mean inherit from the top level tree or site, but I haven’t been able to verify this or not.

Note: if your curious about what kinds of pages that a custom Document Type can generate, check out the About page over at BizStream.com. That’s one example of how BizStream uses custom Document Types.

One last tip, like the devnet article mentions you don’t have to use that path to submit to Webmaster tools with, it is kind of long. You can change it to whatever you want by going to CMSSiteManager -> Settings -> (global) in list -> URLs -> Google sitemap URL.

I hope you enjoyed this small article about using the Google site map feature of Kentico CMS. As always leave feedback and opinions in the comments or send them to me email.


Phew! That's quite the title for a blog post. This week I decided to take the plunge and upgrade my main work machine to SQL Server 2008 because SSIS finally supports C# Script Tasks in it.

So After hunting and pecking through all the install screens I finally got to the main pre-install tests. And to my surprise the installer died on the VSShellInstalledRule rule. This is strange because its telling me that I don't have the RTM SP1 installed for Studio, which I have had for a couple months now.

So after checking out this blog post, I still was having no luck,  and no I have never installed any express editions on this machine.

Now this was starting to annoy me. Other fixes I found, including this MSKB support article told me I should uninstall VS 2008 all the way and start over, or not install the BI tools with SQL 2008. Ummm I don't think so.

You see I work various .Net projects for multiple clients. The headache of uninstalling Studio and re-setting up everything gives me nightmares. And the tools are one of the great reasons to upgrade in the first place.

After searching through a ton of install logs, I finally found it referencing some registry keys (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DevDiv\VS\Servicing\9.0) that said RTM and not SP1. Ah ha I thought. I manually changed them to SP1 and re-ran the check. It worked! or so I thought. The check passed but after running the installation it errored on installing the tools.

After more googling I saw that someone had problems with the TFS plugin to studio. That was the next to go, but again the install errored.

So I started checking other plugins and after un-installing Visual Studio Tools for Applications the installation actually worked.

Wow what a headache.

So if you have the same problem the summary is, un-install any express editions, and / or any old plugins to 2008.


Google's Browser: Chrome

This morning when I saw the news about a new browser being released I thought to myself.  Awww #$%^%, thats all's I need is another stupid rendering engine to write code for. Not even 20 mins later my client came in and said hey did you see the thing about the new Google browser ? Again @#$$#@, and I waived him out of the room and told him not to get excited about such things because it would just cause him to have to have me work more.

However, I was wrong, dead wrong.

After reading the introduction here. I was impressed, even if was in comic book style.

So I fired up the download over at google.com, and got it installed on my home machine here.

I have more testing to do, but so far it seems snappy, and I really like the start page and UI improvements. It would be real interesting to see if I could hookup the Visual Studio debugger or something to this and see what the performance is really like. More review to come later.

Edit 1: Just found a problem with ASP.NET's AJAX Extensions. Modal Popup doesnt quite work right. Maybe I shouldnt get so excited. 

Edit 2: It does have a built in DOM Inspector, Memory Footprint viewer and Javascript console. So many points for that.

Edit 3: The opening speed is very impressive, and I like the default home page with the 9 most recent viewed pages as well.


Very true


I had a small crazy issue today with a web app that I'm working on dealing with looking up keys and values in a C# KeyValuePair<string, Guid> generic object.

I was using it to look in a Dictionary<string, Guid> of users. Makes sense to populate dropdowns with on the server, and use as a callback in cache to not have to look at the database every page load right ?

For some reason it was not finding some Keys, or users in my case, and finding others. I narrowed it down to when you log in, what you type might not match the case that the system has for you.

And sure enough when I logged in with mcbeev it was not finding Mcbeev. That's pretty strange I thought, SQL isn't case sensitive. Ah but the default Dictionary<T, T> uses whatever the default comparison operator for string is.

I was using the following

Dictionary<string, Guid> dict = new Dictionary<string, Guid>();

And after switching to

Dictionary<string, Guid> dict = new Dictionary<string, Guid>(StringComparer.CurrentCultureIgnoreCase);

Viola! it worked. I had never bothered looking at the other constructors for Dictionary<T,T>. One of them allows you to pass whatever kind of comparer your heart desires.


Mcbeev.com Blog Upgrade

You get to point to where you've written so many apps from the ground up that you just get lazy.

I used to take pride in writing my own home page / blog. It was exciting, a good training exercise, and I enjoyed doing it. That is, when I had the time to do it. And now with my wonderful family taking up most of my time I have finally given up on my own projects and decided to start using other people's work. Open Source of course.

This blog is now operated on the blogengine.net blogging engine. I am really impressed with it so far. I started out playing around with it last night about about 7pm. And here I am launching my own domain with a customized version of it that integrates with Twitter, Flickr, and Last.fm, not bad.

There is also a big benefit of being able to post easier (so long community server!). Well let me stop a second there, I still really like community server, however, over the years it has gotten really really bloated, and my site is more of a blog than a forums anyway. Another big benefit is the comment system, it actually works now, so please feel free to drop me a note at the end of this and let me know what you think about my new blog.


Error ASAP !!!

Ok, seriously, I know Visual Studio 2005 is a "beta" product still, but it still makes me shake my head sometimes. Take this error message for example -Restart your application as soon as possible ?!?! What was the developer late for a beer meeting after work or something ? There's nothing like a little urgency in an error message to really get you worried. Jeeesh.


About Me

I have over 11 years of experience doing this crazy web development thing mainly at BizStream. I'm passionate about software platforms and technologies that can help solve real world problems. I enjoy hanging out with my wife, chasing around my three children and vigorously rooting for the Michigan State Spartans and Detroit Lions. (I know, right? Who still roots for the Lions?)

View Brian McKeiver's profile on LinkedIn

 

PhotoStream

Calendar

<<  July 2010  >>
MoTuWeThFrSaSu
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

View posts in large calendar

last.fm

FoghatStone Blueabout 7 days ago
The ZutonsValerieabout 7 days ago
ForeignerDouble Visionabout 7 days ago
JourneyDon't Stop Believin'about 7 days ago
The Living End'Til the Endabout 7 days ago
Cage the ElephantBack Against The Wallabout 7 days ago
Tenacious DKarate Schnitzelabout 7 days ago
Red Hot Chili PeppersHump de Bumpabout 7 days ago
REO SpeedwagonRoll With The Changesabout 7 days ago
The FrayHow To Save A Lifeabout 7 days ago

Xbox GamerCard

Offline 7/25/2010 1:59:39 PM Last seen 07/25/10 playing Xbox 360 Dashboard