• Resolved qrusnell

    (@qrusnell)


    I’m trying to setup a different [toc] shortcode for desktop and mobile position and behavior. But it appears that only the first-most in the HTML structure takes on the shortcode. Is that normal behavior for this plugin? Is there a way to enable all instances of the shortcode on the same page?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support Prabhat

    (@prabhatrai)

    Hi @qrusnell,

    Thanks for reaching out!

    I’m Prabhat from the All in One SEO team. We’ve recently adopted the Table of Content Plus plugin after the original owner indicated he no longer had the bandwidth to maintain it.

    Unfortunately, TOC+ renders the TOC (short code) just once on a page. This is also a widely accepted practice.

    However, could you share the URL where you’ve added the TOC and explain what exactly you want to achieve differently in Desktop vs Mobile version, as we might be able to help you with that?

    I’m looking forward to hearing back from you.

    Thanks!

    Plugin Support Steve M

    (@wpsmort)

    Hi @qrusnell,

    We haven’t heard back from you in a couple of weeks. I’m going to go ahead and close this thread for now. But if you’d like us to assist, please feel welcome to continue the conversation.

    Thanks!

    Thread Starter qrusnell

    (@qrusnell)

    Sorry for the delayed response. I missed your OG response notification over the holidays. I don’t have a public page available to demonstrate what I’m trying to do yet. Basically, I have the TOC positioned in a sidebar on blog posts for desktop, then I reposition it to a sticky expandable accordion style element floating in header area. To do that, I’m using 2 instances with media queries for responsiveness. I suppose it is possible to use 1 instance with enough CSS to reformat and reposition it (although the accordion and sticky functionality I want do require JS), but my work-around solution for now (in a private dev environment) is to use JS to copy the content of the first instance into my second one. This seems simplest for now given the single instance limitation on the TOC shortcode.

    Plugin Support Prabhat

    (@prabhatrai)

    Hey @qrusnell,

    Thanks for your response!

    I’ve created an internal feature request for this. Unfortunately, we don’t have a timeline for an update, but I’ll ensure to notify you as soon as we have one.

    Meanwhile, you can continue using your approach. Alternatively, could you confirm which SEO plugin you’re using? All in One SEO comes with an inbuilt TOC block that you can use on the page content along with your existing TOC Plus block in the Sidebar.

    You can read more about this here –

    https://aioseo.com/docs/adding-a-table-of-contents-to-your-site-using-all-in-one-seo/

    Please feel free to let me know if you have any questions.

    Thanks!

    I came to think about using the plugin with name Shortcoder. You could create with it wrappers for the TOC shortcode. I have not tested this.

    Plugin Support Prabhat

    (@prabhatrai)

    Hi @juhametsakallas!

    Could you please describe your message so I can assist you better? What do you mean by “wrappers for the TOC shortcode“?

    I’m looking forward to helping you.

    Thanks.

    @prabhatrai

    Hello!

    I do not need any help, thank you anyway. I was merely trying to help @qrusnell by suggesting an alternative way to have multiple instances of a shortcode on a page.

    There is a plugin called Shortcoder by which you can easily create custom shortcodes. I have not tested this, but the following solution should work.

    Create two shortcodes with Shortcoder and put as content some javascript to detect desktop resp. mobile browser followed by a call to [toc] with suitable parameters. Now put both these two shortcodes onto a page and voilà, they both are run.

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.