Skip to content

Commit bb43ca6

Browse files
committed
MAGETWO-89168: Develop UI component
1 parent 1c7cdf2 commit bb43ca6

File tree

3 files changed

+43
-16
lines changed

3 files changed

+43
-16
lines changed

app/code/Magento/Cms/view/adminhtml/ui_component/cms_page_form.xml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
</checkbox>
8484
</formElements>
8585
</field>
86-
<field name="title" sortOrder="20" formElement="input">
86+
<urlInput name="title" sortOrder="20">
8787
<argument name="data" xsi:type="array">
8888
<item name="config" xsi:type="array">
8989
<item name="source" xsi:type="string">page</item>
@@ -93,11 +93,24 @@
9393
<validation>
9494
<rule name="required-entry" xsi:type="boolean">true</rule>
9595
</validation>
96+
<isDisplayAdditionalSettings>true</isDisplayAdditionalSettings>
97+
<settingLabel translate="true">Label bla bla</settingLabel>
9698
<dataType>text</dataType>
9799
<label translate="true">Page Title</label>
98100
<dataScope>title</dataScope>
101+
<urlTypes class="Magento\Ui\Model\UrlInput\LinksProvider"/>
99102
</settings>
100-
</field>
103+
<!--<formElements>-->
104+
<!--<select>-->
105+
<!--<settings>-->
106+
<!--<options>-->
107+
<!--<option name="url" xsi:type="string">Url</option>-->
108+
<!--</options>-->
109+
<!--<caption translate="true">&#45;&#45; Please Select &#45;&#45;</caption>-->
110+
<!--</settings>-->
111+
<!--</select>-->
112+
<!--</formElements>-->
113+
</urlInput>
101114
</fieldset>
102115
<fieldset name="content" sortOrder="10">
103116
<settings>

app/code/Magento/Ui/view/base/web/templates/form/element/url-input.html

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,28 @@
55
*/
66
-->
77
<!--render select with link types-->
8-
<div class="admin__field"
8+
<div class="admin__field url-input-container"
99
visible="visible"
1010
attr="'data-index': index">
1111
<label class="admin__field-label" if="$data.label" visible="$data.labelVisible" attr="for: uid">
1212
<span translate="label" attr="'data-config-scope': $data.scopeLabel"/>
1313
</label>
1414
<div class="admin__field-control url-input-element"
1515
css="'_with-tooltip': $data.tooltip, '_with-reset': $data.showFallbackReset && $data.isDifferedFromDefault">
16-
<!--render link types select-->
17-
<render args="typeSelectorTemplate"/>
1816

19-
<!--display field to insert link value based on link type-->
20-
<div ko-scope="getLinkedElementName()" class="url-input-element-linked-element">
21-
<render/>
22-
<label class="admin__field-error" if="error" attr="for: uid" text="error"/>
17+
<div>
18+
<!--render link types select-->
19+
<render args="typeSelectorTemplate"/>
20+
21+
<!--display field to insert link value based on link type-->
22+
<div ko-scope="getLinkedElementName()" class="url-input-element-linked-element">
23+
<render/>
24+
<label class="admin__field-error" if="error" attr="for: uid" text="error"/>
25+
</div>
2326
</div>
2427

2528
<!--display container to specify url options(Example: open in new tab)-->
2629
<render if="isDisplayAdditionalSettings" args="settingTemplate"/>
27-
30+
<div/>
2831
</div>
2932
</div>

app/design/adminhtml/Magento/backend/web/css/source/components/_url_input.less

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,28 @@
66
//
77
// Components -> Url Input
88
// _____________________________________________
9+
.url-input-container .url-input-element {
10+
& > div:after {
11+
clear: both;
12+
}
913

10-
.url-input-element {
1114
.url-input-select {
12-
display: inline-block;
15+
float: left;
16+
margin-right: 20px;
1317
}
1418

15-
.url-input-element-linked-element {
16-
display: inline-block;
17-
+ label {
18-
display: inline-block;
19+
.url-input-setting {
20+
clear: both;
21+
display: block;
22+
&:before {
23+
content: "";
24+
clear: both;
1925
}
2026
}
27+
28+
.url-input-element-linked-element {
29+
float: left;
30+
}
2131
}
2232

33+

0 commit comments

Comments
 (0)