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

Forums / Developing with Sitefinity / Which module instance is being edited?

Which module instance is being edited?

7 posts, 0 answered
  1. Len
    Len avatar
    14 posts
    Registered:
    10 Jul 2008
    16 Aug 2010
    Link to this post
    Hi all from Canada.

    I built a user control which I am inserting into a ~/Sitefinity/Admin/ControlTemplates/MyControl/ControlPanelEdit.ascx file.  The user control is supposed to allow me to tie into our database tables and whatnot.  I want to display a fancy interface and provide some complex interaction for the admin.  I'll store and fetch the results myself.  Nothing too much to do with Sitefinity, I'll do the work, I just need to be stuck onto the admin page.  That's all well and good and works fine, really, except that I have one issue and I cannot figure it out for the life of me.  I cannot seem to get the id of the module instance currently being edited!!

    I see in the GCMetaData table all the values stored for my module instance, and that they are all keyed by a GUID in the ContentID field.  So I insert my ascx into the admin container and everything works well, except that I cannot figure out how to get that GUID for the module instance currently being edited.  I want to use that value as a key into my own tables.

    I am sure I am missing something basic here.  If this rings a bell with anyone I would surely appreciate the helping hand.

    Len
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    17 Aug 2010
    Link to this post
    Hi Len,

    I cannot seem to get the id of the module instance currently being edited!!


    The Id of the content item that is being edited is appended to the QueryString -  Param=eb04ad1d-ee02-4b15-84de-e4777891bc49. This is the easiest way to retrieve it. You can check this at sitefinity demo website

    Kind regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Len
    Len avatar
    14 posts
    Registered:
    10 Jul 2008
    17 Aug 2010
    Link to this post
    Hi Ivan.

    Thanks for your reply.

    I don't get this.  Yes, I see see the querystring parameter on the demo site but I do not see the same thing on my site.  My url shows http://localhost/AvonMaitland/Sitefinity/Admin/Modules.aspx?module=Calendar and that's it.  I get the same url parameters on the live site.  On the demo site I see an url like: http://demo.sitefinity.com/Sitefinity/Admin/Modules.aspx?module=News&route=NewsControlPanel.NewsItemsView.NewsItemEdit&Param=1126cdb0-91d0-47ba-bcc7-da8b3063900f&ParentId=00000000-0000-0000-0000-000000000000.  I am not seeing these extra parameters myself.  And I am looking at similar pages: editing a generic content-based module instance.

    What gives?  What am I missing?  Thanks so much for your assistance.

    Len
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    17 Aug 2010
    Link to this post
    Hi Len,

    1. Which version of Sitefinity you use?

    2. module=Calendar indicates that you are using a custom module  and whether the QueryString will be appended or not depends on the way that this module is implemented.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Len
    Len avatar
    14 posts
    Registered:
    10 Jul 2008
    17 Aug 2010
    Link to this post
    Thank you again, Ivan.

    I am using SF 3.7.

    Maybe I should not have been so specific then about whether or not I am using a generic content-based module.  Perhaps I am not.  How can I get this value in another way?  Or how should I change my code to supply the querystring parameter?

    Len
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    17 Aug 2010
    Link to this post
    Hi Len,

    Since you use Sitefintiy 3.7 you can check the the QueryString with item ID is appended in the Url. The easiest way to get the id in your custom module is using the query string or expose some other methods like saving the item id in a HiddenField when you edit this item and then reading the HiddenField value.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  7. Len
    Len avatar
    14 posts
    Registered:
    10 Jul 2008
    17 Aug 2010
    Link to this post
    Hi Ivan.

    I can check the the QueryString with item ID is appended in the Url?  You're confusing me here, which is admittedly not that hard. ;)

    I don't mind putting the itemid into a hidden field or whatever but I need to get that itemid first.  That's my issue.  My usercontrol is inserted onto my ControlPanelEdit.ascx page and I cannot figure out how to get the guid for the module being edited.  I don't mind putting some code into ControlPanelEdit.ascx to pass the value onto my usercontrol but I just cannot seem to get the value in the first place.  I can see the values in the GCMetaData table but I cannot figure out how to retrieve the value for the module instance currently being edited.

    Any help you could offer me is greatly appreciated.

    Len
Register for webinar
7 posts, 0 answered