Tag Archives: sitecore

Sitecore CMS

Lucene Spatial Search Support Module

Lucene Spatial Search Support Module with Sitecore 8.1

I came across a need to implement a search based on zip code, latitude, longitude, and a radius. I quickly found out that this is a tall order in a short amount of time if implementing this type of functionality from scratch. However, the Lucene Spatial Search Support module came to the rescue…or did it? I am implementing a Sitecore 8.1 instance and it looks like the module was only good through 7.5 at the time of this post. There is an option to use SOLR Spatial Search Support module, and that IS updated through 8.1, but I didn’t have a driving need for SOLR on this project since my records being indexed were low in nature. So what is a Sitecore developer to do? Luckily, the Lucene Spatial Search Support module source code was available on GitHub, so I set out to get this module upgraded to 8.1. Time to get our hands dirty!

After cloning the repository from GitHub, I tried to build the project and there were many references missing, so I quickly grabbed a vanilla instance of Sitecore 8.1 rev. 160302 and added the references I needed to build the project. They are below:

Added to Sitecore.ContentSearch.Spatial project:

  • Sitecore.ContentSearch.dll
  • Sitecore.ContentSearch.Linq.dll
  • Sitecore.ContentSearch.Linq.Lucene.dll
  • Sitecore.ContentSearch.LuceneProvider.dll
  • Sitecore.Kernel.dll
  • Sitecore.Logging.dll

Added to Sitecore.ContentSearch.Spatial.DataTypes project:

  • Sitecore.ContentSearch.dll
  • Sitecore.Kernel.dll

I then had a build issue in this constructor in the LuceneSearchWithSpatialContext.cs:

protected LuceneSearchWithSpatialContext(ILuceneProviderIndex index, CreateSearcherOption options = CreateSearcherOption.Writeable, SearchSecurityOptions securityOptions = SearchSecurityOptions.EnableSecurityCheck)
: base(index, options, securityOptions)
Assert.ArgumentNotNull(index, "index");
this.index = index;
this.settings = this.index.Locator.GetInstance();

The Sitecore community never fails, and I found this on the Sitecore Stack Exchange where another developer simply commented out this constructor. I did the same and rebuilt the project but was missing a reference to a Sitecore.Abstractions.dll:

Sitecore.Abstractions Reference Missing

Sitecore.Abstractions Reference Missing

After adding in the Sitecore.Abstractions.dll to the Sitecore.ContentSearch.Spatial project, my project was successfully building. So I added this to the list of project references in addition to what was listed above:

Added to Sitecore.ContentSearch.Spatial project:

  • Sitecore.Abstractions.dll

Now it was time to make sure that the Sitecore.ContentSearch.Spatial.config was configured properly for 8.1. To my joy, it looks like there is a .config setup for version 8 that is disabled when I pulled from GitHub. I disabled Sitecore.ContentSearch.Spatial.config and enabled Sitecore.ContentSearch.Spatial.v8.config. Next, I added in my template criteria for my locations with the Template ID, LatitudeField, and LongitudeFields and then modified the index to use “sitecore_master_index” since I am testing this out locally and in live mode.

I added in the following .dll’s and .config file to the project I am working on that needs the spatial search feature:

  • Lucene.Net.Contrib.Spatial.dll
  • Sitecore.ContentSearch.Spatial.DataTypes.dll
  • Sitecore.ContentSearch.Spatial.dll
  • Spatial4nCore.dll
  • Sitecore.ContentSearch.Spatial.v8.config

After publishing my files and testing out, I got an error that said, “Current Index is not configured to use Spatial Search.

After some research, I realized that my index was set to use the wrong index earlier in code. Not only that, but one that wasn’t setup properly to for spatial search at all. After pointing to the correct index, publishing from Visual Studio, and then rebuilding my “sitecore_master_index” I was getting results back.

As I stated earlier, you can also perform spatial search with SOLR. If you have a client that has this type of environment (which is most right!?), I would take a hard look at SOLR for your client’s search provider.

You must use Solr if you have a scaled environment. This means you have:

  • two or more content delivery servers
  • two or more content authoring severs
  • separate servers for email, processing, reporting and publishing

