Black Friday 2026 50% off every plan Our biggest deal of the year on #1 Joomla products.
Ends in 13d 05h 35m 54s
Claim 50% off
Solved Templates

Onepage Template - Replace Slider with something else

Asked by Ernst 8 months ago Last activity 1 week ago

Hi,

I would like to customize my one-page template so that the menu is always at the top and the slider is replaced by another element, such as a photo. I have already found a solution here for positioning the menu:

https://www.joomshaper.com/forum/question/401

However, removing or replacing the slider seems more difficult. If I simply delete it, the menu only appears during scrolling once the height of the (now missing) slider has been passed. Furthermore, when the off-canvas menu (hamburger menu) is active, the slider area is covered with a blur effect, which makes the text I’ve placed there instead look messy or unreadable.

I am not familiar with template definitions and haven't been able to find the necessary adjustments through my own search. I would be very grateful for help on what I need to change and where, in order to achieve the desired look.

Best regards
Ernst

Accepted answer

Marked as the solution
Rashida Rahman Staff

Hi Ernst,

You're most welcome! I'm really glad to hear the one-page template is working as expected now, and thank you for the kind words about our team. It means a lot to us.

Since the issue is solved, could you please mark the most useful answer as accepted? That closes the post and helps other users with the same question find the solution quickly.

If you're happy with our products and support, we would also really appreciate a short review. It only takes a minute and encourages our team a great deal:

If you need anything else, feel free to open a new post anytime.

Best regards,
Rashida

8 more replies

Rashida Rahman Staff

Hi Ernst,

Thanks for reaching out.

Would you please share your site URL where you are facing this issue, please? It will be better to understand the problem.

Best regards,

Ernst Asked this

Dear Rashida,

please find URL and credentials to log-in as an admin in the hidden content.

Regards, Ernst

Ernst Asked this

Waiting more than six months for a support response from a software vendor is rather unusual in my experience...

So I thought I'd give my request another little nudge. Since it's a fairly technical question, perhaps an engineer might take pity on me and have a look at it.

I'd certainly appreciate it!
Rgrds Ernst

Rashida Rahman Staff

Hi Ernst,

Sorry for the long wait, and thanks for the reminder.

Your current custom CSS only targets #sp-header.has-slideshow. That class is only added when a slider is on the page, so once you removed the slider the rule stopped applying. The blur comes from the off-canvas overlay, which only covers the first screen of the page.

Please go to System → Site Template Styles → shaper_onepage – Default → Template Options → Custom Code → Custom CSS. Replace your existing #sp-header.has-slideshow rule with the following and click Save:

#sp-header,
#sp-header.menu-fixed,
#sp-header.menu-fixed-out {
    position: fixed !important;
    top: 0 !important;
    left: 0;
    right: 0;
    z-index: 999;
}
#sp-main { padding-top: 80px; }

