This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > Dreamweaver > May 2005 > template and navigation
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 |
template and navigation
|
|
| stefbubbles 2005-05-31, 7:20 pm |
| hello.
I created a template, including my navigation, which is made of
button-rollover-images!
I don't want to apply a "changing region" for this navigation bar, I want it
included in the template!
When I'm visiting a page in my site, I wish that the concerned navigation
button becomes a regular IMAGE, and not a rollover image anymore.
I need to be able to change this button, WITHOUT "de-applying the template to
the page"!
Is it possible to change this little button (and the other ones on the other
pages) ....
"de-applying one image, instead of the whole page"!
I'm not sure if I'm clear, but if you have a solution, I would really
appreciate!
THANKS a looooooot.
| |
| Murray *TMM* 2005-05-31, 7:20 pm |
| There are many ways to do this using both CSS and javascript.
Here's one way -
Put this in script tags in the head of the the template document between
script tags (in an editable region) -
function P7_downImage() {
var g7="<imagename>"
var g7url="<pathname>"
if ((g7=MM_findObj(g7))!=null) {g7.src=g7url;}
}
and this on the <body> tag
onload="P7_downImage()"
Then on each page you would need to make two edits:
Set g7 to the *name* of the button (not the file name but the HTML name -
e.g., "productsbutt"), and g7url to the pathname to the button (e.g.,
"images/nav/button3.gif"), and bada bing, bada boom!
There is an excellent tutorial here -
http://www.projectseven.com/support/answers.asp?id=126
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
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
==================
"stefbubbles" <webforumsuser@macromedia.com> wrote in message
news:d7hnk8$1v7$1@forums.macromedia.com...
> hello.
> I created a template, including my navigation, which is made of
> button-rollover-images!
>
> I don't want to apply a "changing region" for this navigation bar, I want
> it
> included in the template!
>
> When I'm visiting a page in my site, I wish that the concerned navigation
> button becomes a regular IMAGE, and not a rollover image anymore.
>
> I need to be able to change this button, WITHOUT "de-applying the template
> to
> the page"!
> Is it possible to change this little button (and the other ones on the
> other
> pages) ....
> "de-applying one image, instead of the whole page"!
>
> I'm not sure if I'm clear, but if you have a solution, I would really
> appreciate!
> THANKS a looooooot.
>
| |
| stefbubbles 2005-05-31, 7:20 pm |
| hey murray,
thank you for your answer!
I was just trying that, to insert the code...
but I must be doind something wrong.
I insert the code where you said in the template.
then I create a page using this template, but I can't change the "imagename"
to the name of my picture!
IT'S grey- LOCKED! ... like the region is uneditable. I can't type the new
name.
any idea what I'm doing wrong.
thanks!
| |
| Murray *TMM* 2005-05-31, 7:21 pm |
| Show me what you have done, please.
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
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
==================
"stefbubbles" <webforumsuser@macromedia.com> wrote in message
news:d7hs0s$8ef$1@forums.macromedia.com...
> hey murray,
> thank you for your answer!
> I was just trying that, to insert the code...
> but I must be doind something wrong.
>
> I insert the code where you said in the template.
> then I create a page using this template, but I can't change the
> "imagename"
> to the name of my picture!
> IT'S grey- LOCKED! ... like the region is uneditable. I can't type the new
> name.
> any idea what I'm doing wrong.
> thanks!
>
| |
| stefbubbles 2005-05-31, 7:23 pm |
| here is what I wrote in the template... in between script tags:
function P7_downImage() {
var g7="<imagename>"
var g7url="<pathname>"
if ((g7=MM_findObj(g7))!=null) {g7.src=g7url;}
}
| |
| stefbubbles 2005-05-31, 7:23 pm |
| for e.g on the CONTACT page (using the template), see below the code I was able
to modify:
When I try to preview this page, I get a BLANK page.
Also I noticed the the tutorial link you gave, they don't use exactly the same
script.
So I'm not sure what to use. any ideas what I did wrong?
thks! stef
function P7_downImage() {
var g7="<contact>"
var g7url="<images/home/contact_over.gif>"
if ((g7=MM_findObj(g7))!=null) {g7.src=g7url;}
}
| |
| Murray *TMM* 2005-05-31, 7:23 pm |
| Show me the template page, please. Did you put that script into an editable
region in the head?
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
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
==================
"stefbubbles" <webforumsuser@macromedia.com> wrote in message
news:d7i47p$kdd$1@forums.macromedia.com...
> for e.g on the CONTACT page (using the template), see below the code I was
> able
> to modify:
> When I try to preview this page, I get a BLANK page.
> Also I noticed the the tutorial link you gave, they don't use exactly the
> same
> script.
> So I'm not sure what to use. any ideas what I did wrong?
> thks! stef
>
> function P7_downImage() {
> var g7="<contact>"
> var g7url="<images/home/contact_over.gif>"
> if ((g7=MM_findObj(g7))!=null) {g7.src=g7url;}
> }
>
| |
| stefbubbles 2005-05-31, 7:23 pm |
| IN MY TEMPLATE (IN THE HEAD tag), I wrote the script in an editable region
(which I'm not sure I need.) (it's called 'myscript')
here it is:
<head>
<!-- TemplateBeginEditable name="doctitle" -->
<title>Alango-home</title>
<!-- TemplateEndEditable -->
<!-- TemplateBeginEditable name="myscript" -->
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++)
x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length;
i++)
if (a.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document;
if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++)
x=d.forms[n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++)
x=MM_findObj(n,d.layers.document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array;
for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc)
x.oSrc=x.src; x.src=a[i+2];}
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
function P7_downImage() {
var g7="<imagename>"
var g7url="<pathname>"
if ((g7=MM_findObj(g7))!=null) {g7.src=g7url;}
}
//-->
</script>
<!-- TemplateEndEditable -->
<!-- TemplateBeginEditable name="head" --><!-- TemplateEndEditable -->
</head>
| |
| Murray *TMM* 2005-05-31, 7:23 pm |
| Actually, I'd do it this way -
<head>
<!-- TemplateBeginEditable name="doctitle" -->
<title>Alango-home</title>
<!-- TemplateEndEditable -->
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++)
x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0;
i<a.length;
i++)
if (a.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document;
if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++)
x=d.forms[n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++)
x=MM_findObj(n,d.layers.document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array;
for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc)
x.oSrc=x.src; x.src=a[i+2];}
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
<!-- TemplateBeginEditable name="myscript" -->
<script language="JavaScript" type="text/JavaScript">
<!--
function P7_downImage() {
var g7="<imagename>"
var g7url="<pathname>"
if ((g7=MM_findObj(g7))!=null) {g7.src=g7url;}
}
//-->
</script>
<!-- TemplateEndEditable -->
<!-- TemplateBeginEditable name="head" --><!-- TemplateEndEditable -->
</head>
Now on each child page, change <imagename> to the HTML name of the image,
and <pathname> to the path to the image file.
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
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
==================
"stefbubbles" <webforumsuser@macromedia.com> wrote in message
news:d7i74r$ohr$1@forums.macromedia.com...
> IN MY TEMPLATE (IN THE HEAD tag), I wrote the script in an editable region
> (which I'm not sure I need.) (it's called 'myscript')
>
> here it is:
>
> <head>
> <!-- TemplateBeginEditable name="doctitle" -->
> <title>Alango-home</title>
> <!-- TemplateEndEditable -->
> <!-- TemplateBeginEditable name="myscript" -->
> <script language="JavaScript" type="text/JavaScript">
> <!--
> function MM_swapImgRestore() { //v3.0
> var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++)
> x.src=x.oSrc;
> }
>
> function MM_preloadImages() { //v3.0
> var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
> var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0;
> i<a.length;
> i++)
> if (a.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}}
> }
>
> function MM_findObj(n, d) { //v4.01
> var p,i,x; if(!d) d=document;
> if((p=n.indexOf("?"))>0&&parent.frames.length) {
> d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
> if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++)
> x=d.forms[n];
> for(i=0;!x&&d.layers&&i<d.layers.length;i++)
> x=MM_findObj(n,d.layers.document);
> if(!x && d.getElementById) x=d.getElementById(n); return x;
> }
>
> function MM_swapImage() { //v3.0
> var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array;
> for(i=0;i<(a.length-2);i+=3)
> if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc)
> x.oSrc=x.src; x.src=a[i+2];}
> }
>
> function MM_openBrWindow(theURL,winName,features) { //v2.0
> window.open(theURL,winName,features);
> }
>
> function P7_downImage() {
> var g7="<imagename>"
> var g7url="<pathname>"
> if ((g7=MM_findObj(g7))!=null) {g7.src=g7url;}
> }
> //-->
>
> </script>
> <!-- TemplateEndEditable -->
> <!-- TemplateBeginEditable name="head" --><!-- TemplateEndEditable -->
> </head>
>
| |
| stefbubbles 2005-05-31, 7:23 pm |
| I finally got it. I made it it's very cool! thank you so much for your help and patience!
have a good day-evening!
bye, stef
| |
| Murray *TMM* 2005-05-31, 7:23 pm |
| Yep - it's nice.
If your head is not too full, here's another way -
On your template page do the following:
1. Select the first menu button. Press the right arrow key once to
position the insertion bar just to the right of the button.
2. Prepare to enter the twilight zone as you now insert the DOWN state of
the button in that location. This will wreck your Design view, but that's
OK since you already have the page built. You will now have this
situation -
<img name="button1up" ...><img name="button1down" ...>
or something like it.
3. Select button1down, and use INSERT | Template Objects > Optional Region.
Give this region the name "button1down". UNCHECK the box for Show by
default. Click OK.
You have now made the downstate of button1 invisible on every child page
UNLESS the optional region's controlling boolean is changed from FALSE to
TRUE.
4. Now, select button1up and also apply an optional region to it. But this
time, click on the advanced tab in the Optional Region dialog. Now select
the radio button for an expression, and enter the following expression -
!button1down (that's an exclamation point)
This expression says "if the parameter named button1down is false, do this,
and if it's true, don't do this)".
5. Click OK and admire the mess.
But - wait until you spawn a child page. Everything looks perfect! All
buttons will be in their up state.
6. Now, in this child page, select MODIFY | Template Properties... and
select the button1down parameter. At the bottom of this dialog, you can
enable the option to set the boolean to TRUE, click OK and see what happens
to the child page. Button1 is now shown in the down state.
Repeat this process for each button and you now have a very simple up/down
state system in place for your child pages.
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
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
==================
"stefbubbles" <webforumsuser@macromedia.com> wrote in message
news:d7ib6d$ta$1@forums.macromedia.com...
>I finally got it. I made it it's very cool! thank you so much for your help
>and patience!
> have a good day-evening!
> bye, stef
|
|
|
| | Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |
|