Transforming page attribute into css class
Permalink
            Hi,
I tried to transform the page attribute (user input in page properties) into a css class for the right div-box. Can u tell me why this doesn't work?
As class in the div statement there appears simply nothing...
        
    I tried to transform the page attribute (user input in page properties) into a css class for the right div-box. Can u tell me why this doesn't work?
As class in the div statement there appears simply nothing...

                        I believe you're missing  at the beginning of your code                    
                
                        col-sm-3 is a class from bootstrap3.
af is an own class which I need.
...and at last wanted to define the backgroundcolor through page attribute.
When i directly use c->getAttribute('bgr_af_1') in the div statement it works very well! Sure, in this case the css class must be named the same...
                af is an own class which I need.
...and at last wanted to define the backgroundcolor through page attribute.
When i directly use c->getAttribute('bgr_af_1') in the div statement it works very well! Sure, in this case the css class must be named the same...
                        My solution looks like this:
Page attribute is 'bgr_af_1'
In the template I do this:
And in the main.css I format the bgr_af_1 class.
                Page attribute is 'bgr_af_1'
In the template I do this:
<div class="col-sm-3 af <?php echo $c->getAttribute('bgr_af_1'); ?>">
And in the main.css I format the bgr_af_1 class.

