0

I'm new to drupal,

I'm getting users favorite color from cck color picker then I want to set it to the background of the profile page. Profile page i created using views. I tried to do it from crating view tpl file but no luck is any way to do that task please direct me

1 Answer 1

0

this is obviously not complete code, as you need to figure out how to call the field data. I haven't tested this, but in theory this should work. Add this to the .tpl.php file, and see if it works.

<?php
    header('Content-Type: text/css');
    /*replace cckmachinename and fieldmachinename with actual code*/;
    $user_color = cckmachinename -> fieldmachinename
?>

some selector {
    background-color: <?php echo $user_color; ?>;
}

Hope this helps!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.