Forums / Setup & design / Columns --> Colspan?

Columns --> Colspan?

Author Message

Mark Overduin

Friday 31 October 2003 6:51:03 am

I know how to display articles in 2 columns (http://www.ez.no/developer/ez_publish_3/forum/setup_design/how_to_solve_this_creating_columns), but if there are 5 articles that need to be displayed, you now get the following result:

(col 1)______(col 2)
Article1_____Article2
Article3_____Article4
Article5

...but what I want is this:

Article1_____Article2
Article3_____Article4
A . r . t . i . c . l . e . 5

...so the width of the column where Article5 is diplayed in is twice the width of the normal articles (1-4). What I need is something like 'colspan=2'.

Is this possible? If so, how?

-- Mark

Mark Overduin

Monday 03 November 2003 3:53:16 am

Anyone?

Mark Overduin

Wednesday 05 November 2003 1:31:36 am

I believe this is possible. I just don't know how it can be done.

So again: Anyone?

Paul Forsyth

Wednesday 05 November 2003 2:48:16 am

Can't you just take the code you have and put in special logic to do something different when the count reaches a modulo of 5?

paul

Mark Overduin

Wednesday 05 November 2003 3:57:59 am

Probably. But unfortunately, I don't have a clue how to do this...
Can you give me a hint or the required code? It'll be very helpful.

-- Mark

Paul Forsyth

Wednesday 05 November 2003 4:10:30 am

In your linked post:

http://www.ez.no/developer/ez_publish_3/forum/setup_design/how_to_solve_this_creating_columns

you seem to do such tests.

Look in the manual for other arithmetic functions.

paul

Mark Overduin

Wednesday 05 November 2003 11:30:59 pm

Ah, now I get it. Yesterday, I did not quite understand your reply, but now I do.
Anyways, that might be a solution, yes, and maybe I can use it somehow, but the real 'problem' is, that I never know how many articles there are. I mean, what if there are 7 articles? Then I'd like the seventh article to be 'colspan=2'.

So thanx for your solution. I'm sure I can use it somehow/somewhere.

But, is it possible to get the number of articles that will be listed?
And then, is it possible to 'ask' ezPublish if an article is the last article to be listed? (and if it's even or not).

-- Mark

Tom Couwberghs

Thursday 06 November 2003 12:07:07 am

Of course it can be done

For example:

{let noOfArticles=fetch(content','list_count', hash('parent_node_id',2,'class_filter_array',array(2),'class_filter_type','include'))}
{/let}

will count all the articles directly below the root node. Consult the documentation of the fetch function for further possibilities and the correct syntax

Once you've got the number of articles you could test whether it's even or not using the mod function

mod(16, 2) will return 0, mod(13,2) will return 1

To know which element you're handling inside the loop consider one of these

* index - is a number which starts at 0 and increases for each iteration.
* number - same as index but starts at 1
* key - if an array is iterated the key of the current item is set, if a number it will be the same as item
* item - if an array is iterated the current item is set, if a number the current iteration index is set (same as index)

Consult the section documentation page for more about these

hth

Tom

eZ debug

Timing: Jan 19 2025 01:00:35
Script start
Timing: Jan 19 2025 01:00:35
Module start 'content'
Timing: Jan 19 2025 01:00:36
Module end 'content'
Timing: Jan 19 2025 01:00:36
Script end

Main resources:

Total runtime0.7748 sec
Peak memory usage4,096.0000 KB
Database Queries211

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0059 589.9766180.8516
Module start 'content' 0.00590.6198 770.8281602.8594
Module end 'content' 0.62570.1490 1,373.6875341.0859
Script end 0.7747  1,714.7734 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00410.5241210.0002
Check MTime0.00150.1916210.0001
Mysql Total
Database connection0.00090.116310.0009
Mysqli_queries0.689588.98572110.0033
Looping result0.00200.26032090.0000
Template Total0.745296.220.3726
Template load0.00260.334420.0013
Template processing0.742695.844620.3713
Template load and register function0.00020.031110.0002
states
state_id_array0.00130.164410.0013
state_identifier_array0.00140.177920.0007
Override
Cache load0.00210.2744570.0000
Sytem overhead
Fetch class attribute can translate value0.00150.198240.0004
Fetch class attribute name0.00130.166590.0001
XML
Image XML parsing0.00110.137240.0003
class_abstraction
Instantiating content class attribute0.00000.003090.0000
General
dbfile0.00801.0365270.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
8content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
13content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
7content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.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: 31
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs