[Zope] Create links for newly uploaded page templates
Patel, Tejash
Tejash.Patel@dowjones.com
Tue, 22 Apr 2003 09:33:42 -0400
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C308D3.CA71E790
Content-Type: text/plain
Hello everyone,
I have recently been trying to do this and am not getting far. I want my
sites homepage to have links to all new uploaded page templates/dtml/3rd
party products to my site that are being ftp-ed on a daily basis. I have
used the following code which works great for content that is listed in the
portal_types: ( I got the code from zopelabs.com)
<div metal:fill-slot="main"
tal:define="results
python:container.portal_catalog(meta_type=[
'Document',
'Event',
'Image',
'News Item',
'Link',
'ZWiki Page',
'Book',
'Forum',
'Photo Album',
'CMFQuote',
'Blog Entry'
],sort_on='modified',sort_order='reverse');
Batch python:modules['Products.CMFPlone'].Batch;
DateTime python:modules['DateTime'].DateTime;
b_start python:request.get('b_start',0);">
The code works fine for the listed items Document, Event, Link etc. But if I
add the meta_type page template in the list it does not work. I want to be
able to show links to uploaded/ftp-ed such as dtml, page templates, and
other 3rd party products. Do I need to create portal_types for each of these
items. If so how do I do that?
I have used all the examples that JCLawrence has provided on zopelabs.com.
They work great for portal_types that have Factory-based Type Information.
But I could not find any code on page templates, or dtml pages. Can someone
help?
Thank you
TP
------_=_NextPart_001_01C308D3.CA71E790
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3DUS-ASCII">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2654.89">
<TITLE>Create links for newly uploaded page templates</TITLE>
</HEAD>
<BODY>
<P ALIGN=3DLEFT><FONT SIZE=3D2 FACE=3D"Arial">Hello =
everyone,</FONT></P>
<P ALIGN=3DLEFT><FONT SIZE=3D2 FACE=3D"Arial">I have recently been =
trying to do this and am not getting far. I want my sites homepage to =
have links to all new uploaded page templates/dtml/3</FONT><SUP><FONT =
SIZE=3D2 FACE=3D"Arial">rd</FONT></SUP><FONT SIZE=3D2 FACE=3D"Arial"> =
party products to my site that are being ftp-ed on a daily basis. I =
have used the following code which works great for content that is =
listed in the portal_types: ( I got the code from =
zopelabs.com)</FONT></P>
<P ALIGN=3DLEFT><FONT SIZE=3D2 FACE=3D"Arial"><div =
metal:fill-slot=3D"main"</FONT></P>
<P ALIGN=3DLEFT><FONT SIZE=3D2 FACE=3D"Arial"> =
tal:define=3D"results</FONT></P>
<P ALIGN=3DLEFT><FONT SIZE=3D2 =
FACE=3D"Arial"> =
python:container.portal_catalog(meta_type=3D[</FONT></P>
<P ALIGN=3DLEFT><FONT SIZE=3D2 =
FACE=3D"Arial"> =
'Document',</FONT></P>
<P ALIGN=3DLEFT><FONT SIZE=3D2 =
FACE=3D"Arial"> =
'Event',</FONT></P>
<P ALIGN=3DLEFT><FONT SIZE=3D2 =
FACE=3D"Arial"> =
'Image',</FONT></P>
<P ALIGN=3DLEFT><FONT SIZE=3D2 =
FACE=3D"Arial"> 'News =
Item',</FONT></P>
<P ALIGN=3DLEFT><FONT SIZE=3D2 =
FACE=3D"Arial"> =
'Link',</FONT></P>
<P ALIGN=3DLEFT><FONT SIZE=3D2 =
FACE=3D"Arial"> 'ZWiki =
Page',</FONT></P>
<P ALIGN=3DLEFT><FONT SIZE=3D2 =
FACE=3D"Arial"> =
'Book',</FONT></P>
<P ALIGN=3DLEFT><FONT SIZE=3D2 =
FACE=3D"Arial"> =
'Forum',</FONT></P>
<P ALIGN=3DLEFT><FONT SIZE=3D2 =
FACE=3D"Arial"> 'Photo =
Album',</FONT></P>
<P ALIGN=3DLEFT><FONT SIZE=3D2 =
FACE=3D"Arial"> =
'CMFQuote',</FONT></P>
<P ALIGN=3DLEFT><FONT SIZE=3D2 =
FACE=3D"Arial"> 'Blog =
Entry'</FONT></P>
<P ALIGN=3DLEFT><FONT SIZE=3D2 =
FACE=3D"Arial"> =
],sort_on=3D'modified',sort_order=3D'reverse');</FONT></P>
<P ALIGN=3DLEFT><FONT SIZE=3D2 =
FACE=3D"Arial"> &nb=
sp; Batch =
python:modules['Products.CMFPlone'].Batch;</FONT></P>
<P ALIGN=3DLEFT><FONT SIZE=3D2 =
FACE=3D"Arial"> &nb=
sp; DateTime =
python:modules['DateTime'].DateTime;</FONT></P>
<P ALIGN=3DLEFT><FONT SIZE=3D2 =
FACE=3D"Arial"> &nb=
sp; b_start =
python:request.get('b_start',0);"></FONT></P>
<P ALIGN=3DLEFT><FONT SIZE=3D2 FACE=3D"Arial">The code works fine for =
the listed items Document, Event, Link etc. But if I add the meta_type =
page template in the list it does not work. I want to be able to show =
links to uploaded/ftp-ed such as dtml, page templates, and other =
3</FONT><SUP><FONT SIZE=3D2 FACE=3D"Arial">rd</FONT></SUP><FONT =
SIZE=3D2 FACE=3D"Arial"> party products. Do I need to create =
portal_types for each of these items. If so how do I do that? =
</FONT></P>
<P ALIGN=3DLEFT><FONT SIZE=3D2 FACE=3D"Arial">I have used all the =
examples that</FONT> <FONT COLOR=3D"#000000" SIZE=3D2 =
FACE=3D"Arial">JCLawrence has provided on zopelabs.com. They work =
great for portal_types that have</FONT><B></B><B> <FONT =
COLOR=3D"#333333" SIZE=3D2 FACE=3D"Verdana">Factory-based Type =
Information.</FONT></B></P>
<P ALIGN=3DLEFT><FONT COLOR=3D"#333333" SIZE=3D2 FACE=3D"Verdana">But I =
could not find any code on page templates, or dtml pages.</FONT><FONT =
COLOR=3D"#333333" SIZE=3D2 FACE=3D"Verdana"> Can someone =
help?</FONT><B></B></P>
<P ALIGN=3DLEFT><FONT SIZE=3D2 FACE=3D"Arial">Thank you</FONT></P>
<P ALIGN=3DLEFT><FONT SIZE=3D2 FACE=3D"Arial">TP</FONT></P>
</BODY>
</HTML>
------_=_NextPart_001_01C308D3.CA71E790--