Creating a Custom Stylevar Without Modifying Master Style

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ketan9
    New Member
    • Jul 2010
    • 1
    • 4.0.x

    [CMS] Creating a Custom Stylevar Without Modifying Master Style

    I have refered to https://www.vbulletin.com/forum/show...=1#post2012699, which allows one to create custom stylevar by editing the Master Stylevar definition list.

    I develop custom styles and would like to use couple of new stylevars for my styles without having to create custom style in Master style each time I install style for customers. My question is that is there a way to create a custom stylevar using the following code in the uploaded style content?

    Code:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <style name="MyCustom" vbversion="4.1.7" product="vbulletin" type="custom">
       <templategroup name="Ungrouped Templates 1">
            <template name="additional.css" templatetype="template" date="1303275768" username="ketan" version="4.1.7"><=!=[=C=D=A=T=A=[
    #wgo .blockbody.formcontrols {
        border: none;
        background: {vb:stylevar custom_background};
    }]=]=>
            </template>
        </templategroup>
       <stylevardfns>
            <stylevargroup name="CustomVars">
                <stylevar name="custom_background" datatype="background" validation="" failsafe="" />
            </stylevargroup>
       </stylevardfns>
        <stylevars>
            <stylevar name="custom_background" value="YTo2OntzOjU6InVuaXRzIjtzOjA6IiI7czo1OiJjb2xvciI7czo3OiIjZGZlNmVmIjtzOjU6ImltYWdlIjtzOjA6IiI7czo2OiJyZXBlYXQiO3M6MDoiIjtzOjE6IngiO3M6MDoiIjtzOjE6InkiO3M6MDoiIjt9" />
        </stylevars>
    </style>
    I tried but the code didn't work as expected, I am unable to use this new custom stylevar. I checked the database and I see my stylevar in the table but not in stylevardfn table. The version I tried with is 4.1.7 PL2 and 4.1.8. Is there a way I can import my custom stylevar and use them in the custom style?

    Thanks,
    Last edited by ketan9; Sat 19 Nov '11, 8:46am.
  • Andreas
    Senior Member
    • Feb 2004
    • 2323

    #2
    1) Create an Add-on
    2) Turn on Debug Mode
    3) Create the necessary Stylevars in MASTER style for that Add-on
    4) Deliver the Add-on with your style

    Done

    Comment

    Related Topics

    Collapse

    Working...