INFLICT Posted February 28, 2014 Posted February 28, 2014 Hello all I am looking to modify my product listing page, how can I add code such as javascript inside the head tags of the product_listing.php page. ?? I need to add my Javascript somewhere and I'm not sure how to do this? Even when creating external files I have to use script tags to add the source location which needs to be in the html via the head tags. Do I HAVE to install add on for header controller and then add javascript there? Or is there some alternative to using an addon?
Jack_mcs Posted February 28, 2014 Posted February 28, 2014 Product listing is a module, not a page, which means it can be on many pages. It's not required that javascript be in the head section. You can put it in the file for the page you want it to apply to or include it in the template top file. You can add a check in that file to only add it if a certain page is loaded. Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons
INFLICT Posted February 28, 2014 Author Posted February 28, 2014 Okay thanks Jack so now the question is where is the file for the product_listing.php page so I can go ahead and add the javascript and all my other script tags?
INFLICT Posted February 28, 2014 Author Posted February 28, 2014 So to give you more information on what I am doing, I am adding the bxGallery functioanlity to product_listing page too. So I'm not sure where to add the bxGallery script $(document).ready(function(){ $('#piGal').bxGallery({ maxwidth: 400, thumbwidth: 110, thumbcrop: true, croppercent: .50, thumbplacement: 'bottom', thumbcontainer: 400, opacity: .5, load_text: 'loading...', load_image: 'pix/loading.gif', wrapperclass: 'gallery' }); }); </script>
Jack_mcs Posted February 28, 2014 Posted February 28, 2014 You add it to the page where it is needed. You can add it to the product_listing file too. It really doesn't matter as long as the code that needs the function can find it and it doesn't conflict with some other code. Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons
INFLICT Posted February 28, 2014 Author Posted February 28, 2014 Jack, first I appreciate your help, second you state "add it to the page where it is needed" I don't know what page that is and that is why I'm here asking the question. I tried embedding it at various locations within the product_listing page and it isn't working. I have the same code in notepad locally viewing it via a web browser and it is working fine. So I'm a bit stuck.
Jack_mcs Posted February 28, 2014 Posted February 28, 2014 Let's say your domain name is abc.com and you go to abc.com/index.php, index.php is the page. If you go to abc.com/privacy.php, privacy.php is the page. See the pattern? If you have a url rewriter installed that changes how the urls are displayed, then turn it off while you visit the pages so you know which one you are on. Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons
Recommended Posts
Archived
This topic is now archived and is closed to further replies.