Sitefinity 4.0 RC – You are trying to access an item that no longer exists.

I switch between various Sitefinity 4.0 RC projects a lot and seem to encounter this error frequently when accessing Sitefinity’s backend:

Server Error in ‘/’ Application.

You are trying to access item that no longer exists. The most probable reason is that it has been deleted by another user.

Continue reading

Tagged with: , , | Leave a comment

Exploring blog posts using Sitefinity’s Fluent API

I needed to record a short (4 minutes or less) video showing Sitefinity’s Fluent API.

Below is the sample widget I created for this video:

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="CustomWidget.ascx.cs" Inherits="SitefinityWebApp.Custom.CustomWidget" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>

<div class="customwidget">

    <div><asp:Button ID="CreateBlog" runat="server" Text="Create Blog"
            onclick="CreateBlog_Click" /></div>

    <div><asp:Button ID="CreatePosts" runat="server" Text="Create Posts"
            onclick="CreatePosts_Click" /></div>

    <div><asp:Button ID="DisplayPosts" runat="server" Text="Display Posts"
            onclick="DisplayPosts_Click" /></div>

    <div>
        <telerik:RadGrid ID="RadGrid1" Width="100%" runat="server">
            <MasterTableView AutoGenerateColumns="False">
                <Columns>
                    <telerik:GridBoundColumn DataField="Title" HeaderText="Title" />
                    <telerik:GridBoundColumn DataField="Parent.Title" HeaderText="Blog" />
                    <telerik:GridDateTimeColumn DataField="DateCreated" HeaderText="Date Created" />
                    <telerik:GridBoundColumn DataField="Comments.Count" HeaderText="Comments" />
                </Columns>
             </MasterTableView>
        </telerik:RadGrid>
    </div>

</div>
using System;
using Telerik.Sitefinity;

namespace SitefinityWebApp.Custom
{
    public partial class CustomWidget : System.Web.UI.UserControl
    {
        protected void CreateBlog_Click(object sender, EventArgs e)
        {
            App.WorkWith().Blog().CreateNew().Do(b => b.Title = "My New Blog").SaveChanges();
        }

        protected void CreatePosts_Click(object sender, EventArgs e)
        {
            using (var fluent = App.WorkWith())
            {
                var blog = (from b in fluent.Blogs()
                            where b.Title == "My New Blog"
                            select b).First();

                for (int i = 0; i < 10; i++)
                {
                    blog.CreateBlogPost().Do(p => p.Title = "Blog Post " + i).SaveChanges();
                }
            }
        }

        protected void DisplayPosts_Click(object sender, EventArgs e)
        {
            var posts = from p in App.WorkWith().BlogPosts()
                        where p.Parent.Title == "My New Blog"
                        orderby p.Title
                        select p;

            RadGrid1.DataSource = posts.Get();
            RadGrid1.DataBind();
        }
    }
}

This code might be useful for anyone who is exploring with Sitefinity’s Fluent API.

The video isn’t online yet.  It will probably be posted in the coming weeks.

Tagged with: , | 1 Comment

Readability inspired blog theme

Readability has lived on my web browser’s bookmark toolbar for a long time.  It’s an indispensable tool for making the web tolerable.  Readability takes an unruly ad-laden poorly-formatted web site and turns it into a reader friendly format.

Shown below is just one example from CmsWire.  They certainly aren’t the worst offender, but given their area of expertise (content publishing) I find their dancing circus clown antics particularly jarring.

Continue reading

Tagged with: , , , | Leave a comment

Turning common CMS “claims” into sales advantages

There are a handful of advantages that every CMS will claim and, therefore, are difficult to turn into  a competitive advantage.  For example, every CMS will claim the following advantages:

  1. Easy to use
  2. Developer Friendly

Because every CMS claims these advantages, it’s hard to turn work on these areas into a competitive advantage.  This is why many CMS’s don’t bother and instead spend their time bolting on a mish-mash of add-ons.   It’s easy to use these ad-hoc add-ons (even if they are trivial) against competitors in sales conversations.  (Rome with coffee, versus Rome without coffee).

