Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Template Questions

Security login page won't apply correctly my css style to dhtml menu


Reply

5 Posts   2278 Views

Avatar
delphaber

3 June 2009 at 5:56am (Last edited: 3 June 2009 6:08am), Community Member, 3 Posts

Hi all

I'm working on this site: http://ab-fisioterapia.com

As you see, my dhml menu is working nice.
But when user goes to login page (http://ab-fisioterapia.com/admin/), my menu is messed up. Reading source code I've found that <a> elements inside <li> ones have no css style property name. How is possible?

I've already tried with flushing my site :)

I hope you could help me. Thank you very much in advance!

Avatar
Nathan Cox

3 June 2009 at 10:22am Community Member, 99 Posts

Firebug's reporting this javascript error on the login page:

$("ul.sf-menu") is null

I'm guessing the problem is that the login form includes alot of other javascript, like Prototype and Behaviour, and they're not playing nicely with your jQuery. Try using [url=http://doc.silverstripe.org/doku.php?id=requirements]Requirements::clear() or block()[/url] in your Page_Controller::init() to get rid of the extras and see if it works.

Avatar
delphaber

3 June 2009 at 10:31am Community Member, 3 Posts

The old good firebug...

I did not remember to activate javascript and console panels!!! Thank you very much. I will try to bug fix tomorrow. It's time to sleep in Italy ;)

Thank you :)

Avatar
delphaber

4 June 2009 at 9:39am Community Member, 3 Posts

Hi Nathan,

based on your topic, I've searched into forum and I've found this:

http://www.silverstripe.org/template-questions/show/259612#post259612

Adding this line
Validator::set_javascript_validation_handler('none');

to Page.php had fixed my problem. Probably I would not have field validation, but I have few time and this works.. so... I'll spend more time next weeks :)

Code:

class Page_Controller extends ContentController {
   
   public function init() {
      parent::init();
      Validator::set_javascript_validation_handler('none');
      // Note: you should use SS template require tags inside your templates
      // instead of putting Requirements calls here. However these are
      // included so that our older themes still work
      Requirements::themedCSS("layout");
      Requirements::themedCSS("typography");
      Requirements::themedCSS("form");
   }
....
}

Avatar
Nathan Cox

4 June 2009 at 9:43am Community Member, 99 Posts

Haha I completely forgot you can do that..yeah, a more elegant solution. Hopefully in some near version we'll be able to say Validator::set_javascript_validation_handler('jquery');