manipulation of header module

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 anni tempo fa
I have a small script running in the header module - not very sophisicated but shows a selection of images. - the area of display is organisaed by a div tag

However - the images only show up when i'm on the home page and a top page that was already created on instalation.

No images show in the header when i am on a product or category page or a topic page that i created in the backend.

my images and script are located in a specific folder in the root.

I simply don't understand why the script/images do not run on these pages?

can anyone help!!
13 anni tempo fa
it possibly the path from the category and product pages - are you using relative paths ?

try formatting the link like this:

<img src="<%=Page.ResolveUrl("~/images/graphics/my-image.png")%>" alt="" />

(if this does not help, post your implementation of the code)
13 anni tempo fa
you are right about the relative path

the code i am using is shown below

<div class="slideshow">
<script>var slide1foldername='hccpslideshowimages/';</script><script charset="utf-8" src="hccpslideshowimages/slide1.js" type="text/javascript"></script>
</div>

It is not very sophisticated but works very well - as soon as i get to product or category or topics the images dissappear. it basically cant find the script to run?

as per usual - many thanks in advance - Warren
13 anni tempo fa
warren,

i think this will work to get the script located

<div class="slideshow">
<script>var slide1foldername='hccpslideshowimages/';</script><script charset="utf-8" src="<%=Page.ResolveUrl("~/Scripts/hccpslideshowimages/slide1.js")%>" type="text/javascript"></script>
</div>

but i have my doubts about the images being found - try it anyway - i'll try spend more time on it tonight - maybe we can come up with something
13 anni tempo fa
You are quite right, it doesn't find the images on the products/categories/topics pages, but i think the issue is finding the whole folder with the script and the images in it.

When you get into the product, category and self constructed topics the path to find the folder has an extra layer to go through.

As far as i can see from the developer tool i am using, the div tag that is automatically inserted when the script runs, just doesn't appear, therefore the whole folder must not be found.

the site is www.hccarnivorousplants.co.uk - this might help you better understand the issue.

Thanks for your help - Warren
13 anni tempo fa
warrencowan wrote:
You are quite right, it doesn't find the images on the products/categories/topics pages, but i think the issue is finding the whole folder with the script and the images in it.

When you get into the product, category and self constructed topics the path to find the folder has an extra layer to go through.

As far as i can see from the developer tool i am using, the div tag that is automatically inserted when the script runs, just doesn't appear, therefore the whole folder must not be found.

the site is www.hccarnivorousplants.co.uk - this might help you better understand the issue.

Thanks for your help - Warren


You need to set the JavaScript variable 'slide1foldername' to use a more absolute path (relative to the root of the site). The problem occurs in the products/categories/topics pages because the relative path you're currently using is looking for the hccpslideshowimages folder in the nonexistent folders added to the URL (via URL rewriting) for these sections.

Changes are underlined:
<script type="text/javascript">
    var slide1foldername='/shop/hccpslideshowimages/';
</script>


.
13 anni tempo fa
you my friend are a complete star!! - i forgot that i had  everything in a virtual folder

many thanks - Warren
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.