Skip to main content
Inspiring
November 22, 2020
Answered

Possible bug in Dreamweaver

  • November 22, 2020
  • 2 replies
  • 856 views

I created a template for a web page. It looks perfect and the links work. Part of the page is a <div> that contains a map that is pan and zoomable. I use Zoomify to create the pan and zoom.

 

Below are two scripts, as they appear in the template, that are necessary for Zoomify to work. In the first there is one path to a js. In the second there are two paths to folders that are necessary. These paths work in the template..

 

I create the final web page from the template using File > New > ....

 

If I save the resulting file to the template folder, the map is displayed and pans and zooms. Let me point out that saving to this folder means that the paths to the Zoomify files do not need adjustment.

 

If I save it to any other folder, the map does not display and I get a "404 - Not Found" error message. I look at the file created and the path to the js has been modified correctly, but the path to the other two folders has not been modified. This lack of updating the paths is my problem.

 

The scripts are in a non-editable region. A short term fix is to create an editable region at their location and manually correct the paths. But that is a very poor solution.

 

If there is no reason for this to be happening intentionally, then there appears to be a bug. I would like to get your opinion.

 

<script type="text/javascript" src="../assets/zoom/ZoomifyImageViewerPro-min.js"></script>
<script type="text/javascript"> Z.showImage("myContainer", "../assets/maps/0312/map_0312_final","zSkinPath=../assets/zoom/Assets/Skins/Default&zNavigatorVisible=0&zToolbarVisible=1&zLogoVisible=0&zCoordinatesVisible=0&zInitialZoom=fit&zMinZoom=8&zMaxZoom=100"); </script>

This topic has been closed for replies.
Correct answer Nancy OShea

'This works, but means I can't simply test the template during construction. This is of course only an issue with pages that use Zoomify.'

 

Why don't you upload the scripts and zoomify assets to your remote server and link directly to the scripts/assets using the full url path in your template. That way the scripts will be available for you at construction level, assuming you are connected to the internet.


Right.  Use an absolute path to assets (https://yoursite.com/assets/etc....) instead of a document relative path.

 

2 replies

Nancy OShea
Community Expert
Community Expert
November 22, 2020

Sorry if I'm covering old ground here but I can't see your code so I must ask a lot of silly questions.

 

1. Are you working in a defined local site folder that resides on your primary hard drive?

 

2. Does your DWTemplate (.dwt) reside in the Templates folder within the site's root?

 

3. Did you validate code in your Template.dwt file to ensure it is error-free?

 

4. When creating your child page, did you use File > New > Site Template > Create and then immediately save your child page to the local site folder?

 

5. Can we see the path to scripts from your Template.dwt and the child page spawned from that template?  DW should automatically resolve paths for you when the child page is saved. 

 

6. The Templates folder is for template.dwt files ONLY.  No other files or assets should ever be saved there.

 

7. Are you using links relative to Site Root or Document?  Site root relative links work just fine on the server but may fail locally.  For this reason, I prefer document relative links.

 

Nancy O'Shea— Product User & Community Expert
Inspiring
November 22, 2020

1. I'm using a virtual server on my drive. The virtual server allows me to see Zoomify images.

 

2. Yes

 

3. Yes. No errors or warnings.

 

4. Yes

 

5. Yes I can see the paths to the scripts. The first one

 

<script type="text/javascript" src="../assets/zoom/ZoomifyImageViewerPro-min.js"></script>

 

is changed (resolved) correctly when the webpage is created. The second two

 

<script type="text/javascript"> Z.showImage("myContainer", "../../assets/maps/0312/map_0312_final","zSkinPath=../../assets/zoom/Assets/Skins/Default&zNavigatorVisible=0&zToolbarVisible=1&zLogoVisible=0&zCoordinatesVisible=0&zInitialZoom=fit&zMinZoom=8&zMaxZoom=100"); </script>

 

are not changed (resolved) correctly. They are not changed at all in the page that is created.

 

6. Yes, I know that only templates go in the templates folder. I did an experiment and saved the created page to the templates folder only to see what was happening w.r.t. changing the links. When saved to the template folder no changes had to be made and so the resultant page worked correctly. I have removed that page from the folder.

 

7. The links I create in the template are relative to the template.

 

My solution is to create the paths in the template relative to the final destination of the web page for the paths that are not  being resolved. This works, but means I can't simply test the template during construction. This is of course only an issue with pages that use Zoomify.

 

Marcus

I'm a novice, but it is my guess that the problem lies in the way the unresolved paths are embedded in the script.

BenPleysier
Community Expert
Community Expert
November 23, 2020
I'm a novice, but it is my guess that the problem lies in the way the unresolved paths are embedded in the script.

That remark does not point to coming from a novice. You are dead right.

 

Keep in mind that Dreamweaver's template system is vastly outdated. The system was created by Macromedia back in the days when HTML documents were devoid of CSS and JS. 

 

 

Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
Inspiring
November 22, 2020

I realized that putting the script in an editable region was not the optimum solution. The problem is that if a change is made to the template, then the web page created will be changed. This means that I have to go through all the associated files, and that will be more than 200 in the end, make the correction to the paths.

 

So my end solution is to intentionally enter a path in the template that will not work if the template is viewed in a browser, but the path will be correct when the web page is in its final location.

BenPleysier
Community Expert
Community Expert
November 22, 2020

I am not sure how you are creating and using the template. If the template is created as an include file, then you will need to construct the links as if they resided in the main document. 

 

Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
Inspiring
November 22, 2020

Thank you for answering. Sorry, but I do not know what an "include file" is. I look it up on the internet and still not sure.

 

I create an html file as a template ... a plain old html file with head and body. Only the parts that are specific to each child are editable. The lines I wrote about are part of the code because they are needed for Zoomify to work.

 

But what do believe I understand is that I need to construct the links as they need to be when saved in their final location. That's what I have done at this point. It works, but means that I can't test the template without creating a child. But that is no big problem.