This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > Dreamweaver > June 2004 > Reduce size of Project Seven popup menus across 500 pages?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Reduce size of Project Seven popup menus across 500 pages?
|
|
| John Williams 2004-06-10, 11:14 pm |
| I've converted a site to use the Project Seven simple popup menus.
Previously the menus were created dynamically using Javascript
(Microsoft toolbar.js), which had the advantage that all the menu code
was contained in a single .js file referenced by each HTML page and
the only code required in each HTML page to use the menu was:
<SCRIPT language="JavaScript" type="text/JavaScript">
<!--
setRelPath("../../../");
createMenus() ;
drawToolbar();
//-->
</SCRIPT>
where the setRelPath function sets a relative path string which is
prepended to every relative URL in the code.
This method reduced file sizes quite a bit, however with the PVII
menus in 500 HTML pages an additional 4Mb has been added.
How can I reduce the size of the PVII menus across 500 pages? Every
page has the same set of menus. The only difference, menu-wise
between 2 pages are the relative URLs in the HREF attributes, which
are obviously different depending on the location of the page in the
folder hierarchy. Can HTML menu code that is common to every page be
stored in a single file with the relative path set accordingly in each
HTML page? Can I move the PVII menu HTML to a Javascript file and
write it dynamically, or would that negate the advantages of the PVII
menu system?
Thanks for any advice or help.
| |
| Al Sparber- PVII 2004-06-10, 11:14 pm |
| John Williams wrote:
>Can HTML menu code that is common to every page be
> stored in a single file with the relative path set accordingly in each
> HTML page? Can I move the PVII menu HTML to a Javascript file and
> write it dynamically, or would that negate the advantages of the PVII
> menu system?
Yes it would.
The most efficient way for you to deploy your menu in a 500 page site,
is probably similar to how we do it in a larger one (projectseven.com)
and that is to use includes. If you go to our infoBase there is a tech
note that will give you the basics in a Dreamweaver context but I would
recommend a little Googling on includes or SSI.
--
Al Sparber - PVII
http://www.projectseven.com
DW Extensions - Menu Systems - Tutorials - Templates
---------------------------------------------------------
Webdev Newsgroup: news://forums.projectseven.com/pviiwebdev/
CSS Newsgroup: news://forums.projectseven.com/css/
RSS Feeds: http://www.projectseven.com/xml/
| |
| Murray *TMM* 2004-06-10, 11:14 pm |
| > Can HTML menu code that is common to every page be
> stored in a single file with the relative path set accordingly in each
> HTML page?
Yes - it's called a server-side include. However, it won't affect your
download times, since it's inserted in each page by the server. But it will
make any updates much more convenient since you will only have to upload the
one file. Make sure you use ROOT RELATIVE links in the include file, and
that it is a code FRAGMENT.
> Can I move the PVII menu HTML to a Javascript file and
> write it dynamically, or would that negate the advantages of the PVII
> menu system?
Don't do that. It would negate everything. You can, however, externalize
all the javscript required to support these menus, and by doing that you
will experience a significant benefit since that code is cached by the
browser.
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver MX
(If you *MUST* email me, don't LAUGH when you do so!)
==================
news://forums.macromedia.com/macromedia.dreamweaver - THE BEST WAY TO GET
ANSWERS
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
"John Williams" <johnwilliams_esquire@hotmail.com> wrote in message
news:a5983fd.0406101439.505eb5fb@posting.google.com...
> I've converted a site to use the Project Seven simple popup menus.
> Previously the menus were created dynamically using Javascript
> (Microsoft toolbar.js), which had the advantage that all the menu code
> was contained in a single .js file referenced by each HTML page and
> the only code required in each HTML page to use the menu was:
>
> <SCRIPT language="JavaScript" type="text/JavaScript">
> <!--
> setRelPath("../../../");
> createMenus() ;
> drawToolbar();
> //-->
> </SCRIPT>
>
> where the setRelPath function sets a relative path string which is
> prepended to every relative URL in the code.
>
> This method reduced file sizes quite a bit, however with the PVII
> menus in 500 HTML pages an additional 4Mb has been added.
>
> How can I reduce the size of the PVII menus across 500 pages? Every
> page has the same set of menus. The only difference, menu-wise
> between 2 pages are the relative URLs in the HREF attributes, which
> are obviously different depending on the location of the page in the
> folder hierarchy. Can HTML menu code that is common to every page be
> stored in a single file with the relative path set accordingly in each
> HTML page? Can I move the PVII menu HTML to a Javascript file and
> write it dynamically, or would that negate the advantages of the PVII
> menu system?
>
> Thanks for any advice or help.
| |
| John Williams 2004-06-11, 7:15 pm |
| "Murray *TMM*" <forums@HAHAgreat-web-sights.com> wrote in message news:<caavts$5d1$1@forums.macromedia.com>...
>
> Yes - it's called a server-side include. However, it won't affect your
> download times, since it's inserted in each page by the server. But it will
> make any updates much more convenient since you will only have to upload the
> one file. Make sure you use ROOT RELATIVE links in the include file, and
> that it is a code FRAGMENT.
>
>
> Don't do that. It would negate everything. You can, however, externalize
> all the javscript required to support these menus, and by doing that you
> will experience a significant benefit since that code is cached by the
> browser.
Thank you, Murray and Al.
I suspected that converting to Javascript wouldn't be recommended. I
am using a single Javascript file to support the menus (autolayers,
autohide etc), however the server doesn't support SSI, so I'll have to
leave as is.
| |
| Murray *TMM* 2004-06-11, 11:14 pm |
| John:
As I mentioned, an include would help convenience-wise, but not download
time wise....
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver MX
(If you *MUST* email me, don't LAUGH when you do so!)
==================
news://forums.macromedia.com/macromedia.dreamweaver - THE BEST WAY TO GET
ANSWERS
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
"John Williams" <johnwilliams_esquire@hotmail.com> wrote in message
news:a5983fd.0406111421.5f4d47ad@posting.google.com...
> "Murray *TMM*" <forums@HAHAgreat-web-sights.com> wrote in message
news:<caavts$5d1$1@forums.macromedia.com>...
will[color=darkred]
the[color=darkred]
and[color=darkred]
externalize[color=darkred]
>
> Thank you, Murray and Al.
>
> I suspected that converting to Javascript wouldn't be recommended. I
> am using a single Javascript file to support the menus (autolayers,
> autohide etc), however the server doesn't support SSI, so I'll have to
> leave as is.
|
|
|
| | Copyright 2003 - 2009 forum4designers.com Software forum Computer Hardware reviews |
|