Keyword

mod_k2_content error counter listing

  • Sebastián Flores
  • Sebastián Flores's Avatar Topic Author
  • Offline
  • New Member
More
9 years 7 months ago #141232 by Sebastián Flores
mod_k2_content error counter listing was created by Sebastián Flores
Hi
I have the following obstacles:
The counter in the list to display the items inside the module, I'm using a class based on that account, with the following code:
<?php if(count($items)): ?>
	<ul>
    	<?php foreach ($items as $key=>$item):	?>
    	<li class="slide-<?php if(count($items)!=0) echo $tag->name; ?>">

The initial idea was to use it well:
<li class="slide-<?php echo $tag->name; ?>">

But always gives me the "$tag->name" one after. That is the kind that should go in the first "li" it puts the next and the first leaves him empty.
I tried different ways and always is the same.
I can guide that I can do.

An image of what happens:
imgur.com/bSzuJFt

Thank You!

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 7 months ago #141255 by Krikor Boghossian
Replied by Krikor Boghossian on topic mod_k2_content error counter listing
Hello,

The item's tags can be accessed like this:
<?php foreach ($item->tags as $tagCounter=>$tag): ?>
<?php echo $tag->name; ?>
<?php endforeach; ?>

You can print the first tag name by applying a simple if/ else check and if the $tagCounter is not equal to 0 then do not print anything.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Sebastián Flores
  • Sebastián Flores's Avatar Topic Author
  • Offline
  • New Member
More
9 years 6 months ago #141911 by Sebastián Flores
Replied by Sebastián Flores on topic mod_k2_content error counter listing
Thank you, you solved my problem!

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 6 months ago #141923 by Krikor Boghossian
Replied by Krikor Boghossian on topic mod_k2_content error counter listing
You 're welcome Sebastian :)

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum