Jump to content

Group these records by groupId in a separate div


kinaski

Recommended Posts

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:

 

<?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:

<?php echo $l->groupId; ?>

And also the group title by

<?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!

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.