Solr supports calls over HTTP(S) which means that the indexes are available to all servers in the environment that require it (content management and processing servers).

Big shout out to Ahmed Okour for the help that he provided for questions I had during the process. Happy coding!

Typical Roles and Permissions Setup for Sitecore 8+

When initially setting up the roles and permissions for your new Sitecore 8+ site, you may be asking yourself what roles do I need for my organization typically? When you use the Role Manager to create your roles you may be asking yourself what roles do I need to create and what roles do they need to be a Member Of so my that role can have the correct functionality in Sitecore to perform their job? You also may be asking what permissions do I need to give to these roles in Security Manager?

Below is a typical setup seen in a lot of companies that are using Sitecore 8+. Keep in mind that the business needs will dictate what roles you may have and also that someone may be in more than one role, one person may be all roles, or there may be a separate person for each role. It’s all up to the business and it’s all customizable to the business needs.

Typically, you will want to have a couple of Administrators on the site so someone can always get in and perform Administrative type of duties if someone on vacation or out for some reason. This is as simple as choosing your power Sitecore user at the company and then typically Developers have Administrator access as well. Some will choose to create a Global SItecore Administrator role, which is a member of all roles. This works fine too. The added benefit, if needed, is that this role DOES NOT bypass workflows like the Administrators account does. In addition, it’s easy to see who your administrators are in one role.

As for everyone else that is non-designated power user or a developer, they will fall into one of these typical role buckets. Examples are for a company called “Sitecore Sandbox”:

SS Content Editor:

Typically, the Content Editors are the marketing or web team that are going to be in charge of editing content in Sitecore.

Member Of:

  • Author
  • Designer
  • Experience Editor
  • Sitecore Client Translating

SS Content Publisher:

Typically, the Content Publishers are the marketing team managers that will make final decisions to approve the content and then publish it live to the web.

Member Of:

  • SS Content Editor
  • Sitecore Client Publishing

SS Marketing Analyst:

Typically, the Marketing Analysts are the marketing team people who will be analyzing the effectiveness of the marketing efforts and possibly putting together reports for higher ups.

Member Of:

  • Analytics Reporting
  • Analytics Advanced Testing
  • Analytics Management Reporting
  • Analytics Content Profiling
  • Analytics Testing
  • Analytics Personalization

SS Marketing Administrator:

Typically, the Marketing Administrators are the marketing management team that has all the functionality of the Marketing Analysts but can also edit content as well.

Member Of:

  • SS Content Editor
  • SS Marketing Analyst

The permissions can be setup easily by going into the Security Editor and selecting the role you want to give permissions to. You will want to give read/write/rename/create/delete/administer permissions based on the role, but typically read/write/rename/create/delete is sufficient.

Now, when you setup the users in those roles they may not see what all they have access to UNLESS they check the “Hidden items” checkbox in the Views tab–>View chunk in the Contextual Ribbon. Make sure they know to do this or you may have them coming back to you with questions and you may be scratching your head on why they can’t see the items they need access to. Happy coding!

10 Steps to Setup MongoDB as a Windows Service with Sitecore 7.5+

