Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sitecore link list field type?

Tags:

sitecore

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.

like image 249
Bevan Avatar asked May 02 '11 04:05

Bevan


People also ask

Which of the following field types support Sitecore query in the field source?

The source property of the Checklist, Droplist, Droptree, and Multilist field types support Sitecore query.

What is standard Sitecore field?

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.

Which of the following fields store value as XML in Sitecore?

Complex field types generally store an XML element.


2 Answers

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...?

like image 58
Andreas Bergström Avatar answered Dec 01 '22 05:12

Andreas Bergström


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.

like image 42
reillymon Avatar answered Dec 01 '22 04:12

reillymon