Dmx-prefix

Dear Wappler-Community,

I tried to actually create an extension for my app components, to be able to integrate trustcaptcha.
The only problem: It won't work, if I don't use the "dmx"-prefix.
Does that now literally mean I can forget about trying to somehow create an extension which allows me to integrate trustcaptcha myself into the UI of Wappler?
I want to create the template:
<trustcaptcha-component></trustcaptcha-component>.
This will obviously create the element but it won't show up in the APP-Connect menu and it will also not allow me to use the properties I defined beforehand.

Best regards

What's the problem with adding dmx as part of the extension?

1 Like

I guess I would need to change something then in the front-end javascript from trustcaptcha itself.

This is the only solution that comes to my mind right now.

Are you using npm to install the required packages for trustcaptcha into the custom extension?

1 Like

Yes. They are already installed.
The required packages for nodesjs are not the problem here though.
What I am trying to solve right now is the front-end.

Where one only has to insert the custom script they (trustcaptcha) created with the
<script></script> element.

After that it is possible to just write
<trustcaptcha-component></trustcaptcha-component> into the HTML-Page and the captcha test is created automatically and visualised on the page.

When you create a custom app connect extension you have two main files (components.hjson and a js file). Between those two files you can create css and js files to include on the Wappler page when you add the custom component. The dmx is necessary, but isn't related to the js and css files that you can include as part of the extension.

1 Like

Thanks for the information :slight_smile: !

I guess I will only change the "trustcaptcha-component" to "dmx-trustcaptcha-component" in the js file which is from trustcaptcha itself.

The hjson is where you define the details for the custom component.

1 Like

Yes. I know.

I did the following:

  1. In the hjson I've set the type to: type: 'dmx-trustcaptcha-component'
  2. Then I also set the template to: template: '<trustcaptcha-component id="@@id@@"></trustcaptcha-component>'. Because the JavaScript from Trustcaptcha trustcaptcha.js allows one to create this custom component already in the front end. My goal was it to insert the '<trustcaptcha-component id="@@id@@"></trustcaptcha-component>' now per App component.
    But always, when I tried to insert it per App-connect, it shows up for exactly one second and then disappears from the app-connect menu.

It is succesfully being inserted into the DOM but I cannot use the properties on it I defined beforehand in the HJSON.

I obviously cannot do '<dmx-trustcaptcha-component id="@@id@@"></dmx-trustcaptcha-component>', becaue then, the element cannot be generated. The JavaScript from Trustcaptcha has it written that way, that only '<trustcaptcha-component id="@@id@@"></trustcaptcha-component>' generates the captcha test in the front end.

That's why my only solution right now is to download the javascript from trustcaptcha and change the trustcaptcha-component to dmx-trustcaptcha-component so I can be able to also modify the properties of this element through the APP-Connect menu.

I think you may need to figure out how to create your own custom component and not use the component provided by trustcaptcha.

1 Like

Yeah. I think so too :frowning: .