0

I'm creating a custom list as part of a solution. The list items are then rendered via a visual webpart which also exists in the solution. The webpart is designed to allow a user to maintain a list of links that are then rendered on screen. The links however can be either internal or external. Is there an inbuilt field type to support this or do I have to roll my own in order to generate an internal content picker or public url field whenever the item is being populated?

One thing I should clarify is that I'm aware of the SPFieldUrl type. What I'm looking for is for the internal url / content picker to display the content picker dialog to navigate to the content when it is an internal link.

1

The dialog known is a special customization of what is known as an AssetPicker, and this one comes with Publishing Sites because is actually part of Publishing controls (http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.publishing.webcontrols.asseturlselector(v=office.14).aspx)

You can either :

  1. Use this one in code (add publishing assembly to your code) or as a column (available as you shall activate Publishing infrastructure features at Site Collection and Web )
  2. Build your own custom field and override AssetPicker to behave otherwise, see here http://www.theroks.com/custom-asset-picker-with-enhanced-urlfield/
  • Excellent! I had a feeling I'd have to roll my own but didn't realise someone had covered it in detail. Thanks, that'll save me some time. :-) – Brian Scott Jun 6 '13 at 21:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.