Page 1 of 1

Group these records by groupId in a separate div

Posted: Mon Feb 09, 2009 5:11 am
by DigingBil
Hi Folks, I really hope that someone out there can help me..

Here is my problem:

I'm trying to setup my site using joomla, but had to dig into the code to make some modifications myself.

I have a component where I display some categories with links to articles like this:

Code: Select all

 
<?php foreach($this->list as $l): ?>
  <li class="article-intro-list">
    <h3 class="article-title"><a href="<?php echo $l->link; ?>" ><?php echo $l->title; ?></a><span>+</span></h3>
    <div class="collapse"> <?php echo $l->description; ?>
      <div class="loadPopUp"><a href="<?php echo $l->link; ?>" title="<?php echo $l->title; ?>" class="mb" rel="width:730,height:500"><span class="howdoi_icon"><img src="images/more.gif" alt="Read more" /></span> Read more...</a></div>
    </div>
  </li>
   <?php endforeach; ?>
 
What this list array contains is also a reference to a groupId of the category, which can be retrieved simply by:

Code: Select all

<?php echo $l->groupId; ?>
And also the group title by:

Code: Select all

<?php echo $l->groupTitle; ?>
I would like to group these categories by their groupId into a separate div with a title for each group.
I really can't figure out that... although it seems pretty straightforward... Still not so good in php :(

Thanks so much in advance!

Re: Group these records by groupId in a separate div

Posted: Mon Feb 09, 2009 6:08 am
by mickeyunderscore

Re: Group these records by groupId in a separate div

Posted: Mon Feb 09, 2009 6:30 am
by DigingBil
mickeyunderscore wrote:This is very similar to: viewtopic.php?f=1&t=94591&start=0&st=0&sk=t&sd=a
Thanx for the answer.

Thou, still struggling to figure out how can I apply the example code into my case :(

Re: Group these records by groupId in a separate div

Posted: Mon Feb 09, 2009 7:44 am
by DigingBil
Anyone else has some hints?