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

Forums / General Discussions / Controls Not Always Showing

Controls Not Always Showing

8 posts, 0 answered
  1. Chris
    Chris avatar
    37 posts
    Registered:
    18 Jan 2012
    06 Jun 2012
    Link to this post
    I am creating pages with a custom control (a video player). After I'm finished with that, I go to view the page, and the control shows up perfectly. But when I go to preview or edit the page, the control disappears.

    In other words:

    http://localhost:8080/course-catalog/4th-grade-wellness---part-2/part-2/lesson-20/video_1 works fine.
    http://localhost:8080/course-catalog/4th-grade-wellness---part-2/part-2/lesson-20/video_1/Action/Preview/ does not.
    http://localhost:8080/course-catalog/4th-grade-wellness---part-2/part-2/lesson-20/video_1/Action/Edit does not.

    When the pages themselves are created, we use the fluent API, but when adding the controls, we use the standard API. (Is that the correct term?) Would that have anything to do with it?

    I can provide some code upon request.

    Thanks,
    Chris Aumiller
  2. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    07 Jun 2012
    Link to this post
    Whats the code look like for the player?  The pageeditor doesn't allow javascript.  Well if you use the SF JS embed control it'll disable it in edit mode...if the JS is linked in with a plain old script tag I think itll run.
  3. Chris
    Chris avatar
    37 posts
    Registered:
    18 Jan 2012
    07 Jun 2012
    Link to this post
    Steve,

    We actually use the flowplayer if you're familiar with that.

    -Chris
  4. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    07 Jun 2012
    Link to this post
    Yep, I've used it before

    How are you linking in the flowplayer scripts in the control though?
  5. Chris
    Chris avatar
    37 posts
    Registered:
    18 Jan 2012
    07 Jun 2012
    Link to this post
    In the InitializeControls section of the class, the following code is called:

    var insertFlowPlayer = string.Format("$(document).ready(function () {{LB.Video.InsertFlowPlayer('{0}','{1}');}});", targetId, objVideo.VideoURL);
     
    // insert javascript into the startup placeholder to activate the player
    var jsControl = new HtmlGenericControl("script");
    jsControl.Attributes.Add("type", "text/javascript");
    jsControl.InnerHtml = insertFlowPlayer;
    VideoPlayerStartup.Controls.Add(jsControl);

    I should mention that we hadn't seen this before we upgraded to Sitefinity 5, so that may have something to do with it.

    -CA
  6. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    07 Jun 2012
    Link to this post
    If you open the Chrome Console or Firebug console...any javascript errors?
  7. Chris
    Chris avatar
    37 posts
    Registered:
    18 Jan 2012
    07 Jun 2012
    Link to this post
    Will have to look... working on another project at the moment and it's one of those things I can't switch midstream.

    -CA
  8. Chris
    Chris avatar
    37 posts
    Registered:
    18 Jan 2012
    08 Jun 2012
    Link to this post
    And I looked... no javascript errors.

    -CA
8 posts, 0 answered