Jump to content
Graphics Submission Contest Read more... ×
Search In
  • More options...
Find results that contain...
Find results in...
  • Sign Up
Kit the Human

What have you learnt recently?

Recommended Posts

I love customizing postbit stuff so it's coloured according to each member's usergroup. I used to do it in a really clunky McGuiver-esque way by sticking the {$post['usertitle']} variable into an element class name. It corresponded to a bunch of classes I had in my css like; 


.text_Member {color: red;}

.background_Member {background: red;}



But now I've learned about the magic of {$usergroup['gid']}. It's less work and much more flexible.

Share this post

Link to post
Share on other sites

ID variables are a godsend, I swear. My favourite trick with them though was (to save myself rewriting the same code) is thus:

class="miniprofile group{$usergroup['gid']}"

So, you can do all your applicable to all groups with .miniprofile


For the stuff you want to be unique to each group? .miniprofile.groupX


Beats copy pasta all the time!


(I don't know why, but you can't start a class with a number, so you have to add a word or letter in front of the variable.)

Share this post

Link to post
Share on other sites

  • Recently Browsing   0 members

    No registered users viewing this page.


Important Information

By using this site, you agree to our Terms of Use, Guidelines and Privacy Policy. 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.