Re: [Zope-dev] Reading contents of a Page Template

2003-08-18 Thread J Cameron Cooper
I have a requirement to create a SiteMap for my site.
My site is dynamically built from the Zope tree structure.
Folder and Sub Folders need to appear as a tree structure and need to 
be sorted by name and date.
I have viewed the examples in the Examples folder in ZMI and gotten a 
general Idea of how to get the files within a specific folder.
But I need to be able to go through the whole set of folders and sub 
Folders and create the SiteMap and not just for a single folder .
Is there some While- Do Loop which I can use to Loop through till I 
reach the Lowest rung in a Tree for each and every Folder and create a 
Site Map. 
Basic CS. Q: How do you walk a tree? A: Recursion.

Try this Page Template. Name it 'recurse'::
ul
li tal:repeat=item here/objectValues
  span tal:content=item/getId tal:omit-tag=An object/span :
  span tal:content=item/title tal:omit-tag=A title/span
  span tal:condition=python:item.meta_type=='Folder' 
tal:content=structure item/recurseA Folder listing/span
/li
/ul

The condition check is pretty primitive. Probably a better one would 
check for the presence of the objectValues method like

tal:define=folderish nocall:item/objectValues
tal:condition=folderish | nothing
This will construct a nested HTML unordered list of your tree from the 
place where you called it (from inside a valid HTML page.) You can of 
course tweak the display code.

There are also products that will create site maps. Search around.

Also Each of these folders has an index_html page template which can 
be linked from the SiteMap that is created.
Each of the index_html files has a number of anchor tags.
These Tags are for moving within the Page.
I need to be able to include these Tage as well in My SiteMap  ...
CAN I GET THESE ANCHOR TAG LINKS ON EACH PAGE BY READING THROUGH THE 
CONTENT OF EACH OF THESE PAGE TEMPLATES?
IS THERE SOME OTHER WAY TO DO ALL THESE ???
You know that all-caps is considered yelling rather than empahsis, 
right? Generally not a good idea when asking for help.

Anyway, this is harder. You would have to render and then parse the HTML 
to get the tags. You could have a script that does that on leaves, or 
create (either offline or dynamically) children (by inheriting 
ObjectManager in a custom class) or a list property of the object 
representing the available anchor tags. You could also do this by hand. 
Maybe you could replace your documents with folders containing the 
various anchors as separate segments composited in the index_html. The 
segments could be easily found that way, although you'd have to make 
your tree-walker recognize them as leaves instead of containers.

 --jcc

--
My point and period will be throughly wrought,
Or well or ill, as this day's battle's fought.


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Reading contents of a Page Template

2003-08-18 Thread Paul Winkler
On Mon, Aug 18, 2003 at 03:05:44PM -0500, J Cameron Cooper wrote:
 The condition check is pretty primitive. Probably a better one would 
 check for the presence of the objectValues method like
 
 tal:define=folderish nocall:item/objectValues
 tal:condition=folderish | nothing

That won't work as intended, you'll usually be able to acquire 
objectValues from the parent folder.

You might instead try:
tal:condition=item/isPrincipiaFolderish | nothing

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's GEORGE ULTRA PENIS!
(random hero from isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Reading contents of a Page Template

2003-08-17 Thread Anitha George
Hi All,

I have a requirement to create a SiteMap for my site.
My site is dynamically built from the Zope tree structure.
Folder and Sub Folders need to appear as a tree structure and need to be 
sorted by name and date.
I have viewed the examples in the Examples folder in ZMI and gotten a 
general Idea of how to get the files within a specific folder.
But I need to be able to go through the whole set of folders and sub Folders 
and create the SiteMap and not just for a single folder .
Is there some While- Do Loop which I can use to Loop through till I reach 
the Lowest rung in a Tree for each and every Folder and create a Site Map.
Also Each of these folders has an index_html page template which can be 
linked from the SiteMap that is created.
Each of the index_html files has a number of anchor tags.
These Tags are for moving within the Page.
I need to be able to include these Tage as well in My SiteMap  ...
CAN I GET THESE ANCHOR TAG LINKS ON EACH PAGE BY READING THROUGH THE CONTENT 
OF EACH OF THESE PAGE TEMPLATES?
IS THERE SOME OTHER WAY TO DO ALL THESE ???

So Totally I need a SiteMap with all Folders and SubFolders and Anchor Tags 
to be shown in the SiteMap from where I can click and view these Pages

ALL help is appreciated.Thanks in advance.

Best Regards
Anitha George
_
Help STOP SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )