Jump to:

23380 Posts in 18311 Topics by 2867 members

General Questions

SilverStripe Forums » General Questions » HTMLEditor fields invisible/disappeared after moving Silverstripe [SOLVED]

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 724 Views
  • Alek
    Avatar
    Community Member
    8 Posts

    HTMLEditor fields invisible/disappeared after moving Silverstripe [SOLVED] Link to this post

    Hi All,

    I posted this query yesterday in http://www.silverstripe.org/dataobjectmanager-module-forum/show/12159 but realised it's probably the wrong area for this... I really hope someone can help soon as I am under some time constraints...

    Basically, after moving everything from my local PC to my dev server, my HTMLeditor boxes have disappeared from within the pages in the admin section of silverstripe. They seem to be hidden by CSS?

    I am using SS 3.0.0. This looks like some kind of JS conflict or something..

    Can anyone help? I'd prefer not to have to do a clean install or any upgrades at the moment. Is there a simple fix for this?

    Thanks.

  • Alek
    Avatar
    Community Member
    8 Posts

    Re: HTMLEditor fields invisible/disappeared after moving Silverstripe [SOLVED] Link to this post

    Just tried upgrading to 3.0.1rc3
    Didn't work either...

    Anyone have any ideas at all please?

  • DesignerX.com.au
    Avatar
    Community Member
    107 Posts

    Re: HTMLEditor fields invisible/disappeared after moving Silverstripe [SOLVED] Link to this post

    Hi , you will need to use new HtmlEditorField() .. give it a try & let us know how it goes for you

  • Alek
    Avatar
    Community Member
    8 Posts

    Re: HTMLEditor fields invisible/disappeared after moving Silverstripe [SOLVED] Link to this post

    Thanks for replying!

    I'm not a php/mysql noob but I'm not too familiar with the SS structure just yet. I haven't really done much coding on it at all in fact, most of the work has been templating as the core system is pretty much how we need it.

    Could you point me in the right area as to where and how I should be using the aforementioned HtmlEditorField() ?

    Many thanks again.

  • DesignerX.com.au
    Avatar
    Community Member
    107 Posts

    Re: HTMLEditor fields invisible/disappeared after moving Silverstripe [SOLVED] Link to this post

    Hi:
    you can use HtmlEditorField() to replace SimpleHTMLField "I think" .. basically you can use HtmlEditorField() with any HTMLText field type, for example:
    if you have static $db = array( 'Discription' => 'HTMLText' ); you can use new HtmlEditorField('Discription); in the getCMSField function .. If you have custom page types or still using old modules , you will need to re-check the code and/or download the latest module version .

    What is the name & type of the page that has this error ? & if you can post the .php code used for this page type ( http://www.ssbits.com/ )

  • Alek
    Avatar
    Community Member
    8 Posts

    Re: HTMLEditor fields invisible/disappeared after moving Silverstripe [SOLVED] Link to this post

    I haven't really messed with much there so I'm not sure... I just added another field but this seems to have no effect (I also tried a clean install on this server and it has the same problem). This is the code you mentioned in my SiteTree.php:

       static $db = array(
          "URLSegment" => "Varchar(255)",
          "Title" => "Varchar(255)",
          "MenuTitle" => "Varchar(100)",
          "Content" => "HTMLText",
          "IntroColumn" => "HTMLText",
          "MetaTitle" => "Varchar(255)",
          "MetaDescription" => "Text",
          "MetaKeywords" => "Varchar(255)",
          "ExtraMeta" => "HTMLText",
          "ShowInMenus" => "Boolean",
          "ShowInSearch" => "Boolean",
          "Sort" => "Int",
          "HasBrokenFile" => "Boolean",
          "HasBrokenLink" => "Boolean",
          "ReportClass" => "Varchar",
          "CanViewType" => "Enum('Anyone, LoggedInUsers, OnlyTheseUsers, Inherit', 'Inherit')",
          "CanEditType" => "Enum('LoggedInUsers, OnlyTheseUsers, Inherit', 'Inherit')",
       );

    I'm not quite sure how to implement your solution with a multi-array like that?

    The only other bit of code I added in SiteTree.php is
    $fields->addFieldToTab("Root.IntroColumn", new HTMLEditorField('IntroColumn','Intro Column Content'));
    just before 'return $fields;' in the getCMSFields function

    I cannot even find SimpleHTMLField in there.. Remember this is SS 3.0.0 so maybe that's been changed already?

    The problem happens when I try to edit pages. I cannot see the htmleditor. It is simply not there. e.g. http://dev/silverstripesite/index.php/admin/pages/edit/show/7

    Please see the attachment.

    Thank you for your help so far. I hope I can sort this out otherwise we cannot use silverstripe.

    Attached Files
  • DesignerX.com.au
    Avatar
    Community Member
    107 Posts

    Re: HTMLEditor fields invisible/disappeared after moving Silverstripe [SOLVED] Link to this post

    Hi:
    - try to upgrade to SS3.0.1 -stable
    - I am using SS3.0.1 now & I dont get problem like this, so most likely its because you using an older/unstable SS release or some files are missing/corrupt when uploading through FTP (this happens to me sometimes )..
    re-check & upload the latest SS release & let me know how it goes ;)
    GL

  • Alek
    Avatar
    Community Member
    8 Posts

    Re: HTMLEditor fields invisible/disappeared after moving Silverstripe [SOLVED] Link to this post

    Ouch. Panic over. I actually tried what you suggested, but eventually found the problem!

    In the end, it was a problem with the .htaccess file! I managed to find out by debugging the javascript and the clue was that 'tinymce' was simply not being loaded at all because the script was looking for it in the wrong place. When I migrated the installation to the other server, the RewriteBase parameter in .htaccess was incorrect, so I changed it. The site worked as normal, all except tinymce, so I thought there was some other problem at that point. Only after the debugging did I look back at the .htaccess and realise that I had an error in the RewriteBase - I had included the server hostname as a prefix!!! Duh....

    Anyway, I changed the RewriteBase to what it should be, and everything works as normal and tinymce started to appear again. Sorry for the goose chase! But thank you very much for guiding me through DesignerX - a good few karma points for you there.

    Cheers.

    724 Views
Page: 1
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.