If you are doing development work with SItecore 7.5+ and beyond, you may want to set up MongoDB to connect to Sitecore locally or on your DEV, QA, STAGING servers. This is just a brief tutorial on the steps needed to set up MongoDB on your as a service, and then validate that it is connected to your local SItecore instance via RoboMongo. This post relates to Sitecore versions 7.5 and up.

  1. Download the MongoDB installer here: MongoDB
  2. Install using the Custom installation so you can change the default location. Typically, I put all my projects and websites on a separate non-operating system drive such as a D: drive. I installed to D:/MongoDB/.
  3. In the folder “MongoDB” create a folder called “data” and inside that folder, create a folder called “db”. These will not be created for you during install so you will need to create them.
  4. Create a new .config file in the “MongoDB” folder and name it “mongo.config”. This is where we will store the configurations for MongoDB.
  5. Copy/paste the configuration into the new “mongo.config” file and modify to your specific workstation:
  6. Next, look in the “MongoDB” folder. You may need to create the “log” folder and put a “mongo.log” file in the that folder for the next line to succeed if it was not created during the installation of MongoDB.Now, install MongoDB as a Windows Service, so it will start every time you start-up Windows and stay running. Open up a Command Prompt (Run As Administrator) and type in the following (modify if needed for your filepaths):
    D:\MongoDB\bin\Mongod.exe --config D:\MongoDB\mongo.config --install
  7. This will create a new windows service called MongoDB. Now, to start the service simply type in the following:
    net start MongoDB
  8. You can use GUI tools like RoboMongo to work with Mongo data. Typically, Sitecore connections strings are already setup OOTB so you really just need to set up MongoDB. If you want to verify that your data is being stored then simply download RoboMongo. The example below is using MongoVUE, but I don’t recommend as it has been problematic in the past to download from their website. However, the process is basically the same for RoboMongo.
  9. Once installed you simply click the green plus icon to add a connection, then type in the name of the connection, and the server. Since, you this is on your local workstation you will use localhost OR then save.

    Add Connection In MongoVUE

    Add Connection In MongoVUE

  10. Now you should be able to see your connection listed in MongoVUE, and if you expand the connection you will see your tables and data being captured from Sitecore.

    Sitecore Experience Data Is Connected

    Sitecore Experience Data Is Connected

During the making of this blog post, I referred to these blog posts below, which helped me to achieve setting up my local developer workstation to run MongoDB as a Windows Service and connect it to a Sitecore 7.5+ instance. One last thing, if you are using SIM (Sitecore Instance Manager), you can also perform all the above in one click. Happy coding!

Setting up MongoDB on Developer Machine:

Install MongoDB on Windows:

Helpful Tips to Troubleshooting Sitecore Issues

Below is a LIVING list of helpful troubleshooting tips to fixing Sitecore issues.  Meaning, these are tips that Sitecore developers typically will run through before going to the Sitecore Community and/or Sitecore Support.  If a tip is not in this list, feel free to comment and I will add it to this running list.

These are tips, in no order, that might be helpful to aid you in determining the root of an issue and coming to resolution:

  • Check the Sitecore Logs for errors located in the Data/Logs folder.  It’s a best practice to have the Data folder as sibling to the Website folder and not inside the Website folder.
  • Using Chrome’s Web Developer tool you can check the Network tab, or in Firefox Firebug use the Profile button to see if anything is failing with when being loaded or events are firing etc.
  • See if the issue is browser specific by using different browsers (IE, Firefox, Chrome).
  • Debug with Visual Studio for ASP.NET/C# issues.
  • Debug with Firebug/Chrome Web Developer tool for JavaScript type of issues.
  • If .dll issue take a look at the .dll in .NET Reflector, or similar reflection tool, and see what the code is setup to do.  This might lead you in the direction of the issue.
  • Try clearing the cache at http://[yoursite]/sitecore/admin/cache.aspx
  • Check to make sure your includes are being included post .config build at http://[yoursite]/sitecore/admin/showconfig.aspx
  • Try recycling the app pool for the website.
  • If missing files/items see if a previous package was installed and reinstall to pick up the files/items.
  • Is the issue environmental, meaning works in one Sitecore instance locally, but not in staging/production? If so, what could be the difference in files/items/configuration you can compare that will give you direction to solve the problem. You may need to use a tool like Beyond Compare, or similar tool, to diff some files to get to the root of the issue.

Thanks in advance for any helpful tips to help out the Sitecore community! Happy coding!

3 Basic Steps to Help You Become a Sitecore MVP

At the end of the year 2014 when the Sitecore MVP’s were awarded their MVP status, it was then that I decided I wanted to become a Sitecore MVP.  Below are some simple steps that I used to obtain my Sitecore MVP status for 2015 in as little as 30 minutes a day, which is 2.5 hours a week added on to your daily/weekly routine.

I have been bodybuilding this year, and I am going to relate becoming a Sitecore MVP to bodybuilding.  Here’s the secret:

