A Shiny New Field Type: LinkList

[updated 2014-11-09]

According to reports and comments, this module is not compatible with Sitecore 7.2 (and up). The code is available on Github for anyone to grab a copy and fix the problem. If you do, please be kind and share the solution (or send me an email and I’ll update the code).

Here’s the project on Github.


 

It took long enough, but I finally finished a 1.0 version of the LinkList field type I was working on a while back. Unfortunately, somewhere along the way I lost the source code so I had to use ILSpy to get it back. ILSpy is a great tool for checking source code (I use it ALOT) but it doesn’t always generate pretty code as it is, in fact, IL code. Therefor, I will not publish the source code at this time (unless you really need it, then just email me or drop a comment here).

I wanted to handle links as content, not separate items, so I wanted to build a field type for it. Initially I wanted it to contain Sitecore.Data.Field.LinkField but was unable to find a way to populate it.

Without further ado; I give you Monoco LinkList Field Type as a Sitecore package.

Whats in the package?

  • The package contains the field definition item (installs under /sitecore/system/Field types/List Types in core db).
  • Files needed:
    • One tiny (well) DLL file in /bin
    • A config include (to inject the javascript file)
    • One javascript file for the content editor to respond to a few events needed.

Usage

Just create a new field on any template with the “Link List” field type and you’re set.

To access links, cast a field (LinkList field, that is) to Monoco.CMS.Fields.LinkList and go for the Links property, then bind it to a repeater or whatever you like.

What does it do?

It creates lists. Lists of links. Internal (Sitecore links), media (Sitecore media links, that is) and external

What does it look like?

I’ve included a screenshot;

Screenshot, ahem!

 

Disclaimer

Not claiming this is free from bugs but if you find any, feel free do drop me an email at code@monoco.se

Posted in Sitecore Tagged with: , ,
5 comments on “A Shiny New Field Type: LinkList
  1. skolima says:

    Not strictly on topic, but if you’re not happy with ILSpy decompiled code, then check out the results of JetBrains dotPeek (my preferred one currently) or Telerik JustDecompile. Or the trial version of Reflector. You’re much more likely to get feedback from others when you Sitecore module is on Shared Source.

    Yup, just repeating what was said on StackOverflow :P

  2. Kenneth Kristensen says:

    Hi!
    I really this module and i have used it for other projects, but now i am working on a new project and it does not seem to work.
    The project i am working on is a Sitecore 7.2 (rev. 140526) and the issue i am facing is when i am trying to add Media and external links i get an error message like this:

    Handle not found.

    Stack trace:
    [InvalidOperationException: Handle not found.]
    Sitecore.Web.UrlHandle.Get(UrlString urlString, String handleName, Boolean removeSessionValue) +173
    Sitecore.Web.UrlHandle.Get(UrlString urlString, String handleName) +46
    Sitecore.Web.UrlHandle.Get(UrlString urlString) +47
    Sitecore.Web.UrlHandle.Get() +37
    Sitecore.Shell.Applications.Dialogs.LinkForm.GetLink() +10
    Sitecore.Shell.Applications.Dialogs.LinkForm.OnLoad(EventArgs e) +59
    Sitecore.Shell.Applications.Dialogs.MediaLink.MediaLinkForm.OnLoad(EventArgs e) +45

    Do you have an updated version of this module that will work in the new version of Sitecore?

    Thanks,
    Kenneth Kristensen

    • Andreas says:

      Hi Kenneth,

      I’ve heard others having problems with the 7.2 release of Sitecore. Unfortunately, I don’t work on Sitecore projects at the moment so I can’t really fix the problem. The code is available on Github, feel free to grab it and see if you can fix it: https://github.com/monoco/Monoco.CMS.FieldTypes (and please share the solution if you do).

      Andreas

  3. Gabor Maklari says:

    Hi!
    I’ve found the solution and made it compatible with Sitecore 7.2
    I will share it on github soon.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>