+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Making hyperlink fields in custom content modules

Making hyperlink fields in custom content modules

8 posts, 0 answered
  1. Luke
    Luke avatar
    56 posts
    Registered:
    18 Mar 2013
    02 Aug 2013
    Link to this post
    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.
  2. Arno
    Arno avatar
    249 posts
    Registered:
    08 Sep 2010
    03 Aug 2013 in reply to Luke
    Link to this post
    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.
  3. Luke
    Luke avatar
    56 posts
    Registered:
    18 Mar 2013
    05 Aug 2013 in reply to Arno
    Link to this post
    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. 
  4. Arno
    Arno avatar
    249 posts
    Registered:
    08 Sep 2010
    06 Aug 2013 in reply to Luke
    Link to this post
    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.
  5. Luke
    Luke avatar
    56 posts
    Registered:
    18 Mar 2013
    06 Aug 2013 in reply to Arno
    Link to this post
    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.
  6. Luke
    Luke avatar
    56 posts
    Registered:
    18 Mar 2013
    14 Aug 2013 in reply to Luke
    Link to this post
    Bump. Surely someone knows more about SiteFinity than I do (conservatively 99% of the community?)
  7. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    19 Aug 2013 in reply to Luke
    Link to this post
    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
  8. Kaloyan
    Kaloyan avatar
    272 posts
    Registered:
    05 Dec 2016
    19 Aug 2013
    Link to this post
    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
8 posts, 0 answered