It’s all about passion and consistency!

When you walk into the gym you will almost always see the guys that are bigger and ripped.  So you ask yourself, “What are they doing to get that size and definition?”  Yes, they could be on steroids, which is what most believe, but I assert that’s not the case.  More often than not, they have just made it a habit to show up every day, and made it a point to not let anyone else outwork them in the gym.  It’s their passion, and they are consistent in showing up and working hard 5-6 days a week to reach their bodybuilding goals.

Becoming a Sitecore MVP is very similar to bodybuilding in the aspect that it’s much easier and less stressful to work on your MVP status daily/weekly.  This is a much better strategy than waiting until nominations come around in October/November of every year to start getting to work on the MVP award.  That can be time-consuming and stressful if you need to play catch up on a lot of the things that Sitecore is looking for to reward you with the MVP award.  To make this even more clear, if you relate this to bodybuilding, that’s like walking into the gym after you haven’t worked out all year long and stacking 500 pounds on chest press, and going for it.  It’s just not a smart idea!

Below is a brief list of things you should focus on when seeking to obtain the Sitecore MVP status.  The panel looks at the quality, quantity, and the level of impact of these particular contributions:

  • General (technical) advocacy
  • Contributing to the Sitecore community via blogs
  • Contributing to Sitecore Community forums (SDN forums have moved)
  • Helping others on online communities like Stackoverflow
  • Visiting and/or Contributing to the Sitecore User Groups
  • Writing and/or publishing content such as white papers and articles
  • Sitecore Marketplace contribution
  • Support tickets contribution

Consistency and involvement is key and I will give you some pointers on where you should spend your time below to help you in your quest to become a Sitecore MVP.

Step 1: Become selfless not selfish

I still remember about 6 years ago when I was the Lone Ranger in my company that just got a license for Sitecore.  I was tasked with learning and becoming the sole developer/resident expert on Sitecore 6.0.  At that time, I was a complete Sitecore rookie, and my only source of knowledge was the documentation that Sitecore provided on the SDN.  Back then there wasn’t much for Google searches when it came to troubleshooting. I struggled to take in all the information and learn on my own, but I was determined to rise up as a solid Sitecore developer. It was at that time that I vowed that should I ever become knowledgeable with the product that I would help others in the Lone Ranger situation. Hence, the reason I share my knowledge today, which is to share and give back to the Sitecore community as they have given back to me in my time of need.

Start with a selfless heart when seeking to obtain the Sitecore MVP status. Realize that most of the MVP’s would probably still do all these things even if there wasn’t an MVP program. It’s just a unique character attribute to possess where you want to help others and not keep all this information to yourself.

Step 2: Set daily/weekly goal on hourly commitment

Nothing is free.  If you want to become a Sitecore MVP or a have a healthy, fit body you simply have to commit to how much time you are going to spend to obtain that which you seek.  What I do every morning is try to wake up about 30 minutes early before work and focus on those contributions above that can help the Sitecore community.  Once you have a time commitment you can then decide where to spend that time.

Step 3: Setup this time allotment in your calendar and stick to it

Take the time to put in your calendar this time commitment so you can keep yourself accountable. When the time comes to work on knowledge sharing, hopefully, you will already have a plan of what you are going to do.  But here is what you can do with your time allotment of simply 30 minutes a day:

  • Jump on the Sitecore Community forums and/or Stack Overflow and help others to work through their issues. You may not know the answer, but maybe you can help lead someone in the right direction.  Try answering the issues or offering input where you can with your knowledge and experience. It all helps even to stir up thought that may help that person reach a final solution. Make sure to set up your notifications to come directly to your email inbox so you can see what’s new and respond promptly to ones that you previously were helping with.
  • Use this time to blog on a topic that you find would help the Sitecore community.  I usually have found that as I am working through my normal work, I have these moments where I say to myself, “I bet others could benefit from what I just went through.”  And that is the starting point of a new blog that I start while it’s still fresh in my mind. So as you are working always be thinking of what it is that you’re doing that could help others.
  • Use this time to build a Sitecore Marketplace module.  If different clients are asking for the same type of component or module and it’s not on the Sitecore marketplace consider developing a Sitecore marketplace module.  Chances are that other Sitecore clients will want to use it.  Just be ready to support it as well i.e. bugs, new features, updating to work with newer releases of Sitecore.

In addition, to what is above that you can spend 30 minutes a day on you should also get involved in the social Sitecore community via Twitter and Slack.  Slack is used to bounce ideas around on the Sitecore Slack channel.  Great to see what other Sitecore developers are talking about and get involved.  What’s best about slack is it’s real-time chat with other Sitecore developers from around the world!

If you live in a state where you have a Sitecore User Group that meets regularly get involved! Definitely show up to the meetings on a regular basis but if there is something you would like to present on then let the User Group leader know. For those of us, that live in areas where there is not a Sitecore User Group consider starting one up.  Here is a link to the Sitecore User Groups directory. Here you can see where a User Group is located near you.  For us that live in disparate areas, there is a Sitecore Virtual User Group but it’s based on presenters.  No presenters, no meeting.  Hence, another area where you can pitch in and contribute towards becoming an MVP if you feel comfortable enough to present on a topic.

Lastly, as you go about your day and encounter issues with Sitecore that can’t be resolved with your technical ability and the help of Google, then consider putting in a support ticket to Sitecore Support.  Again, chances are it’s a bug that needs to be addressed and fixed in the next release. Sitecore wants to know about all these bugs so don’t think you’re being a pain in the neck, it’s helping them to build the most solid, robust, enterprise level CMS system in the world.

So remember, do it because Sitecore is your passion and you love to share NOT because you have to.  Next, set aside time each day to make it simple and easy for yourself to reach your goal of MVP. Lastly work your plan daily/weekly to share to the best of YOUR abilities with your knowledge and expertise. Happy coding!


Why use Anti-Package functionality with Sitecore Rocks?

I wanted to gain an understanding of utilizing the Anti-Package feature of Sitecore Rocks not only the creation process for use as a backup, but also I wanted to verify what happened when I restored with the anti-package in the event just to verify what was taking place.

I started by taking a look at Trevor Campbell’s post on the creation of Anti-Packages here: https://www.sitecore.net/nl-be/learn/blogs/technical-blogs/trevor-campbell/posts/2013/02/28-days-of-sitecore-rocks-package-management-part-1.aspx.  Since, the creation process is pretty well documented, that will not be covered here.

I created a package using Sitecore Rocks and named it MyPackage.

The following items were added:

Items In Package

Items In Package

The following files were added:

Files In Package

Files In Package

The following files were created in a folder I specified:

Created Files

Created Files

Now, that I have my package created I create the anti-package using the process Trevor described in his post.  Take a look at the information at what the creation of the Anti-Package does:

Anti Package Information

Anti Package Information

I added some basic content to the Sample Item using Sitecore Rocks and saved the item as seen below:

Content Added To Sample Item

Content Added To Sample Item

Now, when I install the Anti-Package the Sample Item gets reverted back to its original state as seen below:

Sample Item Original

Sample Item Original

So, I couldn’t help but ponder the question, what is the point of an anti-package when you can make a normal package and re-install it and it should do the same thing right?  As a matter of fact, if I look into the .zip files for my MyPackage.zip and MyPackage.anti.zip they are the exact same.

I believe the benefit lies with using the Anti-Package as a backup strategy particularly in module development for Sitecore.  I think it’s a great habit to get into when working on a module that is continually being updated to create Anti-Packages as you are putting out updates.  The benefit of the anti package is the naming convention (anti.zip) and in Sitecore Rocks the Anti-Package will have its own area for designated Anti-Packages, which could be seen as backups that can be restored at any time. This simple strategy allows you to be able to rollback to most recent release of your module.  For example Excel Transfer Utility Version 1.0, when you are putting together the updated package for 1.0.1, which may contain bug fixes.

Overall, Anti-Packages are beneficial in my opinion.  Not only with Sitecore module development, but as a best practice to have a backup of any important packages you may need to revert back to over time.  Happy coding!



