Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Kasper Gadensgaard 31 posts 52 karma points
    Jun 24, 2012 @ 14:24
    Kasper Gadensgaard
    0

    Data Editor - Link to internal file

    Hi,

    I am trying to create a custom data editor (using the AbstractDataEditor class), and i have it mostly working, however i dont know how to link to an internal file. 

    I would like to open a model popup in umbraco when i click a button, so i am using the following javascript:

    Button btnPopup = new Button();

                 btnPopup  .Text = "Popup";

                 btnPopup  .Attributes.Add("onClick", "UmbClientMgr.openModalWindow('" + PATH-TO-FILE.html + "', 'Browse', true, 800, 600)");

    where PATH-TO-FILE represents the path to the internal file of my class library. However, how do i retrieve this path?

    Thanks in advance

    Regards.

  • Tom Fulton 2030 posts 4996 karma points c-trib
    Jun 24, 2012 @ 14:56
    Tom Fulton
    0

    Hi,

    Is the file something you have setup as an Emedded Resource in your project?  If so you can use something like GetWebResourceUrl to retrieve the path, and use the namespace as the path to the file (ie YourProject.Resources.YourFile.ext)

    If it's not an embedded resource, you'll need to copy the file to the Umbraco installation.  A common path to use is /umbraco/plugins/<your plugin>/<your file>, then you can sue that as the PATH-TO-FILE

    Hope this helps,
    Tom 

  • Kasper Gadensgaard 31 posts 52 karma points
    Jun 24, 2012 @ 15:09
    Kasper Gadensgaard
    0

    Hi,

    Thanks for your reply. 

    I will place it in the plugins folder if that is common practice :).

  • Kasper Gadensgaard 31 posts 52 karma points
    Jun 24, 2012 @ 15:40
    Kasper Gadensgaard
    0

    Where is the index file for the TinyMCE editor located etc? And where do they "link" to it from the data editor?

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies