Welcome to TalkGraphics.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2004
    Posts
    2

    Default

    Apparently, it is impossible to make a DW template with WS4, make pages from that template, and then update any included navbar, without breaking the navbar links on these pages.

    See Harry the Spider's message and my reply, below.

  2. #2
    Join Date
    Jan 2004
    Posts
    1,830

    Default

    not completely true. I gave it a go and am by no means an expert with Dreamweaver so apologies if the approach is long winded
    .

    When you create a template and insert a navbar within it, it causes various script elements to be inserted in the template page which reference the location of the JavaScript files used to create and display the navbar. The script elements contain relative links to the location of the JavaScript files

    For example,

    <script webstyle3>document.write('<scr'+'ipt src="xaramenu.js">'+'</scr'+'ipt>');document.write('<scr'+'ipt src="template.js">'+'</scr'+'ipt>');/*img src="template.gif" moduleid="webstyle (Project)\template_off.xws"*/</script>

    Following this, you select to create some web pages which you would probably store in a separate folder in comparison to the template file.

    Having created a page you select to apply a template to the page This causes the script elements to be applied to your web page. Assume your web page is named index.htm Applying the template will cause the script elements to be applied to the page as
    <script webstyle4>document.write('<scr'+'ipt src="xaramenu.js">'+'</scr'+'ipt>');document.write('<scr'+'ipt src="template.js">'+'</scr'+'ipt>');/*img src="template.gif" moduleid="webstyle (Project)\template_off.xws"*/</script>

    Now you select to view your web page index.htm in a web browser. The web browser reads the source code of the web page and attempts to retrieve the file xaramenu.js and template.js from the same folder as where the web page resides as this is what the source code tells it to do.

    However the navbar will not display. This is because the files xaramenu.js and template.js are not in the same folder as the web page.

    To work around this problem, you need to know the published url of where the template file and the other files in the template folder will be published to.

    This will probably be http://www.yourdomainname.com/Templates

    Once you know this information and have uploaded the Template and files within the folder to this location, select to edit the html which makes up your template. Find the code which references the navbars as below

    <script webstyle3>document.write('<scr'+'ipt src="xaramenu.js">'+'</scr'+'ipt>');document.write('<scr'+'ipt src="template.js">'+'</scr'+'ipt>');/*img src="template.gif" moduleid="webstyle (Project)\template_off.xws"*/</script>
    And ammend this to contain the full url of where the files mentioned are located. So the above would become

    <script webstyle3>document.write('<scr'+'ipt src="http://yourdomainname.com/Templates/xaramenu.js">'+'</scr'+'ipt>');document.write('<scr'+'ipt src="http://yourdomainname.com/Templates/template.js">'+'</scr'+'ipt>');/*img src="template.gif" moduleid="webstyle (Project)\template_off.xws"*/</script>

    Then apply the template to your web pages stored in separate folders and the menu would be displayed in the web pages when viewed in a web browser.

    The menu will not be displayed within the editing mode of Dreamweaver. To resolve this problem, lets look again at the code.
    <script webstyle3>document.write('<scr'+'ipt src="http://yourdomainname.com/Templates/xaramenu.js">'+'</scr'+'ipt>');document.write('<scr'+'ipt src="http://yourdomainname.com/Templates/template.js">'+'</scr'+'ipt>');/*img src="template.gif" moduleid="webstyle (Project)\template_off.xws"*/</script>

    In the above example, you see the code img src="template.gif This is being used by Dreamweaver to cause the image of the navbar to be displayed in the normal mode of Dreamweaver.

    We need to change the relative path to the image template.gif to be a full path. Therefore the above snippet would become

    <script webstyle3>document.write('<scr'+'ipt src="http://yourdomainname.com/Templates/xaramenu.js">'+'</scr'+'ipt>');document.write('<scr'+'ipt src="http://yourdomainname.com/Templates/template.js">'+'</scr'+'ipt>');/*img src="file:///c:/template/template.gif" moduleid="webstyle (Project)\template_off.xws"*/</script>

    Alternatively Navigate to the folder on your local computer where this gif file resides. Copy the file and paste it into the folder in which your web pages reside. This will allow the graphic to be displayed within your web pages in the Dreamweaver editor.

  3. #3
    Join Date
    Dec 2003
    Location
    UK
    Posts
    12

    Default

    I'd just like to add my penny's worth. I use both FP and Dreamweaver and experienced problems with both, but particularly with Macromedia Templates. I note on this forum lots of advice to edit the scripts, which is fine as far as "a" solution goes. But does it not completely defeat the object of having menus which are easily updated without the need for constant copying of .js files and/or editing scripts? Xara should really do something about it once and for all. Too many people experience these problems because they are trying to develop organised site structures. I have raised this with Xara to no avail. I think all should raise this problem so they sit up and take notice of what should be a minor fix to their scripting. Any comments anyone.

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •