Making hyperlink fields in custom content modules

Posted by Community Admin on 04-Aug-2018 21:48

Making hyperlink fields in custom content modules

All Replies

Posted by Community Admin on 02-Aug-2013 00:00

Thanks for your time. Does anyone know how to make hyperlink fields for custom content modules? The use case is where i want to associated a link URL with each custom content entry, to be displayed as a hyperlink on the front end, and I may want to type it as an absolute or relative URL or alternatively select a page from within the website project somewhere, similar to how the RadEditor's hyperlink manager works. Any assistance is very much appreciated.

Posted by Community Admin on 03-Aug-2013 00:00

Hi Luke,

Typing an URL would just require a textbox, which can easily be added to a custom dynamic content type. To select a page from the website, you need to have a field control and configure the dynamic path or type of that control in the custom dynamic content type. Unfortunately there is no such field control out of the box so you need to create it yourself as explained here. I didn't manage to get it working.

Posted by Community Admin on 05-Aug-2013 00:00

Hello Arno, thanks for the reply.

I tried a different approach, I found  a useful forum thread and I tried to change the DynamicModulesConfig file to render a different field type for the "Edit" and "Insert" views of my custom module. Unfortunately it didn't work, it just rendered the fields as text inputs.

The link/page selector control really should be introduced to the custom module builder field type set. If one has to crack open the source code and recompile projects in order to satisfy a pretty common use case, it is arguably incomplete as a content management system. 

Posted by Community Admin on 06-Aug-2013 00:00

Hi Luke,

I agree with you 100%. Such a field control should be available, but it isn't. As far as I know there are no short term plans for it either, so I'm currently trying to have it developed.

Posted by Community Admin on 06-Aug-2013 00:00

Update: I spoke to soon. The method I described actually was partially successful.

I replaced the corresponding field in the "Edit" and "Insert" views of DynamicModulesConfig.config with a page selection field that calls PagesService.svc.

The only issue is that whatever is mapped that way doesn't resolve to any page. The generated link maps as http://(path to current location)/00000000-0000-0000-0000-000000000000 where 0=some alphanumerical character.  The page service field itself has a rootNodeID attribute, perhaps it's related? (They're the same generic format but not the same value.) Clearly I'm stabbing in the dark here, though. Any help is appreciated, as a designer I will say that compiled-language web development is not my strength.

Thanks for the feedback.

Posted by Community Admin on 14-Aug-2013 00:00

Bump. Surely someone knows more about SiteFinity than I do (conservatively 99% of the community?)

Posted by Community Admin on 19-Aug-2013 00:00

Hey guys,

You can create a custom field using Thunder and use the built-in PageSelector for getting the pages.
Then you would need some custom code on the client side to get the selected value(s) to persist the data.

Kind regards,
Daniel

Posted by Community Admin on 19-Aug-2013 00:00

Hi guys,

@Luke
Because this functionality is not offered out of the box at this time I would suggest to try the solution which Arno propose. You can find and another solution in the following blog post:

Selecting Sitefinity 4 Content Inside Widget Designers

Regards,
Kaloyan
Telerik

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed