How would I go about adding a field type that would contain a list of links? These links need to be able to be internal, media or external.
I have a Quick Links template being inherited by multiple templates on my site. Until now I have been using a Treelist with the Datasource limiting to specific templates to populate a repeater to output a list of links in the sub navigation of the page. This has been working well for internal links but now I need to extend this to be able to handle links to items in the media library and/or external links. Its the external links that are causing my confusion as they don't exist as items within Sitecore so I'm unsure how best to be linked. I would prefer not to have to create new items for each external link as this seems inefficient.
I was thinking I could potentially use a custom field type, similar functionality as a Name Value List but be able to have a list of General Link's?
Any help to point me in the right direction would be much appreciated.
The source property of the Checklist, Droplist, Droptree, and Multilist field types support Sitecore query.
Sitecore Standard Template contains the Fields which define how Sitecore should manage an Item, such as when it should be published, which workflow it is in, which users should be allowed to access it, and so on. When an Item is selected in the Content Editor, you can see the sections of its template in the right pane.
Complex field types generally store an XML element.
I recently developed a similar solution with a link list field type. The field stores XML-data for the links defined, using Sitecore link tools for internal, external and media links, though still lacking some features.
I have been considering to release it as part of the Shared Source library but the code need some refactoring first... If you are interested, I could send you the version I'm currently working on before releasing it as Shared Source...?
Sitecore has a Shared Source repository available to registered users of the Sitecore Developer Network (referenced in @andreasordell's post). One of the modules in this directory, Inline Item List Field, creates a multilist field with the ability to add, edit, and delete items directly from the parent item.
With this field, it becomes much more efficient to create new items for each link. Content editors can directly modify the list without knowing where the items are stored in the hierarchy and the same list of items can be re-used. Furthermore, you can restrict contents of the list items to a single general link field or many fields based on your requirements.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With