2 @template core/url_select
4 Example context (json):
6 "id": "url_select_test",
7 "action": "https://example.com/post",
8 "formid": "url_select_form",
10 "label": "core/url_select",
12 "title": "Help with something",
13 "text": "Help with something",
14 "url": "http://example.org/help",
17 "extraclasses": "iconhelp",
19 {"name": "src", "value": "../../../pix/help.svg"},
20 {"name": "alt", "value": "Help icon"}
26 "name": "Group 1", "isgroup": true, "options":
28 {"name": "Item 1", "isgroup": false, "value": "1"},
29 {"name": "Item 2", "isgroup": false, "value": "2"}
31 {"name": "Group 2", "isgroup": true, "options":
33 {"name": "Item 3", "isgroup": false, "value": "3"},
34 {"name": "Item 4", "isgroup": false, "value": "4"}
37 "title": "Some cool title"
40 <div class="{{classes}}">
41 <form method="post" action="{{action}}" class="form-inline" id="{{formid}}">
42 <input type="hidden" name="sesskey" value="{{sesskey}}">
44 <label for="{{id}}"{{#labelattributes}} {{name}}="{{value}}"{{/labelattributes}}>
51 <select {{#attributes}}{{name}}="{{value}}" {{/attributes}} id="{{id}}" class="custom-select {{classes}}" name="jump"
52 {{#title}}title="{{.}}"{{/title}} {{#disabled}}disabled{{/disabled}}>
55 <optgroup label="{{name}}">
57 <option value="{{value}}" {{#selected}}selected{{/selected}}>{{{name}}}</option>
62 <option value="{{value}}" {{#selected}}selected{{/selected}}>{{{name}}}</option>
67 <input type="submit" class="btn btn-secondary" value="{{showbutton}}">
71 <input type="submit" class="btn btn-secondary" value="{{#str}}go, core{{/str}}">
78 require(['jquery'], function($) {
79 $('#{{id}}').change(function() {
83 $('#{{formid}}').submit();