• Resolved goingonline

    (@goingonline)


    Hi,

    I’m trying to get the nested expand elements to work. But when i try the example code (see code below), the nesting doesn’t work.

    This is the code i’m using:
    [expand title=”Root Level”]
    [expandsub1?title=”Nested Level 1″]
    [expandsub2?title=”Nested Level 2″]
    [expandsub3?title=”Nested Level 3″]
    [expandsub4?title=”Nested Level 4″]
    [expandsub5?title=”Nested Level 5″]
    [expandsub6?title=”Nested Level 6″]
    [expandsub7?title=”Nested Level 7″]
    [/expandsub7]
    [/expandsub6]
    [/expandsub5]
    [/expandsub4]
    [/expandsub3]
    [/expandsub2]
    [/expandsub1]
    [/expand]

    This is how it looks:
    https://test.goingonline.nl/test/

    Am i’m doing something wrong here?

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author twinpictures

    (@twinpictures)

    Am i’m doing something wrong here?

    yup. the documentation is a bit confusing, we’ll fix that. It really works more like:

    [expand title="Root Level"]
        [expandsub1 title="Nested Level 1"] [/expand]
        [expandsub1 title=”Nested Level 2"] [/expand]
        [expandsub1 title=”Nested Level 3"]
            [expandsub2 title=”Nested Level 3.1"] [/expand]
        [/expand]
    [/expand]

    Does that help?

    Thread Starter goingonline

    (@goingonline)

    Thanks for the quick reply!

    I see now how the code should work, your code makes a lot more sense than mine ?? Unfortunately, when i use your code, this is the result: https://test.goingonline.nl/test/

    Without the sub elements the shortcode works great though.

    I’m using a clean WordPress 4.8.1 install.

    Plugin Author twinpictures

    (@twinpictures)

    ah, ok, this is an easy fix.
    1. change the default tag from span to div in the plugins settings under:
    Dashboard > Settings > Collapse-O-Matic

    Next: be sure you do not have any extra html elements by switching to the ‘text’ mode in the editor rather than the default ‘visual’ mode. As a rule, if you paste shortcodes into the editor always use text mode. Visual mode will keep all the bloated html formating that tends to mess things up.

    Give that a try and let us know if it resolves your issue, or if you need a bit more assistance.

    Thread Starter goingonline

    (@goingonline)

    Thank you aggain.

    I don’t get it. I’m sure it’s me (sorry for that), but i can’t get it to work.

    This is the code i’m using now:

    [expand title="Root Level"]
    [expandsub1 title="Nested Level 1"] <p>Test</p> [/expand]
    [expandsub1 title=”Nested Level 2"] <p>Test</p> [/expand]
    [/expand]

    Result is this: https://test.goingonline.nl/test-2

    The settings in Collapse-O-Matic are (only the Tag attribute i have changed, the rest is default):
    Tag Attribute: div
    Targtag Attribute: span
    Collapse/Expand Duration: fast
    And all other settings are empty or unchecked.

    Now i tried this codes as well, all of these codes give different results (even a extra white space gives another result sometime):

    [expand title="Root Level"]
    [expandsub1 title="Nested Level 1"] <span>Test</span> [/expand]
    [expandsub1 title=”Nested Level 2"] <span>Test</span> [/expand]
    [/expand]
    [expand title="Root Level"]
    [expandsub1 title="Nested Level 1"] Test [/expand]
    [expandsub1 title=”Nested Level 2"] Test [/expand]
    [/expand]
    [expand title="Root Level"]
    [expandsub1 title="Nested Level 1"] 
    Test 
    [/expand]
    [expandsub1 title=”Nested Level 2"] 
    Test 
    [/expand]
    [/expand]

    I’m sorry to bother you with this.

    Plugin Author twinpictures

    (@twinpictures)

    oops! there was a mistake: you need to close the expandsub tags with a expandsub tag:

    [expand title="Root Level"]
        [expandsub1 title="Nested Level 1"] [/expandsub1]
        [expandsub1 title=”Nested Level 2"] [/expandsub1]
        [expandsub1 title=”Nested Level 3"]
            [expandsub2 title=”Nested Level 3.1"] [/expandsub2]
        [/expandsub1]
    [/expand]

    Also, you will want both the Tag Attribute and the Targtag Attribute to be: div
    That should do it. let us know and sorry for the confusion, was a looong day yesterday.

    • This reply was modified 7 years, 5 months ago by twinpictures.
    Thread Starter goingonline

    (@goingonline)

    Your help is very much appreciated and it works great now! Thank you so much.

    One thing, i had to replace the double quotes to single quotes for the titles. Otherwise the titles didn’t show up correctly.

    [expandsub2 title='Nested Level 2']

    Thank you so much for your help.

    • This reply was modified 7 years, 5 months ago by goingonline.
    Plugin Author twinpictures

    (@twinpictures)

    The quote issue is most likely due to using the Visual tab in the editor. This will convert normal quotes to curly-quotes.
    Regardless, you got it working, HUZZAH!
    Issue marked as resolved.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Nested Expand Elements not working’ is closed to new replies.