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

Forums / Developing with Sitefinity / Access property of MasterView which Designer class

Access property of MasterView which Designer class

5 posts, 0 answered
  1. Ernest
    Ernest avatar
    37 posts
    Registered:
    12 Mar 2012
    27 Feb 2013
    Link to this post
    We have a custom BlogPost designer template based from this:


    http://www.sitefinity.com/blogs/boyan-barnevs-blog-/2013/02/20/extending-sitefinity-contentselectorsdesignerviews

     

    We have a blog post view template, BlogPostMasterView,  that
    has our own tag links control. This tag links control lists all the tags related
    to that blog post and the tag links are expected to redirect to the same page
    or to a different page. We need a way to provide the user the ability to select
    that page. Our idea is to have a page selector from the blog post designer then
    once the user selects the page and clicks save, the designer will access a
    property from the BlogPostMasterView and pass that id of that selected page.

     

    Once that done the BlogPostMasterView will use the id of the
    property to determine what page it wants to be used. Our problem is we don’t
    know how to access that property within the blog post designer. We know that we
    can access the masterview from the update client side event of the designer, this.get_currentMasterView(),
    but our property is still not there. We tried to add the property to the
    descriptor but we get an error “Value cannot be null. Parameter name: source”. 

    public override IEnumerable<ScriptDescriptor> GetScriptDescriptors()
            {
                var baseDesc = (ScriptControlDescriptor)base.GetScriptDescriptors().Last();
                baseDesc.AddProperty("TestProperty", TestProperty);
                return new[] { baseDesc };
            }

            private string _TestProperty;
            public string TestProperty { get { return _TestProperty; } set { _TestProperty = value; } }


    How do we achieve this objective?

  2. Ernest
    Ernest avatar
    37 posts
    Registered:
    12 Mar 2012
    28 Feb 2013
    Link to this post

    Any idea?

  3. Ernest
    Ernest avatar
    37 posts
    Registered:
    12 Mar 2012
    28 Feb 2013
    Link to this post

    To explain to more in detail I will give another example kinda similar to the one above.

    In our BlogPostMasterView template, list of all blog posts, we have a LinkButton with the purpose of redirecting a user to another page that lists all the blog posts. We want the ability to provide a way for a backend user to select a page from the blog post designer. This selected page will be identified as the page where the user will be taken once they click the linkbutton. 

    Again as explained above we know how to add the pageselector but we don't know how to make that value accessible by the BlogPostMasterView.

    Thank you

  4. Boyan Barnev
    Boyan Barnev avatar
    1429 posts
    Registered:
    28 Aug 2017
    04 Mar 2013
    Link to this post
    Hi Ernest,

    Wouldn't the default functionality provided by the SingleItemSettings designer view (where you can select a page where the detail item opens) work out for you, or the specific use case scenario is different?

    The “Value cannot be null. Parameter name: source” exception usually indicates a problem with the embedded template or an incorrectly specified virtual path, can you please ensure that these have been setup correctly?

    All the best,
    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. Ernest
    Ernest avatar
    37 posts
    Registered:
    12 Mar 2012
    04 Mar 2013 in reply to Boyan Barnev
    Link to this post

    Hi Boyan,

    Thank you for your reply. The default functionality works for providing a link to the blog post details page. What we want is for the tags links to redirect to a different page, different from the one that's assigned by the above mentioned default functionality. Here's a list of pages that's related to this objective:

    Blog-Post-Listing - a page that lists blogs posts. Each blog post has a one or more tag links. The tag links is expected to redirect to a specific page, Blog-Post-Tags.

    Blog-Post-Details - detail view of the blog post.

    Blog-Post-Tags - this page doesn't exist yet until we this question gets resolved. Basically this page has instance of the blog post control. It will list all the blog posts associated to a tag.

    We could ideally hard-code this page but we're hoping to make the option available for the user in case they want to change the page in the future. 

    Thank you for your support.

5 posts, 0 answered