Forums / Setup & design / links using image instead of text

links using image instead of text

Author Message

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 ezpublish) 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.

eve f

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??

Tobias Persson

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. :-)

eve f

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??

thanks alot

Tobias Persson

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

eve f

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.

 

Łukasz Serwatka

Sunday 26 December 2004 11:52:52 pm

do i need to configure anything or like what you say, 
i have to put http:// inffront of the address??

yes you need to add http://

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

eve f

Monday 27 December 2004 12:04:41 am

oh.. okie thanks for your help :)

eZ debug

Timing: Jan 19 2025 09:37:14
Script start
Timing: Jan 19 2025 09:37:14
Module start 'content'
Timing: Jan 19 2025 09:37:14
Module end 'content'
Timing: Jan 19 2025 09:37:14
Script end

Main resources:

Total runtime0.1601 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0096 588.9766180.8281
Module start 'content' 0.00960.0078 769.8047106.0078
Module end 'content' 0.01740.1426 875.8125533.9531
Script end 0.1600  1,409.7656 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00422.6253200.0002
Check MTime0.00140.8835200.0001
Mysql Total
Database connection0.00120.762110.0012
Mysqli_queries0.106666.61401410.0008
Looping result0.00140.90431390.0000
Template Total0.142188.810.1421
Template load0.00100.624810.0010
Template processing0.141188.160810.1411
Override
Cache load0.00070.433510.0007
Sytem overhead
Fetch class attribute can translate value0.00140.904610.0014
XML
Image XML parsing0.00020.140410.0002
General
dbfile0.00603.7623200.0003
String conversion0.00000.006730.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0003 secs