Skip to Content Skip to Menu

🌟 CB Editor Assistant 1.0.0 is here! Discover our new AI Joomla Plugin that wrote its story! (and this banner!)
Start at just $12.50/month* or 💸 save 30% with our 🛍️ Intro Black Friday Offer for a lifetime*

How to make a plug-in tab alternate row colors

  • bascherz
  • bascherz
  • OFFLINE
  • Posts: 228
  • Thanks: 29
  • Karma: 11
18 years 1 week ago #24982 by bascherz
Sorry if the post title seems like a "how to", but it'll make for a good search (hopefully) once this gets answered and maybe it will be a "how to" in the end. For now, it's a technical question.

I have written a plug-in tab that I would like to seamlessly integrate into the "right-middle" section of the CB profile. That section uses Joomla's alternating sectiontableentry1/2 styles.

I found the use of the global variable $_CB_OneTwoRowsStyleToggle in comprofiler.class.php, which sure seemed at first to be the ticket to picking up where the color alternating left off. But alas, it always seems to give my plug-in the value 1. I believe it should alternate between 1 and 2 during the processing of user-defined fields, and had hoped my code would either get the next value or the last one.

Perhaps I am using it wrong. Or, perhaps it's not yet possible for the first row of my plug-in tab to be the opposite of the one adjacent to it, no matter what. That's what I am trying to find out. Can it be done? If so, how?

Thanks in advance.
Bruce

Bruce S - Vienna, VA

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

  • trail
  • trail
  • OFFLINE
  • Posts: 232
  • Thanks: 21
  • Karma: 813
18 years 6 days ago #25042 by trail
Hihi this little piece of code was actually contributed to me by Viames who shortened the way i wrote it initially..

[code:1]is_int(@$counter++/2) ? $class='sectiontableentry1' : $class='sectiontableentry2';[/code:1]

then just use class=$class in ur rows..

DJ Trail.
CB Co-Founder & Test-Lead.
Plugins: My Age , Starsign Matchmaking Horoscope , My Visitor , My Highscores , My ProfileID ,
My Components: Import & Invite Karma Casino (Use Test / Test)
My Modules: Many :)

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

  • bascherz
  • bascherz
  • OFFLINE
  • Posts: 228
  • Thanks: 29
  • Karma: 11
18 years 6 days ago #25084 by bascherz
Hey Trail,

Thanks for the code snippet, but it's not the logic I am after. It's the previous (presumably global) variable value I need so I can pick up where the CB field processing left off. That very logic is also in comprofiler.class.php in their updating of that global variable I mentioned. But as I indicated, every time my plug-in gets called, that variable contains the value 1.

Ciao!

Bruce S - Vienna, VA

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

Moderators: beatnantkrileon
Powered by Kunena Forum