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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Template Questions /

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

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


Go to End


5 Posts   3169 Views

Avatar
delphaber

Community Member, 3 Posts

3 June 2009 at 5:56am

Edited: 03/06/2009 6:08am

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

Community Member, 99 Posts

3 June 2009 at 10:22am

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 Requirements::clear() or block() in your Page_Controller::init() to get rid of the extras and see if it works.

Avatar
delphaber

Community Member, 3 Posts

3 June 2009 at 10:31am

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

Community Member, 3 Posts

4 June 2009 at 9:39am

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

Community Member, 99 Posts

4 June 2009 at 9:43am

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');