I have modified the modxhost template, mainly images only to suit my site design hosted at www.ritualscreative.com/index.php. The complete url is necessary since my static html site is still hosted and once I iron out the bugs I am facing I will populate the modx installation with my content.
When I click on a link or refresh a page, IE and Mozilla do not take me to the top of the page and go a bit lower on the page whereas Opera doesn’t have this problem. I have a big header image and tweaked the padding in modx layout.css to start the content below the header image. If I remove this padding my pages don’t face this problem, but my content goes behind the header image and starts at the top of the page thereby a lot of it not being visible.
I have tried a lot of things but can’t get my hand on the right code to sort this out. Help, anyone?
-
☆ A M B ☆
- 24,524 Posts
It’s doing that because of the login form. The first field gets the focus as soon as the page loads, so it auto-scrolls down until it is visible. You can either stop the field from getting focus, or rearrange your layout so the form is high enough on the page not to need to scroll. The culprit is this line:
<script type="text/javascript">
if (document.loginfrm) document.loginfrm.username.focus();
</script>
By the way, that’s a really nice design!
Thanks for the compliments on the design.
I can’t locate the script mentioned by you. Where do I find it?
-
☆ A M B ☆
- 24,524 Posts
It’s embedded in the template by assets/snippets/weblogin/weblogin.inc.php on line 89.
Thanks, I removed the .focus from the script and now it works the way I want it. Except that I don’t want the login area on any of the pages except the blog page. I have removed the login area from the ModxHost template and let it remain on the ’blog with comments’ template. But when I login as a webuser on the blog page login box, I am still taken to the home page as a default. Is there a way to change it so that I remain on the page I have logged in at, in my case the blog page?
-
☆ A M B ☆
- 24,524 Posts
That depends on two things, the setting for your user, and the setting for the login snippet. There’s a parameter &loginhomeid or something like that. Check the user’s setting in the User tab when creating/editing a user.