Using Javascript in Topics

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
11 Jahre weitere
Hi All,

I am trying to use a lighbox to play a video on a page that generated in a topic, if I put the code on to a fixed page (one not generated from a topic) it works.

But if I put the following code

<div class="fulldescription">
                    <!--Video Section Here-->
<div class="videogallery"><a class="voverlay" href="/videoplayer/player.swf?url=../video/copsrabbits.flv&amp;volume=100" title="CopsRabbits"><img src="/images/copsrabbits.png" alt="CopsRabbits" /><span></span></a></div>
<!--end Video section-->

It works on the main home page but if I drop this in to a product then it dose not open it in a lightbox it opens a new window or opens a new page.

Can any one suggest why the java-scripts not executing on a topic page!
11 Jahre weitere
What version are you using?

When you say homepage, do you mean you are placing it inside the Homepage topic?
11 Jahre weitere
If I manual edit the home page view it allows me to place the videos I did not mean in the homepage topic text.

I am using Nop 2.5,

I am going to have another look my self to day to see if I can get the javascrip window and a jquary working today.
11 Jahre weitere
hey Tokra30,

That's exactly what I was wondering. Here are my examples of using jquery with nopCommerce:

www.icc.com
www.cablesys.com

The sliders on both homepages are using jquery. To do this, you just add in your necessary calls in the header view. Then inside the homepage text, I add in the necessary html with ID tags so that it notices which elements to initiate the calls. If you need to add in extra calls within the body, inside the Home view, I add those calls in after it calls the HomepageText topic.

If you are attempting to add in calls in the body with a specific topic, you will have to do it two ways, which start with the topic view.

1. Simply add the call inside the topic view. Keep in mind that it will load the call for every topic though.
2. You can use an IF statement inside the topic view to find IF you are SystemName = "testPage" then add your call to the body. ( I use this specific tactic to determine whether I need a full width page or need to display something specific for a special topic and what not )

Hope that helps.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.