Forums / Setup & design / Problem with fetch
Trevor Clowry
Tuesday 14 June 2005 6:39:24 am
There is probably an easy solution to this.
Basically i want to show a testimonial on every page on the site. I have created a new class called testimonial. And created a folder called testimonials which contains 5 testimonial instances.
I have created a template which i want to add to each page. However when i try to fetch the infromation from the testimonials, to display to the screen i only receive the names of the testimonials.
{let testimonials=fetch('content',list,hash(parent_node_id,81)) } {section name=test loop=$testimonials} <img src="{$test:item.logo}" /> {$test:item.name}<br> {$test:item.testcopy}<br> {$test:item.person}<br> {$test:item.position}<br> {$test:item.company_name}<br> {$test:item.company_location}<br> {/section} {/let}
The only part that is displaying information to the screen is {$test:item.name}. 81 is node_id of the testimonial folder, which contains all the testimonials. How do i show the other attributes?Can anyone help?
Nabil Alimi
Tuesday 14 June 2005 6:50:40 am
Hi trevor,
First, when using loop I use :
{section var=test...}
instead of
{section name=test.. }
And when I want to display each attribute, I use {$test.object.data_map.NAMEOFYOURATTRIBUTE.content}
But anyway, if you want to display an attribute of your class, you should use {$test:item.data_map.NAMEOFYOURATTRIBUTE.content).Or by using {attribute_view_gui attribute=$test:item.data_map.YOURATTRIBUTE}
(I hope I ain't wrong ^^)
My blog : http://www.starnab.com/ezpublish / http://www.starnab.com/ / http://www.assiki-consulting.com eZ Publish Freelance developper. Feel free to contact me +33 674 367 057 nabil at assiki d0t fr