• Client login
  • Work for us

All the latest from the team...

Sunday, 2 November 2008

Open Source content publishing methods

Recently we've been exploring more open source CMS solutions and a couple of e-commerce sites have also come into the Code Required workflow.

We've looked at loads (I mean dozens and dozens of them!) and there simply are so many options we've decided to drop further development for Roots and start working on building components and extensions for some of the applications that already exist.

I mean... Why fix something that isn't broken? Our site currently runs with a combination of Blogger feeds (you're reading one now!) plus some static pages and some dynamic php stuff too... But we've been playing with WordPress recently and have started to be swayed from Blogger over to WordPress in fact we've also started to developed a few extensions for Wordpress already! We'll also be looking into some Dreamweaver plugins to add development of themes.

Most of you reading this also know of our preference to working in LAMP based systems - hence the mention of WordPress, Blogger and a couple of others we like in SilverStripe and Magento for commerce based sites but the Open Source solutions come in a mass array of formats - recently we've used DotNetNuke which is an ASP.net CMS solution... We've also been made aware of the rather exciting option of Umbraco recently.

We certainly won't write off commercial systems (Microsoft Sharepoint, for example, is often something that we are asked to develop on/for) but with so many great solutions out there why re-invent the wheel? Why waste time developing something when we can enhance an existing solution?

We'd love to hear more about your experiences with Open Source solutions so please email us and let us know of your experiences with any of the aforementioned or indeed an exciting new CMS you've been developing!! ;-)

Alternately if you are interested in hiring Code Required to work on your website, be it implementing a CMS, full ecommerce solution or just a spring clean do get in touch!

Labels: , , , , , , , ,

Wednesday, 19 March 2008

ASP.net 2 and the infamous Response.Redirect method

OK any of you working with a CMS system based on ASP.net which utilises the Response.Redirect method to handle links will undoubtedly have come across this issue - those of you using ASP.net in general and considering using Response.Redirect should also read on...

Response.Redirect makes a round trip to the server and returns a 302 redirect in the headers. Now if you're in anyway concered about SEO you'll know that the majority of search engine bots won't follow 302 redirects (temporary redirects).

I actually came across this after monitoring Google on a DotNetNuke project which utitlises the LinkClick method (which pretty much handles all links in the TEXT/HTML module). So I know that any links to LinkClick.aspx?xxxx&yyyyy will return 302 redirects before going onto my real "seo-freindly" url... Which of course is a BIG problem.

Well after badgering around for what seems like weeks (but is probaly only a few minutes) I began to think about the global.asax file and how it handles requests.

I know there is the Application_PreSendRequestHeaders (which is processed just before we bat the response headers back to the client) so this seems like an appropriate place to check and rewrite the headers and this is actually quite a simple piece of code...

Sub Application_PreSendRequestHeaders(ByVal sender As Object, ByVal e As EventArgs)
If Response.StatusCode = 302 Then
Response.StatusCode = 301
End If
End Sub

Obviously you'll want to be specific in your catchment but you get the idea. I tested this with LiveHTTPHeaders and it seems to have the desired affect - a 301 redirect. I'll let you know if Google likes it after Mr. Google-bot has come back to see my client's site. IN the meantime if your desired affect is to redirect to another file on your server I'd suggest you use the Server.transfer() method which doesn't make the round trip to the server.

Also check out Matt Cutts blog article about this very issue

Labels: , , , , , , , ,

Thursday, 13 March 2008

DNN setting the date format for the calendar control

Having recently been frustrated by the lack of support in DNN to change the format of dates (yes I know about the web.config setting and yes I know about the built in language settings - it still didn't work when using DataSprings DynamicForms module which otherwise is simply superb).

Anyway if you're experiencing the same issues that we did then there is a simple solution.

In the "js" folder you'll find a file named "PopupCalendar.js".

I won't bore you with the various ways in which you customise the look and feel but if you need to change the date format (in my case to the United Kingdom dd/mm/yyyy) here's how...

Simply scroll down until you find the lines:

//default localized short date format if not provided
if (popCalDstFmt == "")
popCalDstFmt = "m/d/yyyy";

This is where the date format is set if you didn't pre-specify a format on the call to the popupCal method.

You can simply override this by adding the following line straight after this function... In our case:

//force UK date format
popCalDstFmt = "d/M/yyyy";

...and voila you're ready to rock and roll!

Hope this helps some other frustrated developers!

Cheers
Jon

Labels: , , , , ,

Tuesday, 12 February 2008

DNN - Returning Page titles in place of Module titles for Search Results

Those of you using DotNetNuke (DNN) as the platform for your site build have probably encountered the problem where that DNN displays the module name in the search results and NOT the page name.

There is a pretty simple fix to this. In SearchResults.ascx.vb (located in admin->search) simply add the public function "FormatTitle" as per below:

Public Function FormatTitle(ByVal TabID As Integer) As String

Dim strURL As String

Dim objTabs As New DotNetNuke.Entities.Tabs.TabController
Dim objTab As DotNetNuke.Entities.Tabs.TabInfo

objTab = objTabs.GetTab(TabID)

strURL = objTab.Title.ToString()
If strURL = "" Then
strURL = "Home"
End If

Return strURL
End Function


This will get the page name from the TabID returned from the stored procedure GetSearchResults.

Next, to display the page name, add the following line to SearchResults.ascx:

<asp:HyperLink id="pageTitle" runat="server" CssClass="SubHead" NavigateUrl='<%# FormatURL(DataBinder.Eval(Container.DataItem,"TabId"),DataBinder.Eval(Container.DataItem,"Guid")) %>' Text='<%# FormatTitle(DataBinder.Eval(Container.DataItem,"TabId")) %>'></asp:HyperLink>

And you should now see the page name in your results set instead of the module name!

Labels: , , , , ,

RSS feed ATOM feed Add to Technorati Favorites View Jon Harvey's profile on LinkedIn