Forums / Setup & design / How to reach a thumbnail uploaded with an article

How to reach a thumbnail uploaded with an article

Author Message

John Mina

Wednesday 25 February 2004 1:00:30 am

HI everyone,
i have a problem that i need to reach the thumbnail that was uploaded with the article, ot print it in a specific palce in the page according to my design.
I used the code "{$thing:item|attribute(show)}" to knwo the object's attributes and found somethign called thumbnail as an attribute, but i couldn't print it out using "{$thing:item.thumbnail}", and the debug told me that there is nothing named thumbnail as an attribute of the object.

Do any body have any idea of hwo to know the attribute name and how print it out?
Sincerely

Tore Skobba

Wednesday 25 February 2004 2:16:03 am

With Thumbnail you mean an image? Right? You know it might also be an image size. Well if it is an image then use this to display it.

{* Check to see if there is an actual image *}
{section show=$node.data_map.thumbnail.content.is_valid}
{* There is an image display it *}
{attribute_view_gui attribute=$node.data_map.thumbnail image_class=small}
{/section}

OR alternatively you could use
{section show=$node.data_map.thumbnail.content.is_valid}
<img src={$node.data_map.thumbnail.content.small.url|ezroot} />
{/section}

Note: "small" is an image filter used to resize the image to size small, i.e. image_class=small and content.SMALL.url, could very well be content.large.url depending upon your filters defined in override/image.ini.append

cheers
Tore

John Mina

Wednesday 25 February 2004 4:26:58 am

Hi Tore
please let me thank you
it took a day long from me searching this.
it worked and in a great manner
but hey
that will lead me to ask you about something else which is :- how to devide up the rest of attributes, and how to get the list of diff attributes and know how to extract them from the database

Thnx
John

Tore Skobba

Wednesday 25 February 2004 8:33:54 am

Hi

You're welcome, sound like you should read some docs thought. Check out the good EZ tutorial at: http://www.ez.no/ez_publish/documentation/toc/(from)/36647. If only something like that had been available when I started.

In order to show attributes the function attributte_view_gui is very nice, simply in your node templates do: {attribute_view_gui attribute=$node.data_map.ATTRIBUTENAME}. Alternatively you can access the "direct" content with: {$node.data_map.ATTRIBUTENAME.content}.

Cheers
Tore

John Mina

Wednesday 03 March 2004 5:20:45 am

HI Tore
seems I was a bit ate recieveing your last reply, Actuall yi read most of that building toutorial, it hel;ped me a lot but i felt lost in some where i nthe mid. so i stoped and went on what i have to do.
I have a problem now regarding variable "%1" that when written between the braces of eztpl code it write down the name of the current node.
I want to know abotu the other %... stuff as it seems there is %2 that write down NEW "node name" and ineed to customise that.
IF you have any requests regarding arabic letters please let me know.

I need also an advice regarding building the site on an ez publish that i downloaded as a full package that is downloaded with an installer, i mean is there a problem buiding my site this way ?
I am askign that much cuz i feel u can really help
thaks a ltof or being so generous,
Sincerely John Mina