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

Forums / Developing with Sitefinity / Page Selector in custom field

Page Selector in custom field

13 posts, 0 answered
  1. waqar
    waqar avatar
    76 posts
    Registered:
    28 Mar 2011
    10 Jun 2011
    Link to this post
    Hi !
    Can anybody tell me how to use page selector as a custom field.?
    Thanks in advance..
  2. Boyan Barnev
    Boyan Barnev avatar
    1429 posts
    Registered:
    02 Dec 2016
    10 Jun 2011
    Link to this post
    Hello waqar,

    I believe you might find this post from our forums useful for implementing the page selector in your control. Please let us know if you have any additional questions.

    Kind regards,
    Boyan Barnev
    the Telerik team
    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
  3. waqar
    waqar avatar
    76 posts
    Registered:
    28 Mar 2011
    13 Jun 2011
    Link to this post
    Thanks for the reply.!
    But please tell me that how can I add page selector as a custom field in lists module ?
    Please help me and instruct me for achieving this functionality.

    Thanks! 
  4. Boyan Barnev
    Boyan Barnev avatar
    1429 posts
    Registered:
    02 Dec 2016
    13 Jun 2011
    Link to this post
    Hi waqar,

    Can you, please, take a look at this KB article where we're explaining how to achieve similar functionality in another content module, and let me know if you need any further information in order to achieve the desired functionality. I'll be glad to help.

    Regards,
    Boyan Barnev
    the Telerik team
    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
  5. waqar
    waqar avatar
    76 posts
    Registered:
    28 Mar 2011
    14 Jun 2011
    Link to this post
    Thanks!
    I already have this link and I have used this. But I want some easy way to achieve this functionality.
    Why is it very difficult to develop such a common control in sitefinity? while every CMS has this functionality and its easy.

  6. kamii47
    kamii47 avatar
    71 posts
    Registered:
    02 Mar 2007
    09 Apr 2014 in reply to waqar
    Link to this post

    It's a quite old post but no proper answer. Is there some easy or say better way for page selection in sitefinity 6+ ?

  7. Nikola Zagorchev
    Nikola Zagorchev avatar
    424 posts
    Registered:
    24 Nov 2016
    11 Apr 2014
    Link to this post
    Hi Kamran,

    I have prepared and attached a sample for a page selector as a field control. It resolves and shows the selected Page Url depending on the current UI culture in the front-end. In the back-end edit mode the page url is shown in a textbox under the selector for the default back-end culture. However, the presentation and beahvior could be changed to suit your needs. For functionality and usage refer to this video.
    I hope you find this helpful.

    Regards,
    Nikola Zagorchev
    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 Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
  8. kamii47
    kamii47 avatar
    71 posts
    Registered:
    02 Mar 2007
    15 Apr 2014 in reply to Nikola Zagorchev
    Link to this post

    Thanks Nikola Zagorchev

    Can you please let me know how to add the files and at which particular location?

    Also in the JS file i see a hardcoded link to the page service as http://localhost:60876/Sitefinity/Services/Pages/PagesService.svc/ is it fine to use it?

  9. Nikola Zagorchev
    Nikola Zagorchev avatar
    424 posts
    Registered:
    24 Nov 2016
    16 Apr 2014
    Link to this post
    Hello kami47,

    I attach an updated version of the Page Selector here. The same is also available in this forum thread.

    You can use the Page Selector custom field control by creating a new field in for an item and choosing Short Text as Type and for Interface widget for entering data choose Custom. In Type or Virtual path of the custom widget enter the path or the type of the filed control. For instance, if it is in your SitefinityWebApp project, in folder FieldControls, with name PageSelectorFieldControl, you should enter the following:
    SitefinityWebApp.FieldControls.PageSelectorFieldControl . Then, in the item template where you will evaluate this field and show it in the front-end, you should customize the template and for this field to add the following:
    <%@ Register Assembly="SitefinityWebApp" Namespace="SitefinityWebApp.FieldControls" TagPrefix="custom" %>
      
    <custom:PageSelectorFieldControl runat="server" Value='<%# Eval("myProperty")%>' DisplayMode="Read" ID="customPageSelector" />

    It is important that you specify the DisplayMode of the widget to the Read, so the conditional template for the field control will evaluate the ReadMode statement and will be displayed as a HyperLink:

    ( Code from the field control template )

    <sf:ConditionalTemplate ID="ConditionalTemplate1" Left="DisplayMode" Operator="Equal" Right="Read" runat="server">      
                <asp:HyperLink ID="HyperLink1" runat="server">Url</asp:HyperLink>
            </sf:ConditionalTemplate>

    Considering the serviceUrl, you should change the origin of the service to match yours. Example:
    http://www.mysite.com/Sitefinity/Services/Pages/PagesService.svc/
    You could refactor this if you want. This is all you should consider when adding the field control to your project and custom field.

    Regards,
    Nikola Zagorchev
    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 Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
  10. kamii47
    kamii47 avatar
    71 posts
    Registered:
    02 Mar 2007
    16 Apr 2014 in reply to Nikola Zagorchev
    Link to this post

    Thanks Nikola but i have already able to resolve my problem via help of same person [waqar] who has posted this query

  11. Nikola Zagorchev
    Nikola Zagorchev avatar
    424 posts
    Registered:
    24 Nov 2016
    17 Apr 2014
    Link to this post
    Hi,

    I am glad that you have successfully configured the page selector.

    Regards,
    Nikola Zagorchev
    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 Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
  12. kamii47
    kamii47 avatar
    71 posts
    Registered:
    02 Mar 2007
    17 Apr 2014 in reply to Nikola Zagorchev
    Link to this post

    Thanks Nikola

  13. Nikola Zagorchev
    Nikola Zagorchev avatar
    424 posts
    Registered:
    24 Nov 2016
    18 Apr 2014
    Link to this post
    Hi,

    Feel free to contact us if you need additional assistance.

    Regards,
    Nikola Zagorchev
    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 Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
13 posts, 0 answered