Skip Navigation

[Resolved] OceanWP Navigation Menu Current Location indication broken when Views updates pagination or search

This thread is resolved. Here is a description of the problem and solution.

Problem:
OceanWP has a feature to "underline" the current position in the menu (so if you are on page XY and there is a Menu item for that page, it'll underline that menu item).

When the same page has a view and the view updates search or pagination, the underline feature of OceanWP does not work anymore.

Solution:
This is a problem in the OceanWP Theme, it can be resolved from Toolset side by enabling AJAX updated views and not updating the URL.

The technical reason is, OceanWP's feature assuemes absolute URL's without possible query arguments after it, like so:
https://yoursite.com/your-menu-item-page/?query_arg=query_value

As soon such URLs are present, the OceanWP underlining of the menu item breaks.

This issue should be reported, and resolved on side of OceanWP as the Toolset is not required to produce the issue (any search query would produce the problem). It can as said be easily solved when using Toolset.

This support ticket is created 5 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Tagged: 

This topic contains 3 replies, has 2 voices.

Last updated by josephC-5 5 years, 3 months ago.

Assisted by: Beda.

Author
Posts
#1339805

Hi there,

I'm using the OceanWP theme to build a website for an art gallery. Note that the website is password-protected (the credentials are available upon request).

On the exhibitions page (hidden link), the "exhibitions" link is underlined to indicate that it is the current page the visitor is viewing.

The page contains a view with pagination. When I click on a page number at the bottom of the page (except page 1), the "exhibitions" link is no longer underlined.

Can we fix this?

Thanks!

Saul

#1340297

I assume this is because your underline listens to an URL, and that URL gets changed with pagination or views searches.
What you can try is to listen just to the "part" of the URL that you need to determine the position in the menu (I assume you use pages as menu items or similar, to determine this).

I can't see how this, in fact, looks like - so I activated the private reply in case you can provide access.

Note, what you might try is not updating the Views URL, you can set that in Toolset > Settings, so the URL won't change visibly in the Browser when operating a View.
For this, you'll need an AJAX updated View pagination or search.

I am not sure if that will resolve the issue as it'll depend on how you make the menu be underlined.

#1341813

It is not WordPress making those highlights, as you already noticed.
WordPress has no such features. This is most likely the Theme you use: Carroll and Sons, or in other words - OceanWP.

I see also that the test I suggested actually shows what I suspected.
The Theme uses some indicator in the URL, and since the URL gets updated when you run a View Search, the code that does this check does not find the queried parts of the URL in the sequence it expects them, and fails.

That's fully expected, and a solution can only be implemented on the side of the code that does that highlighting.
Basically, anything what updates the URL would destroy that mechanism unless it updates the URL exactly so as expected by it.

The View does not alter anything that is already there in the URL when paginating. So the Code that makes the underlyining, likely expects a ENDING URL, and that is not the case when ? parameters are added AFTER exhibition/.
So that code is likely in need of updates, and should consider ? parameters in an URL to be a possible case.

But this cannot be done in Toolset, you can ask OceanWP if they have plans to adjust this.
You should, BTW, be able to replicate that issue very easily not using Toolset.
Just call some ransom in the URL, like so:
hidden link

The Highlight disappears, just due to the ? paramater.
This is what you can report to the developers creating that highlighting, so they can test this without the need of excluding Toolset as a possible culprit first.

Thanks!

#1343481

Thanks, Beda!

I figured the query string was the culprit, but I didn't know whether it was a theme issue or Toolset issue. Your response makes it clear this is a theme issue, and I'll take it up with OceanWP.

Thanks again!

Saul