.offcanvas-overlay {
    position: fixed;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

The menu will now stay at the top all the time. While the off-canvas menu is open, the page will only be dimmed instead of blurred, so your text stays readable.

To show a photo where the slider was, open your home page in SP Page Builder and add a section at the top. In that section's Settings → Style, set Background to Image and choose your photo. Under Spacing, add top and bottom padding (for example 250px) to set the height.

Clear the Joomla cache and press Ctrl+F5 to see the changes.

Best regards,

Ernst Asked this
2 weeks ago · edited

Dear Rashida,

First of all, many thanks for your reply!

With the information you provided, I was able to adjust the template to some extent, and things are now working better. However, after applying the settings you suggested, I noticed the following issues:

1. Full-screen mode (e.g. on a 24-inch monitor)

When I click on the Home menu item, the page scrolls back to the top, but the navigation gets stuck on About, which is the first menu item after Home.

If I then manually scroll all the way to the top using the mouse, the Home menu item is correctly highlighted.

2. Tablet/Smartphone mode (hamburger menu)

When I am on the Home section and then, for example, resize the browser window to tablet size, scroll down the page and open the hamburger menu, Home is still highlighted. In other words, the menu and the currently visible section are not synchronized.

However, if I am on a section further down the page, such as Clients, and then scroll up or down and open the hamburger menu, the correct menu item corresponding to the currently visible section is highlighted.

3. Menu items briefly jumping between selections (hamburger menu)

There is another issue, which I suspect is related to the template's general behaviour.

When I click on a menu item in the hamburger menu that is more than one item away from the currently selected one, the menu items briefly get higlighted from one to another as the page scrolls. This creates a rather restless and distracting visual effect.

It would be much nicer if only the newly selected menu item were highlighted.

I suspect this happens because the template automatically updates the active menu item whenever a new section comes into view during scrolling.

4. The same behaviour in the regular desktop menu

Exactly the same thing happens in the regular navigation menu, for example in full-screen desktop mode.

When selecting a menu item that is several items away from the currently active one, each intermediate section briefly causes its corresponding menu item to be highlighted as the page scrolls past it.

5. Possible improvement

It would be great if this behaviour could somehow be prevented.

Perhaps a JavaScript expert knows a way to temporarily suspend the active menu item updates during automatic scrolling (something like pausing the UI updates) and then highlight only the destination menu item once the scrolling animation has finished.

That would make the navigation feel much smoother and more polished.

6. White Gap at the Top in Mobile View

And one more thing: When the browser window is resized and the main menu is replaced by the hamburger menu, a white strip of about 15–20 px remains at the top of the page. How can I get rid of it?


I'll share the link to my website in a hidden comment. If you need access to the admin backend, just let me know.

Best regards,
Ernst

Rashida Rahman Staff
2 weeks ago · edited

Hi Ernst,

Thanks for the detailed feedback. I checked your site and could reproduce this. The template's one-page script updates the highlighted item while the page is still scrolling, and it tracks the desktop and hamburger menus separately. The white strip appears because the header is lower on tablet (70px) and mobile (60px) than the 80px my CSS reserved.

Please go to System → Site Template Styles → shaper_onepage – Default → Template Options → Custom Code.

  1. In Custom CSS, add this below the existing code:
@media (max-width: 991px) {
  #sp-main { padding-top: 70px; }
}
@media (max-width: 767px) {
  #sp-main { padding-top: 60px; }
}
  1. In Custom Javascript, paste this:
window.addEventListener('load', function () {
  var $ = window.jQuery;
  var header = document.getElementById('sp-header');
  if (!$ || !header) return;

  var $menus = $('.sp-megamenu-wrapper .sp-megamenu-parent, .offcanvas-menu .menu.nav-pills');
  var $links = $menus.find('a[href*="#"]').not('.no-scroll').filter(function () {
    return this.hash.length > 1 && document.getElementById(this.hash.slice(1));
  });
  if (!$links.length) return;

  // Switch off the template's own scroll-spy and click handling
  $(window).off('scroll.onePageNav');
  $menus.find('a').off('click.onePageNav');

  var ids = [];
  $links.each(function () {
    var id = this.hash.slice(1);
    if (ids.indexOf(id) === -1) ids.push(id);
  });

  var locked = false;
  var timer = null;

  function setActive(id) {
    $menus.find('li.active').removeClass('active');
    $links.filter(function () { return this.hash === '#' + id; }).parent().addClass('active');
  }

  function topOf(id) {
    return document.getElementById(id).getBoundingClientRect().top + window.pageYOffset;
  }

  function update() {
    if (locked) return;
    var doc = document.documentElement;
    var line = window.pageYOffset + header.offsetHeight + 5;
    var current = ids[0];
    ids.forEach(function (id) {
      if (topOf(id) <= line) current = id;
    });
    if (window.pageYOffset > 0 && window.innerHeight + window.pageYOffset >= doc.scrollHeight - 2) {
      current = ids[ids.length - 1];
    }
    setActive(current);
  }

  function unlockSoon() {
    clearTimeout(timer);
    timer = setTimeout(function () {
      locked = false;
      update();
    }, 150);
  }

  window.addEventListener('scroll', function () {
    if (locked) unlockSoon(); else update();
  }, { passive: true });
  window.addEventListener('resize', update);

  $links.on('click', function (e) {
    var id = this.hash.slice(1);
    e.preventDefault();
    locked = true;
    setActive(id);
    var top = id === ids[0] ? 0 : topOf(id) - header.offsetHeight;
    window.scrollTo({ top: Math.max(0, Math.round(top)), behavior: 'smooth' });
    unlockSoon();
  });

  update();
});
  1. Click Save, clear the Joomla cache and press Ctrl+F5.

After this, only the clicked menu item is highlighted while the page scrolls, Home stays highlighted at the top on large screens, both menus stay in sync, and the white strip is gone. When scrolling by hand, an item becomes active once its section reaches the menu bar.

Please let me know how it works on your side.

Best regards,

Ernst Asked this

Dear Rashida,

Many thanks for the JavaScript code and CSS settings. With these adjustments, the one-page template works really well!

I also like the fact that it comes directly from your own development team rather than a third-party provider, which can sometimes lead to complicated dependencies.

Best regards,
Ernst

Log in to reply.