One text attribute works, and the other does not. Included code. Can't figure it out. :-(

Permalink
I am using a simple code to check for a text page attribute from inside the autonav block view, and then output it.
Here is the code:

$getCustomClass = $_c->getCollectionAttributeValue('boom_customclass');
        if ($getCustomClass) {
            $customClass = ' class="' . $getCustomClass . '" ';
        } else {
            $customClass = '';
        }


I created text attribute with handle 'boom_customclass' and name 'BOOM! Custom Class', and add it to a page that is in my nav tree.

I attempt to output the variable by using something like
echo ('<li' . $customClass . '>');


I can't get anything to output this way.
If I change the code to check for another attribute that was installed by a third party block, it works fine. For instance instead of 'boom_customclass' I can put in 'megamenu_accesskey' which is also a text attribute, add it to a page same as before, and my code will output fine, just as intended.

Is there something I am missing with regard to custom attributes?

Many thanks.

PS: $_c is in the main autonav loop. It is the current iteration's collection object.

boomgraphics
 
boomgraphics replied on at Permalink Reply
boomgraphics
OMG I figured it out. I had one letter out of place, and I was letting my browser textfield autocomplete fill in the blanks with a typo in it. I feel so stupid! :-)

This website stores cookies on your computer. These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media. To find out more about the cookies we use, see our Privacy Policy.