Hi Greg! That was a HUGE step in the right direction toward completing this. Thank you, thank you! :-)
I added additional code to convert the count value to percentages and that seems to be working, assigning CSS values based on a tag's percentage of usage (occurrences in the"tags" field).
After further testing, here are the final minor obstacles I need to overcome (in order of priority).
1. The whole thing breaks down if the user puts a comma at the end of their list of tags in the section editor. For instance, this tag list works fine: "probiotics, health, digestion" - However, this list produces a plethora of errors: "probiotics, health, digestion," - That last comma is the culprit (though trailing spaces don't seem to be an issue). In setting up the "tags" field, I only allowed lowercase letters, commas, and spaces... so no other characters should be an issue. However, I need a way to remove a final comma if it exits. I tried using this code:
$string = rtrim($string, ',');
Unfortunately, no variable I tried using (in the place of $string) would work. I am also unsure of where to put it on the page. I've tried just about every place possible, but likely with the wrong variables. :-)
2. I only want the tag section to appear in the sidebar if there is at least one tag present of the field. I tried using a standard "if" statement like so:
<?PHP if ($newsRecord['title']): ?>
Title: <?PHP echo $newsRecord['title'] ?>
<?PHP endif; ?>
I placed this around the tags section. However, since my variable was off, I never got it working. Typically, I don't have issues with this sort of thing. But, I'm unsure as to what variable to use.
3. Curiously, it doesn't seem to be shuffling the tags, even with the new shuffle function. Instead, it is taking the tags from the first record and then, adding to the tag list by going up through records in the order they were created and adding any unique (no yet listed) tags. This one is not as important, but would still be a nice thing to get working.
I'm uploading the latest version of the code to this post.. Hopefully these are pretty straight-forward. Thanks, again, for you assistance!
- Jeremy
---------------------------
Dwelling Productions
www.dwellingproductions.com