Jump to:

5540 Posts in 1738 Topics by 1224 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Color-picker?

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1 2 3 4 5
Go to End
Author Topic: 7920 Views
  • banal
    Avatar
    Community Member
    901 Posts

    Re: Color-picker? Link to this post

    Hi

    That's odd. I can confirm that it works in popups, both locally and on live environments.
    I guess it's a good idea to try to narrow this down.
    Do you run the same version of SilverStripe in both environments?
    Do you get any errors in Firebug when you try to open a colorpicker on the live server?
    Any files missing (look at the "Net" tab in Firebug)?
    Does the same issue occur in every browser?

  • go2planC
    Avatar
    Community Member
    19 Posts

    Re: Color-picker? Link to this post

    Hi Banal,

    Yeah I've found it odd too. In answer to your questions yes I am running the same version of SS in both enviroments and it's not working in any browsers I have tested it in.

    Thanks for pointing me to the Net tab in firebug - I am actually getting 3 errors coming up - all of which seem to suggest that jquery is not being loaded.

    the 3 errors are:

    jQuery is not defined
    [Break on this error] })(jQuery); dataob...9901105 (line 46)

    jQuery is not defined
    [Break on this error] })(jQuery) colorp...9900943 (line 450)

    jQuery is not defined
    [Break on this error] $j = jQuery.noConflict(); colorf...9900943 (line 1)

    The question now is why? (I say rubbing my chin)

  • banal
    Avatar
    Community Member
    901 Posts

    Re: Color-picker? Link to this post

    Hm that error can occur if jQuery is being included multiple times.. but that would produce the same error on the local installation as well. Maybe try to re-upload the jsparty directory and make sure it has the appropriate permissions (files must be globally readable)

  • go2planC
    Avatar
    Community Member
    19 Posts

    Re: Color-picker? Link to this post

    Hi Banal

    Yeah tried re-uploading the jsparty directory earlier but didn't really think it was going to be that as the colour picker is working in the CMS (not within popup). Just changed the readable permissions for jsparty to fully readable (777) and still no joy! As you can see in the attachments the local enviroment is making 4 requests while the live enviroment is only making 3. The missing request happens to be the jquery.js

    Thanks for your help by the way

    Attached Files
  • banal
    Avatar
    Community Member
    901 Posts

    Re: Color-picker? Link to this post

    Hm. Never saw anything like that. So there's not even an attempt to load jQuery? Did you empty the browser cache before monitoring the Net-Tab?
    Try to delete the base.js, cmsmain.js and leftandmain.js files in the assets folder too. They are automatically generated, so deleting them is not a problem. If that doesn't help, try a flush on the admin.. eg. yourdomain.com/admin?flush=1

    Other than that, there's not much advise I can give. I suspect it could be the auto-generated files though.

  • go2planC
    Avatar
    Community Member
    19 Posts

    Re: Color-picker? Link to this post

    nope sorry none of those worked. God Knows what's causing it.

    Although I've just found a pretty ugly hack to get it working. Thanks to all your help!

    I've just added : <script type="text/javascript" src="mysite/javascript/lib/jquery.js"></script>
    into /dataobject_manager/templates/DataObjectManager_popup.ss

    It's messy - but it works for now!

    Thanks once again!

  • mrsteveheyes
    Avatar
    Community Member
    15 Posts

    Re: Color-picker? Link to this post

    Hi there,

    I've been having a bit of trouble with the ColorPicker Module. Firstly though; it's a great piece of code that works really well.

    However, I can't get it to display on my templates. The code I'm using is the following:

    class ArticlePage extends Page {
    ...
    static $db = array(
       'Date' => 'Date',
       'Author' => 'Text',
       'BarColour' => 'Text'
    );
    ...
       $fields->addFieldToTab('Root.Content.Main', new ColorField('BarColour', 'Bar Colour'));
    ...
    }

    and the template:

    <div class="primary" role="main">

       <div class="content">

             <div class="article-content">

                <h1>$Title</h1>
                
    <!-- ADDED FOR TESTING PURPOSES ^_^ -->
                <p>BG: $BarColour</p>
                
                $Content
             </div><!-- /.article-content -->
       
       </div><!-- /.content -->
       
    </div><!-- /.primary -->

    I'm sure it's something simple! But please help if you can.

    Cheers,
    Steve

    7920 Views
Page: 1 2 3 4 5
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.