Continue reading

Tagged with: , , | Leave a comment

Code review from 10,000 programmers

A recent post to my Telnet80 blog found its way onto the Reddit Programming page.  Here is the result:

Google analytics report showing a 6,678% increase in traffic

I received just shy of 10,000 visitors over the course of 2 days.  Overall lots of great insightful comments.  Based on the comments, I plan to do a bit more work with this code over the coming weekend.

Tagged with: , , , | Leave a comment

Address Validation using the Google Maps API

I’ve never been a fan of address forms that look like this;

Bad street address form design

From a data entry perspective, it forces users to hit TAB constantly.  Furthermore, users who are less web savvy will transition between the mouse and the keyboard to negotiate these fields.  It’s not a natural way to type an address.

By contrast, here is a human friendly address form:

Good street address form design

While typing an address into this field, users can stay on the keyboard and simply type the address in a way that feels natural.  The problem [for programmers] is parsing and validating this raw text once the form has been submitted.

Client-side address validation using the Google Maps Geocode API

Continue reading

26 Comments

Doing client-side address validation with the Google Maps Geocode API

Update:  If you look at the comments down below you’ll see a comment from Thor Mitchell.  Thor is the product manager for the Google Maps API.  His comment informed me that the technique I demonstrate below (using a server-side proxy service to relay geocoded addresses) is needlessly complicated and against the Google Terms of Service.  Consequently, I updated my code and published this code in an new blog post.  I recommend that you use alternate technique to validate street addresses.

I’ve never been a fan of address forms that look like this;

Bad address form design

From a data entry perspective, it forces users to hit TAB constantly.  And users who are less web savvy will transition between the mouse and the keyboard to negotiate these fields.  It’s not a natural way to type an address.

By contrast, here is a human friendly address form:

Good address form design

While typing an address into this field, users can stay on the keyboard and simply type the address in a way that feels natural.  The problem [for programmers] is parsing and validating this raw text once the form has been submitted.

Client-side address validation using the Google Maps Geocode API

Continue reading

9 Comments

jQuery does not have an ‘exists’ method

As developers, we’ve all solved problems only to forget the solution (and the problem) many months (or years) later.  We’re then forced to rediscover the solution to the old challenge.

I recently encountered this phenomenon while attempting to use jQuery and the ‘exists’ method.  I had tons of old Javascript / jQuery code that was using this method.  Consequently, I couldn’t understand why this code wasn’t working in a new project:

if ($('#MyForm').exists()) {
    // Do something
}

This very simple code resulted in error messages in all my web browsers:

Continue reading

1 Comment

Web Governance has moved and cannot be found!

Does your organization have strongly defined trashcan governance methodologies?

If not, this could pose a serious risk to your organization’s waste disposal processes.  This could result in disease and even death among employees.  Trashcan governance helps combat this risk by clearly defining the rules and processes related to an organization’s waste disposal.

If it seems silly to invent a fancy new phrase (trashcan governance) to describe who is in charge of the trash, then you understand how I feel about the phrase web governance.

Continue reading

Tagged with: | Leave a comment

Blogging with Google Docs

Blog posting from Google Docs is very simple to setup, simply click the publish button in Google Docs and follow the instructions.

via lgr.ca

I just learned that Google Docs supports the MetaWebLog API for publishing docs to a blog. Sitefinity supports the MetaWebLog API for blog post publishing. I had a brief hope that I could replace Windows Live Writer (not cloud based) with Google Docs (cloud based).

Alas this experiment was short lived though. For now, there is not an easy way to handle code samples (syntax highlighting) in Google Docs. Secondly, Google insists on hosting the files (images) included in the document, instead of uploading these images to the blog. And third, Google Docs does strange stuff with the HTML. Most notably, it wraps paragraphs with a <div> instead of a <p>.

Back to Windows Live Writer…

Tagged with: , , | Leave a comment