Resource icon

Enable users to specify a custom CSS file

THANKS. I've been going nuts trying to figure out how to create predefined backgrounds using this code and a userfield drop down box in preferences but it isn't working.

Code:
<xen:if is="{$user.customFields.profilebg} == 'yes'"><style><xen:require css="profilebg.css" /></style></xen:if>

^^^That works, but trying to change a css template by using a {$user.customFields.profilecss} kind of custom user field isn't working.
Yes dropdowns work different, mine is made for a URL field, good job.
 
I can't seem to get this to work...

I added this at the top of member_view template:
Code:
<xen:if is="{$user.customFields.user_bg}"><style>@import url('{$user.customFields.user_bg}')</style></xen:if>

And this in PAGE_CONTAINER in the location you showed:
Code:
<!--XenForo_Require:CSS-->   
    {xen:helper ignoredCss, {$visitor.ignoredUsers}}
<xen:if is="{$visitor.customFields.user_bg}"><link rel="stylesheet" type="text/css" href="{$visitor.customFields.user_bg}" /></xen:if>

I also created a Custom field for URL

But the image, I inserted in the custom URL field in preference, doesn't show.
 
I can't seem to get this to work...

I added this at the top of member_view template:
Code:
<xen:if is="{$user.customFields.user_bg}"><style>@import url('{$user.customFields.user_bg}')</style></xen:if>

And this in PAGE_CONTAINER in the location you showed:
Code:
<!--XenForo_Require:CSS--> 
    {xen:helper ignoredCss, {$visitor.ignoredUsers}}
<xen:if is="{$visitor.customFields.user_bg}"><link rel="stylesheet" type="text/css" href="{$visitor.customFields.user_bg}" /></xen:if>

I also created a Custom field for URL

But the image, I inserted in the custom URL field in preference, doesn't show.
You are a little confused, my solution is for letting people specify a CSS file and customize the style of their profile page, to let them specify directly a background image url you need to customize the code quit a bit.
 
Top Bottom