0 votes

Flexible Links

This package adds a new data type that fills a similar niche to Umbraco's built in "Multi Url Picker" to control multiple links in a single property. The main advantage of the Flexible Link control is that it can be extended to support links beyond the 3 supported by that control (content, media and manually set links). For example, it can be extended to support links to modals/popups, which is the original reason to build this control. Below are other potential types of links,

  • Anchors (#link-to-place-onpage)
  • Phone Numbers (automatically add "tel:" to the front of the link url)
  • Email (automatically add "mailto:" to front of link url)
  • 3rd party websites (can select desired content via a picker instead of having to manually enter the url)

Most of these are pretty simple examples, but developer can create their own custom link types to do whatever they need by implementing the interface IFlexibleLinkType. There are also 2 base types of links,

  • BaseManualLinkType - used for links whose destination is manually entered
  • BasePickedLinkType - used for links whose destination will be selected with a picker

Generally, developers should extend one of these base classes instead of the interface, as they reduce the amount of configuration and coding that needs to be done.

Once all of the types are in place, the data type itself can be configured. The following settings are available

  • Allow Multiple - allows more than one link in the control if enabled
  • Disable Label - removed the label input from the control; useful when the link is an image instead of text.
  • Allowed Link Types - sets which types of links are allowed for the control and controls any relevent configuration for those links; starting nodes for content and media can be selected for example

For more detail on how to use this package, please view readme on the github repository (follow the source code link).

 

Screenshots

NuGet install instructions for Umbraco 9+

dotnet add package Bonsai.FlexibleLinks.Backoffice

Package owner

Jesse Andrews

Jesse Andrews

Jesse has 716 karma points

Package Information

  • Package owner: Jesse Andrews
  • Created: 22/09/2022
  • Current version 1.0.0
  • License MIT
  • Downloads on Our: 0
  • Downloads on NuGet: 264
  • Total downloads : 264