The Dublin Core metadata element set
is a standard for cross-domain information resource description.
|
||
Element | Description | Value |
---|---|---|
Identifier | resource ID | http://old.zope.org/Members/Ioan/NavTable |
Title | resource name | Site Navigation Table |
Description | resource summary | <h1>Site Navigation Table</h1> Two <b>Python</b> scripts (which means two table styles), some pictures and a css file.<br> That is what this product contain.<br> (This is more a <i>how-to</i> than a <i>product</i>.)<br> <br> But you better look at these pictures:<br> <table> <tr> <th>Demo</th><th>Style 1</th><th>Style 2</th> </tr> <tr> <td valign="top"><img src="demo.jpg" border=0</td> <td valign="top"><img src="nav1.jpg" border=0</td> <td valign="top"><img src="nav2.jpg" border=0</td> </tr> </table> <h1>To make this scripts to work you must:</h1> <ul> <li>Add property of root folder <b>iconspath</b> to keep the path to your icons.<br> I use <a href="http://www.zope.org/Members/jfarr/Products/LocalFS/" target="_blank">LocalFS</a> to point to a folder with gifs. <li>Add a property of root folder <b>bk_color</b> which keep <i>#5566aa</i> or <i>#99bbff</i> if you want; the background color. <li>Add a lot of <b>folders</b> with title <li>Add a lot of <b>DTML Documents</b> with title <li>Add a lot of <b>WikiPages</b> (no title - you don't need title) <li>And add a lot of what ever you want, but set a title <li>The <b>Python</b> script will<br> <b>for i in self.objectItems(items):</b><br> and you call the script like that:<br> <b><dtml-var "navtable1(PARENTS[-1],'Home','/home.htm',['ZWiki Page','DTML Document'])"></b><br> or <b><dtml-var "navtable1(PARENTS[-1],'Home','/home.htm',['Folder'])"></b><br> <li><b>PARENTS[-1]</b> is the <u><b>root</b></u> of your site<br><b>PARENTS[0]</b> is the current folder.<br> use <b>PARENTS[0]</b> when you want to display a site map (nav table) from current folder.<br> <li>You need a title to your documents.<br> If that document don't have title - that means is not for public (not yet) so will not be listed on nav table (WikiPages are special, you know)<br> <li>Each document with title should have a property called <b>ico</b> which keep the icon image filename.<br> When the script build the nav table, it will append at <b>iconspath</b> the value from <b>ico</b> and will display a picture.<br> <b>iconspath</b>=/z/icons/<br> <b>ico</b>=book.gif<br> If you don't set an <b>ico</b>n the script will use <b>'Leaf.gif'</b> instead. Be sure you have this file. </ul> <br> <h1>The Python script</h1> <pre> <b>Title</b> : Navigation Table version 2 <b>Parameter List</b> :self,t='Home',a='',items=['Folder','ZWiki Page','DTML Document'],f=1 <b>The body:</b> # #t =title of table #a =link adress title #items=list with zope items #f =1 for table with width=100% # # set colors c_border='#000000' c_title='#333399' c_body='#4444aa' ret='' ret=ret+'<table' if f==1: ret=ret+' width="100%"' ret=ret+' border="0" cellspacing="0" cellpadding="1" bgcolor="'+c_border+'+"><tr><td>' ret=ret+'<table width="100%" border="0" cellspacing="1" cellpadding="3">' ret=ret+'<tr><td align=left bgcolor="'+c_title+'"> <img src="/img/nav/bar.jpg" border=0> <a href="'+a+'" class="tmap2">'+t+'</a> <img src="/img/nav/bar.jpg" border=0></td></tr>' ret=ret+'<tr><td bgcolor="'+c_body+'">' for i in self.objectItems(items): o=i[1] #the object title=o.title id=i[0] if (title != '' and id != 'index_html') or o.getNodeName()=='ZWikiPage' : #ret=ret+'<img src="' #ret=ret+'/img/nav/arr_left.gif' ret=ret+'<img src="'+self.iconspath if o.hasProperty('ico'): ret=ret+o.ico else: ret=ret+'Leaf.gif' ret=ret+'"> <a href="'+o.absolute_url()+'"' if o.hasProperty('tar'): ret=ret+'target="'+o.tar+'"' ret=ret+' class="map2" >'+title+'</a><br>' ret=ret+'</td></tr></table></td></tr></table><br>' return ret </pre> <h1>Parameters</h1> <pre># #t =title of table #a =link adress title #items=list with zope items #f =1 for table with width=100% # <b>Sample: </b> <h1>Nav table 1</h1> <dtml-var "navtable1(PARENTS[-1],'Home','/home.htm',['ZWiki Page','DTML Document'],0)"> <h1>Nav table 2</h1> <dtml-var "navtable2(PARENTS[-1],'Home','/home.htm',['ZWiki Page','DTML Document'],0)"> </pre> <h1>Sort items</h1> You may sort items into your generated table with:<br> <pre> <b>lista=self.objectItems(items) lista.sort() for i in lista:</b> instead of using this : <b>for i in self.objectItems(items):</b> </pre> <br><br> <b>That's all! Tell me if you have questions.</b> |
Creator | resource creator | Ioan |
Date | default date | 2001-07-09 06:56:48 |
Format | resource format | text/html |
Type | resource type | Software Package |
Subject | resource keywords | Content Object, Developer, Examples, Helpers, Navigational, Visual |
Contributors | resource collaborators | |
Language | resource language | |
Publisher | resource publisher | No publisher |
Rights | resource copyright | |
|
||
Element | Description | Value |
CreationDate | date resource created | 2001-07-09 06:56:48 |
ModificationDate | date resource last modified | 2001-07-09 06:56:48 |
EffectiveDate | date resource becomes effective | None |
ExpirationDate | date resource expires | None |
Backlinks:
via
Google
/
Technorati
RDF:
view RDF data