Forums / Setup & design / create a view of a instense's list of a class

create a view of a instense's list of a class

Author Message

alberic briot

Thursday 27 December 2007 6:30:24 am

Hello,

I would like to had to the pagelayout.tpl a list of object well presented and I would like thats easy top add or change object with the administation interface. So I created a class (CommercialLink) and then I created instense of my class in a folder hidden (/file/commercial_link). I also overide the full.tpl for my class.

Now, I would like to know, how to insert the list of instense of my class wich is in my folder.

thank you,
Alberic.

alberic briot

Thursday 27 December 2007 9:36:09 am

I progress but the problem is still here. I added an "Object relations" to the "Template look" class wich I called commercial_link_list. Then in the "Design -> Look and Feel" I added my Object I have created in the folder.

But, now I can't get the object in the pagelayout.tpl. I'm barely sure that it miss just a piece of code. I get whith this folowing code a ezcontentobjectattribute:

  {$pagedesign.data_map.commercial_links_list.content}

How can I get his attribute contentobject_id and then the object and better the attribute of the object.

There is two solution I think
- using the template of my class
- re-editing the template

I tell to the Object relations to use the template way but it doesn't seem to use it.

alberic briot

Thursday 03 January 2008 5:19:04 am

Finaly, I managed to solve my problem. With this piece of code in my pagelayout.tpl.

{def $nodes=fetch( 'content', 'list',
	hash( 'parent_node_id', 172,
		sort_by, array( array( name, false() ),
		array( published, false() ) ),
		'class_filter_type',  'include',
		'class_filter_array', array( 'comerciallink' ) ) )}
	{foreach $nodes as $node}
		<div class="comercial-link">
                   <a href="{attribute_view_gui attribute=$node.object.data_map.href}">
			<h2>{attribute_view_gui attribute=$node.object.data_map.title_label}</h2>
                   </a>
	        </div>

	{/foreach}
{undef $nodes}

NB: 172 is the node_id wich I found in the "content structure".
There was too a problem because the folder containing the instances of my class was hidden so I unhide it.

eZ debug

Timing: Jan 18 2025 18:23:51
Script start
Timing: Jan 18 2025 18:23:51
Module start 'content'
Timing: Jan 18 2025 18:23:51
Module end 'content'
Timing: Jan 18 2025 18:23:51
Script end

Main resources:

Total runtime0.1557 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.0056 588.9609180.8125
Module start 'content' 0.00560.0063 769.773493.9453
Module end 'content' 0.01190.1437 863.7188522.3750
Script end 0.1555  1,386.0938 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00352.2606200.0002
Check MTime0.00140.9165200.0001
Mysql Total
Database connection0.00060.354610.0006
Mysqli_queries0.108969.91231410.0008
Looping result0.00130.81571390.0000
Template Total0.143292.010.1432
Template load0.00090.574710.0009
Template processing0.142391.378710.1423
Override
Cache load0.00060.380110.0006
Sytem overhead
Fetch class attribute can translate value0.00080.499510.0008
XML
Image XML parsing0.00020.141310.0002
General
dbfile0.00613.9002200.0003
String conversion0.00000.003230.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.0002 secs