how to give the blogs an individual id?

Permalink Browser Info Environment
I need a sub navigation (with query) to call / jump to the teasers.
For this I need a function that adds number-IDs to each "ccm-page-list-description" <div>.

I tried this <div class="ccm-page-list-description" id="pagecontent<?php echo $bID ?>"> but the result was always the same number / ID.

Type: Discussion
Status: New
alphaboson
View Replies:
jordanlev replied on at Permalink Reply
jordanlev
bID is the "block id", so yeah that's going to be the same anywhere in the block's code. I think what you want is the id of the page that you're listing, which is called the "Collection ID". This code should give you that:
<?php echo $c->getCollectionID(); ?>
alphaboson replied on at Permalink Reply
alphaboson
With this I get a fatal error, is get the right way?

<?php   
   defined('C5_EXECUTE') or die(_("Access Denied."));
   // now that we're in the specialized content file for this block type, 
   // we'll include this block type's class, and pass the block to it, and get
   // the content
   if (count($cArray) > 0) { ?>
   <div class="ccm-page-list">
   <?php   
   $excerptBlocks = ($controller->truncateSummaries ? 1 : null); //1 is the number of blocks to include in the excerpt
   $truncateChars = ($controller->truncateSummaries ? $controller->truncateChars : 0);
   $plth = Loader::helper('page_list_teasers', 'page_list_teasers');
   for ($i = 0; $i < count($cArray); $i++ ) {
      $cobj = $cArray[$i]; 
      if (version_compare(APP_VERSION, '5.4.1', '<')) {
         $target = '';
.
jordanlev replied on at Permalink Reply
jordanlev
Oops, sorry about that. Change this:
<?php echo $c->getCollectionID(); /* add ID for jquery */ ?>

...to this:
<?php echo $cobj->getCollectionID(); /* add ID for jquery */ ?>
alphaboson replied on at Permalink Reply
alphaboson
Yes! It works

Thanx!

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.