Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working with url parameters? #161

Open
midz opened this issue Feb 26, 2018 · 2 comments
Open

Not working with url parameters? #161

midz opened this issue Feb 26, 2018 · 2 comments

Comments

@midz
Copy link

midz commented Feb 26, 2018

Hi there!
Is there some simple way for metismenu to recognize that page with url parameters is the same as the page without url parameters? For example, I have a menu item that goes to site search - search.php

When I go to this page, I have active menu item "Search". But when I submit GET form on this page, it takes me to page search.php?term=something and now the menu does not show that I am on Search page.

@MitchellHansen
Copy link

MitchellHansen commented Oct 22, 2018

I'm having the opposite issue as you, metismenu ignores my url parameters and always highlights the item without parameters.

<ul class="metismenu">
            <li class="side-nav-item">
                <a href="javascript: void(0);" class="side-nav-link">
                    <i class="dripicons-view-apps"></i>
                    <span> Title </span>
                    <span class="menu-arrow"></span>
                </a>
                <ul class="side-nav-second-level" aria-expanded="false">
                    <li>
                        <a href="/page.jsp">No Params</a>
                    </li>
                    <li>
                        <a href="/page.jsp?param=123">With Params</a>
                    </li>
                </ul>
            </li>
</ul>

host:port/page.jsp shows No Params Highlighted
host:port/page.jsp?param=123 shows No Params Highlighted

If I don't include an li element without parameters e.g

<ul class="metismenu">
            <li class="side-nav-item">
                <a href="javascript: void(0);" class="side-nav-link">
                    <i class="dripicons-view-apps"></i>
                    <span> Title </span>
                    <span class="menu-arrow"></span>
                </a>
                <ul class="side-nav-second-level" aria-expanded="false">
                    <li>
                        <a href="/page.jsp?param=123">With Params</a>
                    </li>
                </ul>
            </li>
</ul>

and I try to navigate to host:port/page.jsp?param=123, it ignores the li completely and will not highlight any element

@walkthelot
Copy link

Same issue here (as original post). Dangit man :(. Let's hope I figure out a hack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants