paul
29-09-2007, 13:13
I have some javascript working on a product page. Taken from this source
http://dynamicdrive.com/dynamicindex17/ajaxtabscontent/index.htm
It references and pulls in content from external files on the same domain and displays in tabs on a product page. its working and displaying very well.
The file references are along the lines of:
"/user/content/tabcontent1.htm" - to display in tab 1
"/user/content/tabcontent2.htm" - to display in tab 2
the javascript code is currently entered on the product editor page.
My object is to have the main javascipt entered on the category editor page and therefore displaying for all products within. The product paths however need to reference different files relating to each product as the content will be different for each product.
A filepath for each product would therefore be something like:
for sku1:
"/user/content/sku1/tabcontent1.htm"
"/user/content/sku1/tabcontent2.htm"
"/user/content/sku1/tabcontent3.htm"
for sku2:
"/user/content/sku2/tabcontent1.htm"
"/user/content/sku2/tabcontent2.htm"
"/user/content/sku2/tabcontent3.htm"
now for the potential time saving bit - is there a way of replacing "sku_x" dynamically to reference the sku for each product page? i would only then need to create a folder for each sku and save the content in tabcontent1.htm, tabcontent2.html..... I would not need to create different file references on each product editor page.
i only ask this as i recently discovered you could reference the domain dynamically ("+window.location.hostname+"/) otherwise i wouldnt have imagined this would be possible.
sorry for the long post but hope its clear:confused:
http://dynamicdrive.com/dynamicindex17/ajaxtabscontent/index.htm
It references and pulls in content from external files on the same domain and displays in tabs on a product page. its working and displaying very well.
The file references are along the lines of:
"/user/content/tabcontent1.htm" - to display in tab 1
"/user/content/tabcontent2.htm" - to display in tab 2
the javascript code is currently entered on the product editor page.
My object is to have the main javascipt entered on the category editor page and therefore displaying for all products within. The product paths however need to reference different files relating to each product as the content will be different for each product.
A filepath for each product would therefore be something like:
for sku1:
"/user/content/sku1/tabcontent1.htm"
"/user/content/sku1/tabcontent2.htm"
"/user/content/sku1/tabcontent3.htm"
for sku2:
"/user/content/sku2/tabcontent1.htm"
"/user/content/sku2/tabcontent2.htm"
"/user/content/sku2/tabcontent3.htm"
now for the potential time saving bit - is there a way of replacing "sku_x" dynamically to reference the sku for each product page? i would only then need to create a folder for each sku and save the content in tabcontent1.htm, tabcontent2.html..... I would not need to create different file references on each product editor page.
i only ask this as i recently discovered you could reference the domain dynamically ("+window.location.hostname+"/) otherwise i wouldnt have imagined this would be possible.
sorry for the long post but hope its clear:confused: