Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 1 addition & 50 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,50 +1 @@
# HTMLSnippet

This widget is useful to add a piece of HTML or JavaScript to a form. For example to embed a YouTube or Flash object. Furthermore it can be used to enhance styling by adding arbitrary HTML elements.

## Contributing

For more information on contributing to this repository visit [Contributing to a GitHub repository](https://docs.mendix.com/howto/collaboration-requirements-management/contribute-to-a-github-repository)!

## Typical usage scenario

- Display a predefined HTML document
- Load a Java Applet
- Manipulate the styling using JavaScript rather than theming.

## Features and limitations

- Embed raw HTML
- Embed raw JavaScript
- Load external HTML / JS file

## Dependencies

- Mendix 5.x environment

## Properties

- **Content Type [ HTML, JavaScript, JavaScript with jQuery ] :**
Select how the snippet should be rendered. The JavaScript with jQuery option will make sure that your code can leverage [jQuery v3.3.1](https://blog.jquery.com/2018/01/20/jquery-3-3-1-fixed-dependencies-in-release-tag/) for example:

```js
//e.g. this code snippet will set the color of all your paragraph tags on the page to red.
$('p').css('color', 'red')
// or
jQuery('p').css('color', 'red')
```

- **Contents :**
The HTML or Javascript to embed.
- **External File :**
The path to the HTML or JavaScript file you want to add. The root is the theme folder. Will override the Contents section if used. With the newly added "/p/" native deeplinks, you may want to start your file path with a "/" to prevent any 404s caused by this deeplink.
- **On click microflow :**
The microflow which should be executed on click. This can be used to, for example, show a page when the snippet is being clicked.
- **Documentation :**
Documentation of this widget. Should explain its purpose.
- **Refresh on context change:**
Refresh when the context changes
- **Refresh on context update:**
Refresh when the context updates (works only when context change is true)
- **Enclose HTML with DIV:**
When adding HTML, the widget will wrap it with a DIV. If this is set to false, it will just replace the content of the widget. (For compatibility purposes this is set true on default)
Please see [HTML/JavaScript Snippet](https://docs.mendix.com/appstore/widgets/html-javascript-snippet) in the Mendix documentation for details.