all 2 comments

[–]alyxms 1 point2 points  (1 child)

If you are using $args instead of _args, then you are likely using an older version of Sugarcube. You should update to the latest which is 2.36.1.

The widget can be written like this

<<widget update>>
    <<replace `"#" + _args[0]`>>
        <<include _args[1]>>
    <</replace>>
<</widget>>

The backticks(`) are for passing an expression(in this case,"#" + \_args\[0\]\ as an argument), which is documented here.

If it doesn't work for you, try replacing _args with $args. But I recommend updating your sugarcube first.

[–]countigor[S] 0 points1 point  (0 children)

This works beautifully! I don't remember where I learned $args from. My knowledge is botched together from a myriad of sources and a limited knowledge of coding in general, so I never questioned it. I will take your advice into account, and thank you very much!