CMS MADE SIMPLE FORGE

Menu Manager

 

[#2357] First and last attribute

avatar
Created By: Simon (simonschaufi)
Date Submitted: 2008-06-19 04:21

Assigned To:
Resolution: None
State: Open
Summary:
First and last attribute
Detailed Description:
Hi!
It would be nice if there would be a first and a last attribute available
because sometimes you really need this.

i thought of:

{if $item->first == true}...{/if}

History

Comments
avatar
Date: 2008-08-27 04:59
Posted By: Simon (simonschaufi)

Hello!
I thought i will make this by myself and would be happy if this could be part of
the next release, i will upload the new file now.

Changes:

$no_of_children = count($children);
if (isset($children) && $no_of_children)


function &FillNode(&$content, &$node, &$nodelist, &$gCms, &$count, &$prevdepth,
$origdepth, &$itemcount, &$no_of_children)

$gCms, $count, $prevdepth, $origdepth, $itemcount, $no_of_children);

Added:

$itemcount = 1;

$itemcount++;

if($itemcount == 1)
	$onenode->first = true;
else
	$onenode->first = false;
if($no_of_children == $itemcount)
	$onenode->last = true;
else
	$onenode->last = false;

The rest is just formating (i replaced spaces to tabs)
      
avatar
Date: 2011-03-10 17:56
Posted By: Sander Hartveld (sanderhartveld)

has this been implemented already? I could use it too.