hi! How to you make the results of a search from zcatalog link to the file that it refers to? --------------------------------- Do you Yahoo!? Faith Hill - Exclusive Performances, Videos, & more faith.yahoo.com
Hello Michael,
How to you make the results of a search from zcatalog link to the file that it refers to?
<dtml-in MYZCATALOG> <a href="<dtml-var "absolute_url(1)">"><dtml-var title_or_id></a><br> </dtml-in> Greetings Sven -- Sven Rudolph, Programmierer Medical Tribune Verlagsgesellschaft mbH Unter den Eichen 5, 65195 Wiesbaden Tel.: 06 11 / 97 46 25 2
Sven Rudolph wrote:
Hello Michael,
How to you make the results of a search from zcatalog link to the file that it refers to?
<dtml-in MYZCATALOG> <a href="<dtml-var "absolute_url(1)">"><dtml-var title_or_id></a><br> </dtml-in>
that does not work if you haven't stored the metadata for absolute_url and title in your ZCatalog...;-) a better approach would be: put the current object from the ZCatalog on the namespace: <dtml-with "getobject(data_record_id_)"> <a href="<dtml-var absolute_url>"><dtml-var title_or_id></a><br> </dtml-with> cheers, maik -- Maik Jablonski __o www.zfl.uni-bielefeld.de _ \<_ Deutsche Zope User Group Bielefeld, Germany (_)/(_) www.dzug.org
that's not really a better approach. the goal of having a ZCatalog and displaying search results is that you get them fast. your code will directly access the object (-> getobject) and "wake it up", which will slow you down again. i don't remember the exact name, but you can call a method on those returned records itself (getPath or something) that gives you this information without needing to wake up every single object represented by the catalog records returned from the search. jens On Thursday, Oct 17, 2002, at 07:45 US/Eastern, Maik Jablonski wrote:
Sven Rudolph wrote:
Hello Michael,
How to you make the results of a search from zcatalog link to the file that it refers to? <dtml-in MYZCATALOG> <a href="<dtml-var "absolute_url(1)">"><dtml-var title_or_id></a><br> </dtml-in>
that does not work if you haven't stored the metadata for absolute_url and title in your ZCatalog...;-)
a better approach would be: put the current object from the ZCatalog on the namespace:
<dtml-with "getobject(data_record_id_)"> <a href="<dtml-var absolute_url>"><dtml-var title_or_id></a><br> </dtml-with>
cheers, maik
-- Maik Jablonski __o
Hello Maik,
<dtml-in MYZCATALOG> <a href="<dtml-var "absolute_url(1)">"><dtml-var title_or_id></a><br> </dtml-in>
that does not work if you haven't stored the metadata for absolute_url and title in your ZCatalog...;-)
That's right. I forgot it because I always do this.
a better approach would be: put the current object from the ZCatalog on the namespace:
<dtml-with "getobject(data_record_id_)"> <a href="<dtml-var absolute_url>"><dtml-var title_or_id></a><br> </dtml-with>
This would result in a little performance loss because you have to wake up each matching object just to get the url and the id. Greetings Sven Rudolph -- Sven Rudolph, Programmierer Medical Tribune Verlagsgesellschaft mbH Unter den Eichen 5, 65195 Wiesbaden Tel.: 06 11 / 97 46 25 2
Sven Rudolph wrote:
Hello Maik,
<dtml-in MYZCATALOG> <a href="<dtml-var "absolute_url(1)">"><dtml-var title_or_id></a><br> </dtml-in>
that does not work if you haven't stored the metadata for absolute_url and title in your ZCatalog...;-)
That's right. I forgot it because I always do this.
a better approach would be: put the current object from the ZCatalog on the namespace:
<dtml-with "getobject(data_record_id_)"> <a href="<dtml-var absolute_url>"><dtml-var title_or_id></a><br> </dtml-with>
This would result in a little performance loss because you have to wake up each matching object just to get the url and the id.
hi sven and jens, thanks for the hint. you're both are right... but the <dtml-with>-advantage is: you can access all properties of the object without thinking about it...;-) and just another one: displaying Catalog-Results with a batch of 10 to 20 objects should not decrease performance significantly... cheers, maik -- Maik Jablonski __o www.zfl.uni-bielefeld.de _ \<_ Deutsche Zope User Group Bielefeld, Germany (_)/(_) www.dzug.org
participants (4)
-
Jens Vagelpohl -
Maik Jablonski -
michael.ta�ag -
Sven Rudolph