[MGNLSTK-22] Teasers & Promos IDs: Start counting with 1 not with 0 Created: 12/Nov/08  Updated: 23/Jan/13  Resolved: 13/Nov/08

Status: Closed
Project: Magnolia Standard Templating Kit (closed)
Component/s: None
Affects Version/s: None
Fix Version/s: 1.0

Type: Bug Priority: Major
Reporter: Timo Wirth Assignee: Philipp Bärfuss
Resolution: Fixed Votes: 0
Labels: review-1
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Date of First Response:

 Description   

Please start with 1 instead of 0

now:
******
<div class="teaser" id="teaser-0">
<div class="promo" id="promo-0">

Problem:
CSS: float & Clearing is not working properly because they rely on the correct ids.

better
*******
<div class="teaser" id="teaser-1">
<div class="promo" id="promo-1">



 Comments   
Comment by Christian Ringele [ 12/Nov/08 ]

Does this count for the <h2 id="jump0">first subheading</h2> count too?

Because till now they use the same allgorithm (mgnl.siblings).
So all start till now with "0".

Comment by Magnolia International [ 12/Nov/08 ]

Yeah, if we change it, we'll change it for the anchors too. I guess it makes more sense for humans anyhow.
What I'm not sure about is if we should change

  • the template (${index + 1})
  • the code, by always return 1-based indexes (confusing for developers, or if SiblingsHelper is used in other contexts)
  • the code, by adding another method which returns 1-based indexes, keeping the existing 0-based as well
Comment by Philipp Bracher [ 13/Nov/08 ]

I prefer if the caller would pass an attribute to the includeTemplate tag. This gives a certain flexibility in more complex use cases (inheritance for instance).

But as a quick fix I would use the index + 1 approach.

Comment by Christian Ringele [ 13/Nov/08 ]

If we choose the ${index + 1} approach, shall i change it on teaser&promo ID's AND the jump's for the toc, or only teasers&promos ?
I can do this right now, i start with teasers&promos

Comment by Christian Ringele [ 13/Nov/08 ]

Counting for teasers&promos starts now at 1.
For TOC jumps it still must be decided.

Comment by Philipp Bracher [ 13/Nov/08 ]

every indexing starts at level 1 as a normal human being would expect (except java or c developers but which are by definition no normal human beings

Comment by Christian Ringele [ 13/Nov/08 ]

There you are absolutely right, even when our numbering system starts with 0 and not 1 and the whole world does not realize it.
So i prefer to look at it like this:
The developers are the only ones (probably mathematicians too...) who understood the concept of numbers... but still are weirdos...

Ok, jumps start now wit "1" too.

Comment by Magnolia International [ 13/Nov/08 ]

In jstl, both values are available as "index" (0-based) and "count" (1-based). How about we do the same in SiblingsHelper ?

(although I'd favor "position" instead of "count" ...)

Comment by Philipp Bracher [ 14/Nov/08 ]

see my comment: http://jira.magnolia-cms.com/browse/MAGNOLIA-2421?focusedCommentId=19354#action_19354

Generated at Mon Feb 12 07:22:59 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.