Source button "add a data attribute"

Hello everyone, little question,
how can I add a data attribute in a Source button?
In ButtonPlus2 just check the “Add a data attribute?” and it works perfectly, in Source I don’t understand how to do it …
Thanks for the replies.

I needed it to activate Side Menu (https://onelittledesigner.com/rapidweaver/kb/side-menu/),
with code:

/ Open my menu /
opens.

In Source I would like to understand how.

You can add a data attribute to any Source link/button just by adding in the required values into the Custom Attributes fields of the RW url window.

Unfortunately it doesn’t work, both in the Source button and in ButtonPlus2.

To work in BP2 I have to activate the box and it works.

I would like to put a Source button.

Thanks, but I would like to put a Source button.

I presume you just need to change the ‘unique menu ID’ part of that to the actual ID of your menu?

I would just like to activate the Side Menu as per tutorial in the part:

As a really cool bonus feature, you can use ANY clickable html element to open up your Side Menu, using a special data-id attribute.
The data-id attribute using your menus Unique Menu ID and is formatted like so

In BP2 clicking the box and entering “data-id” works.

This is the template that you need to use:

data-id="side_menu_UNIQUE_MENU_ID"

I presume the stack lets you add an ID e.g. myMenu1. therefore the following should be all that you need:

image

There used to be an issue with this not working - it was a RW / Stacks thing if I recall correctly.

I am not sure if this was resolved.

There was but that’s been fixed for a long time.

All the Source buttons / links let you add attributes in this way. The image above leads to this code:

image

That should trigger the stack as far as I can make out.

1 Like

Excuse me, I cannot make myself understood, I have published this page now:
https://gianluca.online/Prove/
As you can see BP2 (by ticking the box)

it works.

unfortunately Button Sorce, even by entering data-id in the link,


does not work.

Excuse my language (google translator).

OK - this might sound a bit random but can you try this:

image

2 Likes

https://gianluca.online/Prove/

Thanks, it works perfectly now.
You are great guys.
Thanks again.

1 Like

Thanks everyone has.

1 Like

Good news! I’ll update the stack shortly so that manually adding the <span> tags isn’t required.

1 Like

v. 2.0.2 → GREAT job, thanks.

2 Likes