• Resolved adam12b

    (@adam12b)


    I can’t imagine what I could be doing wrong, since it’s so simple to use, but linking to an element via an anchor matching its id tag is not working for me. I do get to the right location on the page, with the linked element shown right at the top of the browser, but the element is not expanded — it’s still collapsed. Any ideas?

    I’m doing it just like in the #kraftwerk example in the docs. For instance:

    [expand title="Can I receive daily digests instead of every message?" id="digest"]Yes -- see the <a href="/support/npogroups/subscribers#digest">NPOGroups Users Guide</a>[/expand]

    and then the link points to “https://coop.electricembers.net/support/faq/#digest&#8221; or faq#digest (no slash after faq), either one. WordPress and Collapse-O-Matic are totally up to date. (This site is in development, having weird problems with line-breaking too that I may have to return here for help with…).

    Thanks!

    https://www.ads-software.com/extend/plugins/jquery-collapse-o-matic/

Viewing 12 replies - 1 through 12 (of 12 total)
  • This worked for me … unless it’s a browser issue.

    I am having a very similar problem, the ID tag works, but only if it’s not on the same page as where the tag is going to.

    An example, on my site https://www.nationalanthems.info/wordpress, there is a footer on every single page talking about the Creative Commons license the site is under, the link at the very end under FAQ (“See our FAQ for details”) links to the FAQ which has a whole bunch of collapse-o-matic questions and answers, on every page but one when you click on that link, it takes you to the FAQ and the pertinent collapse-o-matic opens up, like it should. However, if you click that FAQ link in the footnote when you’re on the FAQ page, it just takes you to the relevant FAQ question, but it doesn’t expand it.

    So the problem is that if the ID tag is referencing something on the same page, but it should work because in the documentation, it’s referencing something on the same page …

    Thread Starter adam12b

    (@adam12b)

    Wow, thanks UaMV for the reality check. It’s not a browser issue, same thing in Firefox & IE, but the suggestion led me to try a cache-override reload, and boom, it works. I don’t understand it, but it seems I don’t need to worry about it, as new visitors won’t have any caching issue. Stupid of me not to try that to begin with — always clear the cache!

    Nice … gotta love the simple fixes!

    Hmmm, strange, I cleared my cache, and I’m still not having it expand for me.

    If one of you went to https://www.nationalanthems.info/wordpress/faq.html , and clicked on the “FAQ” at the very bottom (“See our <u>FAQ</u> for details”), does the relevant section expand? Because it does on every other page in https://www.nationalanthems.info/wordpress, but not when you’re on the FAQ!

    (I’ve tried this on Safari, Chrome, and Firefox, and I cleared the cache each time before I started.)

    Plugin Author Baden

    (@baden03)

    We’ll look into recreating this issue on our test server and get back to you with our findings. We appreciate you not loosing hope. Rest assured, we will get this sussed out for you.

    Thread Starter adam12b

    (@adam12b)

    Ah! I didn’t quite understand the cache-clearing solution, and now I see that what’s really happening for me is *exactly* the same as for dhkendall. If I open an id anchor while already on the page that contains it, it does not open (unless I do a cache-clear reload). If I open an anchor from a different page, it opens. So that’s what it is.

    In other words, if you load https://coop.electricembers.net/support/faq and then load https://coop.electricembers.net/support/faq/#digest, it will not open. It worked before because you went straight to the latter.

    Thread Starter adam12b

    (@adam12b)

    Howdy again. Sorry to bug, but no luck on this yet? We wait with bated breath.

    Thanks for all you do.

    adam

    Plugin Author Baden

    (@baden03)

    try adding class="expandanchor" to your links:

    [expand title="question 1" id="q1"]answer 1[/expand]
    [expand title="question 2" id="q2"]answer 2 also deals with <a class="expandanchor" href="#q1">question 1</a>[/expand]
    [expand title="question 3" id="q3"]answer 3 lso deals with <a class="expandanchor" href="https://spacedonkey.de/716/collapse-o-matic-id-tag-in-link/#q1">question 1</a>[/expand]

    Demo: https://spacedonkey.de/716/collapse-o-matic-id-tag-in-link

    Thanks, works for me now!

    With one small caveat, though, it only works if you’re referencing a collapseomatic on the same page (otherwise, just use it normally). This presented a bit of a problem for my footer text, as it’s the same on every page. So, as I mentioned before, the “FAQ” link on the footer when clicked on every page (but one), would go to the FAQ and display the collapsed text. However, as mentioned, when I’d click the footer link when I was already on the FAQ page, it would do nothing. Now, when I added that class to the footer link, the opposite was true, on the FAQ page, clicking it would take me to, and expand, the collapseomatic, but on any other page it woiudln’t even go to the FAQ.

    I worked around that by making a separate widget just for the FAQ page that replaced the default footer (which doesn’t have the “expandanchor” class) with a special one for the FAQ (which does have the “expandanchor” class), and all is good.

    So, problem solved for me (and I hope adam12b as well), and I hope the workaround helps others as well.

    It worked for me as well, but now it doesn’t jump to that section, so it looks like nothing happens when you click because the section with the links doesn’t fit in the window with the FAQ section. You can see the page here: https://elembee.com/work-with-me/. I only set the experience and design process links to have the expandanchor class —?the links in the packages don’t have the expandanchor class and jump to that section but don’t expand. Any thoughts?

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Element doesn't expand when id tag used in link’ is closed to new replies.