Forums / Setup & design / URL attribute and HREF in template

URL attribute and HREF in template

Author Message

H. K.

Monday 03 March 2008 12:02:40 pm

Hi, I have created a content class(video remote), which contains a Text string, image and URL attribute.
I want to create a section on my FrontPage containing the image and string text string, which link to the url in the URL attribute.

I have attempted to use the following code, but it does not work

{let video2=fetch( content, tree, hash( parent_node_id, 2,
                                           limit, 2,
                                           sort_by, array( published, false() ),
                                           'class_filter_array', array( 37 ),

                                            ) )}

<div id="video2">
{section var=video2 offset=1 max=1 loop=$video2}
 
   <div class="child">
 
 <a href={$video2.item.url} rel="gb_page_fs[]"> {attribute_view_gui attribute=$video2.item.data_map.image=video_remote}
     
   
 {$video2.item.name|wash}</a>
   
   
   </div>
{/section}

</div>
{/let}

Felix Laate

Monday 03 March 2008 1:04:01 pm

Hi there,

you could try something like this:

{def $video=fetch( content, tree, hash( parent_node_id, 2,
                                          limit, 2,
                                          sort_by, array( published, false() ),
                                          'class_filter_array', array( 37 ),
                                           ) )}

{foreach $video as $vid}

{attribute_view_gui attribute=$vid.data_map.image url=$vid.data_map.url.content}
<a href={$vid.data_map.url.content|ezurl()}>{$vid.name|wash}</a>

{/foreach}

{undef $video}

PS! Taken directly out of my sleepy brain..

Felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

H. K.

Tuesday 04 March 2008 6:01:59 am

Thanks for showing the def solution, I always used let which is deprecated according to the 4.0 manual

One more thing, I see that on Din Mat you use at lot of ajax.

What is the proper way to include ajax scripts in ez link?

I have attempted to use a script called greybox to open external links on my page, but EZ 4 interferes with the links so that the redirection script always links to 0

 

<a href={$vid1.data_map.url.content|ezurl()} rel="gb_page_fs[]">{$vid1.name|wash}</a>

nehal shah

Tuesday 21 December 2010 3:03:18 am

Our system publish article from eZ-Publish. Now i want article list country wise, but it seems impossible right now. I have tried that i fetch country from url, but it is also not possible.If you guys have an idea pls tell me.

Thanx in advance.

eZ debug

Timing: Jan 18 2025 01:02:04
Script start
Timing: Jan 18 2025 01:02:04
Module start 'content'
Timing: Jan 18 2025 01:02:05
Module end 'content'
Timing: Jan 18 2025 01:02:05
Script end

Main resources:

Total runtime1.5490 sec
Peak memory usage4,096.0000 KB
Database Queries199

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0077 588.8516180.8281
Module start 'content' 0.00771.3852 769.6797584.7891
Module end 'content' 1.39290.1560 1,354.4688337.3984
Script end 1.5489  1,691.8672 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00430.2773210.0002
Check MTime0.00160.1015210.0001
Mysql Total
Database connection0.00070.044510.0007
Mysqli_queries1.464894.56711990.0074
Looping result0.00260.16491970.0000
Template Total1.502297.020.7511
Template load0.00230.146820.0011
Template processing1.499996.833420.7500
Template load and register function0.00030.016610.0003
states
state_id_array0.00150.097410.0015
state_identifier_array0.00220.142220.0011
Override
Cache load0.00190.1229240.0001
Sytem overhead
Fetch class attribute can translate value0.00150.095440.0004
Fetch class attribute name0.00100.067350.0002
XML
Image XML parsing0.00140.088140.0003
class_abstraction
Instantiating content class attribute0.00000.000750.0000
General
dbfile0.00730.4720270.0003
String conversion0.00000.000630.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
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 16
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs