Sitecore: Creating Fieldtype External link only

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)

During an Sitecore .Net development training I was ask if there is a fieldtype for an external link. The answer (of course) is; “Yes, general link”. With general link you can create a external link and many other types of links.  But what if you want to create a field in which the business users can only add an external link? You can easily create this with Sitecore (without any coding).

 

Create the External Link only Fieldtype

Fieldtypes are defined in the Core database. Switch to the core database and open the content editor and duplicate the /sitecore/system/Field types/Link Types/General Link item and call the item External Link.

Remove the unused link options

Underneath the newly created External Link item there is a folder called menu. Remove all items in the Menu folder except External Link, Clear and Follow.

 

Sitecore: Creating Fieldtype External link only external link fieldtype

Test the External Link Fieldtype

Switch back to the Master database and add a External Link field the to a template. Open an Item based on the template and you will see the newly created External Link field.

 

Sitecore: Creating Fieldtype External link only external link fieldtype result
That’s it, we have created a new Fieldtype that only accepts External links.

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
Sitecore: Creating Fieldtype External link only Pieter Brinkman avatarAuthor: Pieter Brinkman ()

Pieter is Technical Marketing Manager for Sitecore Netherlands and owner of Gaatverweg.nl. He has more than ten years experience with software developing in multiple programming languages and with different Content Management Systems. Before joining Sitecore Pieter was a lead developer for multiple Sitecore and .Net projects, he joined Sitecore in 2011 as an Solution Architect in The Netherlands, after two years as an Solution Architect he joined the Technical Marketing department. In the role as Techinical Marketing Manager he is responsible for the Global MVP program and the Sitecore technical branding strategy. You can follow Pieter on twitter: @pieterbrink123 or Google+

Sitecore: Creating Fieldtype External link only WebsiteSitecore: Creating Fieldtype External link only TwitterSitecore: Creating Fieldtype External link only Google PlusSitecore: Creating Fieldtype External link only Linkedin

Related posts

Configure a authoring server as publishing instance
Step 3: Create the outgoing link report
Webinar: Sitecore and Continuous Integration
Multiple Images Selector field

2 Responses to Sitecore: Creating Fieldtype External link only

Comments
Tweets
Pingbacks
  • John West

    Nice explanation Pieter! But don’t you also need to update the renderField pipeline to handle this type of field (basically, duplicate the code in the GetLinkFieldValue processor and change the field type name…hmm, maybe these processors should accept an optional list of type names using the configuration factory)? But since this specific field type never stores an internal link, you don’t have to update /App_Config/FieldTypes.config to enable link tracking for this new field type.

    Pieter Brinkman
    pieter

    John, thanks for your comment. This blog post is based on series of posts I intended to write. In that blogpost series I’m going to add an external DMS tracked link fieldtype based on the general link. So you can choose if you want to track instead of tracking all links:
    Measure Outgoing Links with DMS

    I´m still trying to finish the POC and documenting my steps, but in the meanwhile wrote this small post. Let me check the steps again, I thought it worked.

    To be continued….

    Click on a tab to select how you'd like to leave your comment

    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>