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

Forums / Developing with Sitefinity / Create a Designer-less control

Create a Designer-less control

4 posts, 1 answered
  1. Travis
    Travis avatar
    86 posts
    Registered:
    15 Oct 2008
    16 May 2012
    Link to this post
    Hello,
    Is there a way for me to completely remove the "Edit" link from a control in design mode? I have a control which doesn't need a designer, so, removing that link would prevent confusion for the user. Does anyone have an idea on how to achieve this?
    Thanks
  2. MB
    MB avatar
    302 posts
    Registered:
    09 Jan 2005
    16 May 2012
    Link to this post
    No idea how to remove the 'Edit' link from the control container of the page editor, but what I tend to do with controls I don't want users to mess with, is do a 'if in admin-mode' type test, and if true, render a line of red text that basically says - don't mess with this control.
  3. Tim
    Tim avatar
    258 posts
    Registered:
    22 Jun 2011
    17 May 2012
    Link to this post
    Here is a little jQuery snippet that'll take care of it:

    $('.rdTitleBar:first-child:contains("MyWidget1")').each(function () {
        $(this).find('.rdCommands').find('.rdMoreCommand').attr('style', 'border: 0px !important').end().find('a[title="Edit"]').parent().hide();
    });

    Make sure to replace "MyWidget1" with the title of your widget.
    Answered
  4. Travis
    Travis avatar
    86 posts
    Registered:
    15 Oct 2008
    17 May 2012
    Link to this post
    That's great Tim, as soon as MB replied I thought "Hmm, I could do this with jquery", but then didn't get a chance to actually try it out. Thanks for your help!
4 posts, 1 answered