[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]

Re: Frames

On Thu, 10 Dec 1998, Michael McNamara wrote:
> > >	I am wondering is if I can get the automatic java script
> > >changing of navbar gifs from the 'normal' to 'over' to 'selected'
> > i use my own tag-definitions and some variables with templates
> > to solve this. it's working, but is not very portable. i have to modify the
> > include files for every new site, but then i get exactly what i want.
> > see http://www.snf.ch/nfp42/  (it's a very academic site, at the moment 
>	Yes I'd love to see it; it seems you've done exactly what I
>want to do: menus using navbars for major navigation, and then frames
>for selecting the various publications.

i use seperate templates for
the different kind of pages one needs for frames. the mainpages
of the above pages are not that complicated as you can see.
i have another site running, also made completely with WML,
check: http://www.internutrition.ch
one might ask now why does this guy use frames then for the other
site. that's because it is much easier for non-pros using 
netscape-composer or alikes for creating or _editing_ pages.

the source:
preface: the source is not cleaned up. there are e.g. some
includes i do not use at all. but don't mind please.
the top frame is different for every entry in the side frame. so
i handle the side and top frames differently. since this is my
second WML project only and i am still learning and producing
my own basic definitions, top frame and side frame tag-definitions
are kept seperat and there is a lot of code which could be shared
in between them. below there are the sources for the top frame only
because of the length of this mail. just tell me if you want to see the
others too. they are not that different but there is some small extra
functionality in them.

- the top frames:
  nfppage_top.wml	# the template for the top frame
  top_def.wml		# the tag-definitions for the top frame
  topmenu.wml		# the entries we like to have in the top frame
  t_home.wml		# the only mainfile in this dir generating the top frame

-order the files are processed: 
 -> t_home.wml -> nfppage_top -> topmenu -> top_def -> 

- the side frames:
  nfppage_side.wml	# the template for the side frame
  side_def.wml		# the tag-definitions for the side frame
  sidemenu.wml		# the entries we like to have in the top frame
  s_home.wml		# one of the mainfiles in this dir generating a side frame

>	Vis a vis your previous question: I think sharing the 'source'
>for various web pages is a useful way for us to learn good use of
>variables and such.

yes. let's share our ideas.

-the files:

##  nfppage_top.wml -- page template: 
##  copyright (c) 1998 jan holler, all rights reserved. 
##  v 1.0 - 98.11.24

#use wml::std::tags
#use wml::std::page
#use wml::std::info
#use wml::std::href
#use wml::fmt::isolatin


#include '$(COM_INCL)/disclaim.wml'
#<set-var tmp="<<DOCDATE>>">
#<if <match "<get-var tmp>" "<>">
  <set-var doc_creat="23-11-1998 12:00:00">
#  <set-var doc_creat="<get-var tmp>">
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<info style=meta
#	content-type="text/html;charset=iso-8859-1"
	copyright="1998 holler gelasma systems, Switzerland"
	keywords="Switzerland, Foreign Policy, Security Policy, European Integration, Small State, International Relations
	description="Switzerland, Foreign Policy, Security Policy, European Integration, Small State, International Relations
	created="<get-var "doc_creat">"

<define-tag subject>
<define-tag docdate>

#include '$(LOC_INCL)/topmenu.wml' 

#<!-- Begin Contents -->
#<!-- End Contents -->


# per default in body

  top_def.wml		# the tag-definitions for the top frame
#use wml::std::lang

<lang:new id=en short>
<lang:new id=de short>
<lang:new id=fr short>

<define-container js_inc>
<script language="JavaScript">
if (document.images) {
<get-var "loc">_lo = new Image(); <get-var "loc">_lo.src = "$(LOC)/images/top/<get-var "loc">_<de: d><en: e><fr: f>_lo.gif";
<get-var "loc">_hi = new Image(); <get-var "loc">_hi.src = "$(LOC)/images/top/<get-var "loc">_<de: d><en: e><fr: f>_hi.gif";
<get-var "loc">_ac = new Image(); <get-var "loc">_ac.src = "$(LOC)/images/top/<get-var "loc">_<de: d><en: e><fr: f>_ac.gif"; }
// -->

<define-container act_image>
<if <match "$(area)" "<get-var "loc">">
"<set-var act_img="$(LOC)/images/top/<get-var "loc">_<de: d><en: e><fr: f>_hi.gif"><set-var js_in="imgNo"><set-var js_out="imgOv">"
"<set-var act_img="$(LOC)/images/top/<get-var "loc">_<de: d><en: e><fr: f>_lo.gif"><set-var js_in="imgOv"><set-var js_out="imgNo">"

<define-container js_onMouse>
onMouseOver="<get-var "js_in">('<get-var "loc">', '<de: <get-var "descr_d">><en: <get-var "descr_e">><fr: <get-var "descr_f">>'); return true" \
onMouseOut="<get-var "js_out">('<get-var "loc">'); return true" \

<define-container entry>
<a href="$(LOC)/<get-var "loc"><de: _d><en: _e><fr: _f>.html" target = "main_frame" \
<img src="<get-var "act_img">" alt="<de: <get-var "descr_d">><en: <get-var "descr_e">><fr: <get-var "descr_f">>" border="0" name="<get-var "loc">"></a> \

<define-container deadentry>

# begin of actual page-definitions

<script language="JavaScript">
function imgNo(imgName) {
if (document.images) { document[imgName].src = eval(imgName + "_lo.src"); self.status = ''; } }
function imgAc(imgName) {
if (document.images) { document[imgName].src = eval(imgName + "_ac.src"); self.status = ''; } }
function imgOv(imgName, descript) {
if (document.images) { document[imgName].src = eval(imgName + "_hi.src"); self.status = descript; } }
// -->
# per default in body of menu, don't forget to close there

  topmenu.wml		# the entries we like to have in the top frame
# local configuration for entries in the topmenu
# home

#use wml::tmpl::top_def

<set-var loc="ueber" descr_d="&Uuml;ber uns" descr_e="About us" descr_f="Sur nous"><entry></entry>
<set-var loc="ziele" descr_d="Ziele" descr_e="Goals" descr_f="Objectifs"><entry></entry>
<set-var loc="schwerp" descr_d="Schwerpunkte" descr_e="Main points" descr_f="Points centraux"><entry></entry>

#we have to close the above inclusion (MENU_BODY)

  t_home.wml		# the only mainfile in this dir generating the top frame
#!wml -o (ALL-LANG_*)uLANG_DE:t_home_d.html \
      -o (ALL-LANG_*)uLANG_FR:t_home_f.html \
      -o (ALL-LANG_*)uLANG_EN:t_home_e.html

#use wml::tmpl::nfppage_top area=home

# date of creation
<docdate "23-11-1998 12:00:00">
# titel of page
<subject "Home">

have fun...
  holler gelasma systems
  informatik, it-services, web-produktionen
  tel: +41 31 9916185, bern, schweiz

Website META Language (WML)                www.engelschall.com/sw/wml/
Official Support Mailing List                   sw-wml@engelschall.com
Automated List Manager                       majordomo@engelschall.com