SEO Toolkit Endless Analyzing Bug

I came across this bug for the second time now and decided to post the resolution so that it may help other developers save some time before turning to Sitecore Support.


After installing the SEO Toolkit module when you click on the Search Engine Optimization button in the Desktop, a new window opens up and starts loading the home page.  However, when analyzing that page, or any other for that matter, the “Analyzing page…” continues to spin in the upper right hand corner and never returns any data in the tabs in the very bottom of the web page.

I encountered this bug in these versions:

  • Sitecore Version: 6.6.0 rev. 130111 using SEO Toolkit Version: 1.3.0 rev. 120613
  • Sitecore Version: 6.5.0 rev. 120706 using SEO Toolkit Version: 1.3.0 rev. 110530


  1. Save the image below to your local hard drive (“delete.png”) file and place it in the “\Website\seotoolkit” folder.
  2. Modify the “Website\seotoolkit\client\link.js” file:
Replace this line:
overlay.innerHTML = '<img src="' + seo.page.baseUrl + linkDeleteImageUrl + '" />';
With this one:
overlay.innerHTML = '<img src="' + seo.page.baseUrl + "/seotoolkit/delete.png" + '" />';

This should fix the issue and any page you go to should now take a little bit of time to analyze the page and render data at the bottom of the web page.  Happy coding!

Sorting Template Sections in Sitecore

Here is a little nugget for those Sitecore enthusiasts who want the ability to sort the sections in a content item.  For years I didn’t know about this as a Sitecore Developer so if this helps just one person I have done my job to pass on this helpful knowledge.  Kudos to the guys at Active Commerce for showing me when I went through Active Commerce Certification training.  Active Commerce is a fantastic add-on to Sitecore for E-Commerce functionality and I highly recommend for businesses with lots of products that need an online storefront.  You can find out more about Active Commerce at their website http://www.activecommerce.com.

So let’s just say you have a Content Page template that has the following sections:

  • Page Data
  • Meta Data

I would like the Page Data section to come before the Meta Data section when the template is used to create a new item.  Below is what my template structure looks like:

Template Structure

Template Structure

The Content Page has the PageBase template selected as the Base Template.  The PageBase template has the _pageBase and _metaBase templates selected as the Base Templates.  Both _pageBase and _metaBase templates have the Standard template selected as the Base Template.

The following template sections are selected in this order on the PageBase template __Base template TreeView:

  • _pageBase
  • _metaBase

Being that they are selected in this order you would think that they should show up in the Content item sorted in this manner since the TreeView allows you to sort them.  However, below is what the __Standard Values for the Content Page displays:

Template Sections Order

Template Sections Order

Here is the solution to get the template sections in the order you wish.  In order to sort the sections you must set the Sortorder in the the Template Sections items.  In this case, there are 2 sections; Page Data and Meta Data as seen below:

Template Section

Template Section

The section sorting order is sorted alphabetically unless the sortorder is specifically stated using the Sortorder field in the Template Section items.  Hence, the reason Meta Data comes before Page Data (refer to Template Sections Order).  By default, the Sortorder field is set to 100 as seen below:

Sortorder Field

Sortorder Field

Depending on how many sections you want to sort you can increment these numbers to achieve the desired result.  For example, if I had 4 sections I would just add 100 to the other Sortorder fields in the respective Template Section items.  Since I have 2 sections I only need to set the other Meta Data Sortorder field to 200 and it will place that section underneath the Page Data section as seen below:

Section Sorting Order Achieved

Section Sorting Order Achieved

This knowledge can be used to help out the organization of your templates and give power to Content Editors to access the most relevant sections of items first when there are many sections in the an item.  Happy coding!

How to Uninstall a Package or Module from Sitecore

There are times when I have been asked to uninstall a package, Sitecore Marketplace module (package), or even an internal Sitecore module (package) that your company has developed for a client.  In the event you are not aware of this fact, there is not a rollback feature on packages in an out of the box Sitecore installation.  Hence, if you want to rollback a package you basically need backups of the files and the databases and can then perform a restore procedure with them. If you don’t have the time for backups or forgot to make backups before installing the package below are the basic steps to uninstall a package manually:

