Forums / Setup & design / links using image instead of text
eve f
Wednesday 22 December 2004 11:17:00 pm
hi all,
i have display for advertisement, and wanted it to allow the users to click to go to the respective page.. how can it be done??
can i combine the links and image upload (given by the Exponential) together to achieve it?? or is there any extension or whatever for me to use??
thanks alot
Tobias Persson
Wednesday 22 December 2004 11:33:44 pm
Hi,
I can think of two ways:
1) -------you could make a new image-class (I would take a copy of the image class) and then add a URL field to the class.
Then just make a template for the class and use this new class when uploading images.
2) -------You could use the related objects function.
First uppload the image.Then create an link-object
And then relate the link with the image.
Finally you need to change the image-template to include the related link.
Thursday 23 December 2004 12:35:51 am
i thought of the 1st way too.. but just didnt know how to do it.. which files need to be change?? i cant find the fiels?? then the insertion to database, need to be change??
Thursday 23 December 2004 1:15:16 am
The steps for option 1 is:
* Create a new class (You can look at http://www.ez.no/ez_publish/documentation/building_an_ez_publish_site/the_members_page/creating_a_custom_content_class for an example)
* Create an template for the class. Which template you need to change is depending on how you will use it (if you like to use it as an image or just ordinary content). The simplest (but maybe not prettiest) is to use line.tpl or full.tpl .I think the http://www.ez.no/ez_publish/documentation/building_an_ez_publish_site/the_news_page/overview_of_the_latest_news has pretty nice intructions how to do this.
Thats it. :-)
Sunday 26 December 2004 7:30:52 pm
for my admin site, i want the user, when click on the top navigation bar 'content', it will bring the user to the URL :http://localhost/index.php/plain_admin
which file should i change??
----------------------------------------------------------------
oh.. thanks.. trying it out.. hope it work well.. i do got some problem here.. the user enter the URL (eg www.ez.no). From the user site, the URL is append behind, like this
http://localhost/index.php/ad/www.ez.no
however, i want it to be only, www.ez.no
how can i solve this??
Sunday 26 December 2004 11:12:43 pm
The www.ez.no problem seems like you just forgot to add http:// infront of the www.ez.no. Or maybe I don't understand your question?? :-)
Łukasz Serwatka
Sunday 26 December 2004 11:37:28 pm
Hi eve
You don`t have to create new class to add link <a> to your image.
Try this code with simple image class
{attribute_view_gui attribute=$node.object.data_map.image href=http://link_to_your_page}
You can use href attribute to add link to your image.
This is from ezimage datatype Input: image_class - Which image alias to show, default is large css_class - Optional css class to wrap around the <img> tag, the class will be placed in a <div> tag. alignment - How to align the image, use 'left', 'right' or false(). link_to_image - boolean, if true the url_alias will be fetched and used as link. href - Optional string, if set it will create a <a> tag around the image with href as the link. border_size - Size of border around image, default is 0
Personal website -> http://serwatka.net Blog (about eZ Publish) -> http://serwatka.net/blog
Sunday 26 December 2004 11:45:19 pm
oh.. thanks guys.. will try it out..
but Lukasz, my url is dynamic (got to be uploaded together with img).. :)
Tobias, what is mean is anything i enter into the URL file, the string is append beind the localhost address, ie http://localhost/index/php/{the string enter for the URL}
do i need to configure anything or like what you say, i have to put http:// inffront of the address??
And for the template, the <a href="*wat shld i write here*"> d link is base on what the user have uploaded together with the img.
Sunday 26 December 2004 11:52:52 pm
yes you need to add http://
Monday 27 December 2004 12:04:41 am
oh.. okie thanks for your help :)