Hi, i have this code, to display a 'see also' block in my navigation bar, using a 'seealso' property in the folder. This property is a comma-seperated list of interesting id's. <dtml-call "REQUEST.set('links', _.string.splitfields(seealso,','))"> <dtml-in links> <tr><td> <a href="<dtml-var "absolute_url()">"><dtml-var title></a> </td></tr> </dtml-in> But, this doesn't work as expected. The values from the absolute_url() and the title are still the ones from the current page. When i try something like <var sequence-item>, the correct id is displayed. But when i try a statement like <dtml-with sequence-item>, it uses again the wrong scope, it seems. I hope someone can point me in the right direction. -- Arjan Scherpenisse, A.Scherpenisse@zap.a2000.nl ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "Hi, MS Outlook just gave me a signature virus"
Arjan Scherpenisse wrote:
Hi,
i have this code, to display a 'see also' block in my navigation bar, using a 'seealso' property in the folder. This property is a comma-seperated list of interesting id's.
<dtml-call "REQUEST.set('links', _.string.splitfields(seealso,','))"> <dtml-in links> <tr><td> <a href="<dtml-var "absolute_url()">"><dtml-var title></a> </td></tr> </dtml-in>
You need to use the ids to fetch the actual objects. Assuming that each id is local (or can be acquired), you can use: <dtml-call "REQUEST.set('links', _.string.splitfields(seealso,','))"> <dtml-in links><dtml-with "_.getitem(_['sequence-item'])"> <tr><td> <a href="<dtml-var "absolute_url()">"><dtml-var title></a> </td></tr> </dtml-with></dtml-in> Cheers, Evan @ 4-am
Hi, seems similiar to the thing I tried. I got it to work with "_.getitem(,0)". Like this: <dtml-call "REQUEST.set('links', _.string.splitfields(seealso,','))"> <dtml-in links> <dtml-let itemname=sequence-item> <dtml-let item="_.getitem(itemname, 0)"> <dtml-with item> <tr><td> <a href="<dtml-var "absolute_url()">"><dtml-var title></a> </td></tr> </dtml-with> </dtml-let> </dtml-let> </dtml-in> Probably you will get some "unathorized" errors. In that case give "Access content information" permission to anonymous. Hope it helps. So long Ulli -- ----------------- Die Website Effizienzer ------------------ luna-park Bravo Sanchez, Vollmert, Wisser GbR Ulrich Wisser mailto:u.wisser@luna-park.de Alter Schlachthof, Immenburgstr. 20 Tel +49-228-9654055 D-53121 Bonn Fax +49-228-9654057 ------------------http://www.luna-park.de ------------------
participants (3)
-
Arjan Scherpenisse -
Evan Simpson -
Ulrich Wisser