Basics for uninstalling a package:

Download the original package/module again so you can analyze the contents.  It should be downloaded as a .zip file.

Extract the .zip file and you will see a package.zip file.  Extract the contents of that as well and you will see the contents of the package as such:

Package Contents

Start with the manual deletion of the items first. Please keep in mind that every module may be different so prior planning on what items or fields need to stay is dependent upon client needs and the architecture.  Just make sure that when you delete items that they truly need to be deleted based on your clients needs. In my case, I moved a couple of fields to another template so the data and field ID’s remained after I uninstalled the module.

Drill down into the items folder and you will see where the items are. These will be the items that you need to manually delete.  For instance, in my example I need to delete the following: \items\core\sitecore\content\Applications\WebEdit\Edit Frame Buttons\Metadata\Edit Metadata\{E43B0BB5-2158-4880-AC16-ABE74593B556}

The GUID is the item and you can find it easily by using search in the Content Editor as such:

Item Search

Sometimes it’s best to open up another Sitecore admin instance for that same version or similar to compare the content items to just to make sure you are not deleting an item that was already in place before the package or module was installed.  It’s always a good reference. Also, if you are deleting from the master database it’s best to delete in this order:

  1. content
  2. layouts
  3. system
  4. templates

This will give you minimal to no linking issues as you manually delete the installed items.

After deleting the items from the core and master database, I perform a full republish just to ensure nothing is missed from the web database and everything is synced in entirety. Next, I rebuild the Link databases just to make sure that all links are correctly pointed.  You can Rebuild the Link Database in the Control Panel of the Desktop:

Rebuild the Link Database in Control Panel

Next, are the manual deletion of the files.  In my case there is only a .config file I need to delete in the \files\App_Config\Include directory and a .dll in the \files\bin directory.

The .config file I simply deleted so that the processor does not show up in the Web.config at runtime. However, I had to delete a reference to the .dll in a few projects from within the solution and this is where some refactoring may need to take place that was using that .dll.  In my case, there is some dependent code that was referencing the .dll used in the module so I had to refactor, delete code, rebuild, and publish back out to my website folder to test and make sure everything is working as it should.  After my testing, I am good to go!

That is all there is to it to uninstall a package or Sitecore module.  Just take your time and pay attention to detail.  I hope these steps can help you.  Happy coding!

Using field item id to render field contents in Sitecore

Did you know that you can use the field item id for use with the FieldRenderer server control in the FieldName attribute?  For instance, take a look at this sample template item:

Sample Template

Sample Template where “Single Line Text Field” item id is {D2775315-00DC-4CF4-8B68-E9748127D188}

<sc:FieldRenderer ID=”frSingleLineText” runat=”server” FieldName=”{D2775315-00DC-4CF4-8B68-E9748127D188}” Item=”<%# Sitecore.Context.Item %>”></sc:FieldRenderer>

Why would you do this? Well, instead of having to memorize field name you can simply use the field item id.  But a much better reason is because if anyone ever changes the field name then the FieldRenderer will not work whereas if you put the field item id it will still continue to work regardless of how many times someone changes the field name.  You want to stay away from using Field names altogether in your code and stick to using id’s wherever possible.  This is why GlassMapper and other ORM tools are great because they do much of the same similar thing by wrapping up the fields so you can access the template as an object and the fields as a property.  However, sometimes you have to use the traditional Sitecore API to get things done and this is one way to keep code robust.

You can also do this as well in the code behind for a sample Literal control that is going to render the Single Line Text Field contents:

litSingleLineText.Text = myItem[“{D2775315-00DC-4CF4-8B68-E9748127D188}”];

This would require a compile in the solution though.  A better solution is to add the item in the HTML markup and you have a tag that is completely in the presentation and doesn’t need to be compiled when changed.

<sc:FieldRenderer ID=”frSingleLineText” runat=”server” FieldName=”{D2775315-00DC-4CF4-8B68-E9748127D188}” Item=”<%# Sitecore.Context.Item %>”></sc:FieldRenderer>