Skip to content

Commit b60561c

Browse files
authored
Update graniteui-components.md (#18)
1 parent 8a8250f commit b60561c

File tree

2 files changed

+102
-3
lines changed

2 files changed

+102
-3
lines changed

src/main/webapp/app-root/components/granite/form/mediaLinkFileUpload/mediaLinkFileUpload.jsp

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ are overwritten or added.
5555
5656
/**
5757
* The path of the root of the pathfield. If not set, it's value is set automatically
58-
* to the root path for internal link type as returned by the current context's Link Handler configuration.
58+
* to the root path for media link type as returned by the current context's Link Handler configuration.
5959
*/
6060
- rootPath (StringEL) = {link type-dependent root path}
6161

src/site/markdown/graniteui-components.md

+101-2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,34 @@ The link source input will be dynamically shown/hidden according to the link typ
3232

3333
`http://localhost:4502/libs/granite/ui/content/dumplibs.rebuild.html`
3434

35+
Properties:
36+
- `showLinkTitle` (boolean), default: `false`\
37+
Show text field with link title.
38+
- `linkTypes` (String[])\
39+
Filter link types allowed in the dialog.
40+
Only link types allowed in the link handler configuration are possible.
41+
Set this property when not all configured link types should be displayed, but only those also
42+
contained in this list.
43+
- `namePrefix` (String) default: "./"\
44+
Prefix for all property names in the link reference dialog.
45+
Use this to store the link properties in another child resource e.g. to "./mySubNode/".
46+
- `internalLinkFields` (Resources)\
47+
Additional Granite UI components to be displayed for "internal" link type.
48+
- `internalCrossContextLinkFields` (Resources)\
49+
Additional Granite UI components to be displayed for "internalCrossContext" link type.
50+
- `externalLinkFields` (Resources)\
51+
Additional Granite UI components to be displayed for "external" link type.
52+
- `mediaLinkFields` (Resources)\
53+
Additional Granite UI components to be displayed for "media" link type.
54+
- `allLinkTypeFields` (Resources)\
55+
Additional Granite UI components to be displayed for all link types.
56+
- `required` (Boolean), default: `false`\
57+
It is required to select any link target and a link title (if a link title field is shown).
58+
- `requiredLink` (Boolean), default: `false`\
59+
It is required to select any link target.
60+
- `requiredTitle` (Boolean), default: `false`\
61+
If showLinkTitle is set to true, it is set to required.
62+
3563
### Internal Link Type Path Field
3664

3765
This is a customized Path Field that always sets the root path to the link root path as defined by the Link Handler configuration for internal links. By default, this is the site root path as defined by the URL Handler configuration.
@@ -48,6 +76,17 @@ This component extends the [wcm.io Granite UI components Path Field][wcmio-wcm-u
4876
* Dynamically sets `rootPath` to the link root path as returned by the Link Handler configuration
4977
* Dynamically sets `name` to the default property name for internal links
5078

79+
Properties:
80+
- `name` (String), default: "./linkContentRef"\
81+
Property name for internal link reference.
82+
- `rootPath` (String)\
83+
The root path for the pathfield. If not set, it's value is set automatically
84+
to the root path for internal link type as returned by the current context's Link Handler configuration.
85+
- `fallbackRootPath` (String), default: "/content"\
86+
The root path that is used as fallback when no root path could be detected dynamically,
87+
e.g. because outside any site or within experience fragments.
88+
- `appendPath` (String)\
89+
Appendix path added to the (usually auto-detected) root path.
5190

5291
### Internal Link Cross Context Type Path Field
5392

@@ -65,6 +104,17 @@ This component extends the [wcm.io Granite UI components Path Field][wcmio-wcm-u
65104
* Dynamically sets `rootPath` to the link root path as returned by the Link Handler configuration
66105
* Dynamically sets `name` to the default property name for internal cross-context links
67106

107+
Properties:
108+
- `name` (String), default: "./linkCrossContextContentRef"\
109+
Property name for internal cross-context link reference.
110+
- `rootPath` (String)\
111+
The root path for the pathfield. If not set, it's value is set automatically
112+
to the root path for internal cross-context link type as returned by the current context's Link Handler configuration.
113+
- `fallbackRootPath` (String), default: "/content"\
114+
The root path that is used as fallback when no root path could be detected dynamically,
115+
e.g. because outside any site or within experience fragments.
116+
- `appendPath` (String)\
117+
Appendix path added to the (usually auto-detected) root path.
68118

69119
### Media Link Type Path Field
70120

@@ -83,6 +133,55 @@ This component extends the [Media Handler-aware Path Field][wcmio-handler-media-
83133
* Dynamically sets `name` to the default property name for media links
84134
* Dynamically sets `mediaFormats` to a list of all media formats with "download" flag
85135

136+
Properties:
137+
- `name` (String), default: "./linkMediaRef"\
138+
Property name for media link reference.
139+
- `rootPath` (String)\
140+
The root path for the pathfield. If not set, it's value is set automatically
141+
to the root path for media link type as returned by the current context's Link Handler configuration.
142+
- `fallbackRootPath` (String), default: "/content/dam"\
143+
The root path that is used as fallback when no root path could be detected dynamically,
144+
e.g. because outside any site or within experience fragments.
145+
- `appendPath` (String)\
146+
Appendix path added to the (usually auto-detected) root path.
147+
- `mediaFormats` (String[])\
148+
List of media formats for assets that can be linked upon.
149+
If not set the property value is set to the list of all media formats with "download" flag.
150+
151+
### Media Link Type File Upload
152+
153+
This is a customized FileUpload field that always sets the root path to the media root path as defined by the Link Handler configuration for media links. By default, this is `/content/dam`.
154+
155+
```json-jcr
156+
"field": {
157+
"sling:resourceType": "wcm-io/handler/link/components/granite/form/mediaLinkFileUpload",
158+
"fieldLabel": "Asset reference"
159+
}
160+
```
161+
162+
This component extends the [Media Handler-aware FileUpload][wcmio-handler-media-fileupload]. Enhancements over this version:
163+
164+
* Dynamically sets `rootPath` to the media link root path as returned by the Link Handler configuration
165+
* Dynamically sets `name` to the default property name for media links
166+
* Dynamically sets `mediaFormats` to a list of all media formats with "download" flag
167+
86168

87-
[wcmio-handler-media-pathfield]: https://wcm.io/handler/media/graniteui-components.html#Media_Handler-aware_Path_Field
88-
[wcmio-wcm-ui-granite-pathfield]: https://wcm.io/wcm/ui/granite/components.html#Path_Field
169+
Properties:
170+
- `name` (String), default: "./linkMediaRef"\
171+
Property name for this link type.
172+
- `rootPath` (String)\
173+
The root path for the pathfield. If not set, it's value is set automatically
174+
to the root path for media link type as returned by the current context's Link Handler configuration.
175+
- `fallbackRootPath` (String), default: "/content/dam"\
176+
The root path that is used as fallback when no root path could be detected dynamically.
177+
- `appendPath` (String)\
178+
Appendix path added to the (usually auto-detected) root path.
179+
- `mediaFormats` (String[])\
180+
List of media format names for assets that can be linked upon.
181+
If not set, the property value is set to the list of all media formats with "download" flag.
182+
183+
Super component properties `mediaFormatsMandatory` and `mediaCropAuto` are overwritten and ignored.
184+
185+
[wcmio-handler-media-pathfield]: https://wcm.io/handler/media/graniteui-components.html#media_handler-aware_path_field
186+
[wcmio-handler-media-fileupload]: https://wcm.io/handler/media/graniteui-components.html#media_handler-aware_file_upload
187+
[wcmio-wcm-ui-granite-pathfield]: https://wcm.io/wcm/ui/granite/components.html#path_field

0 commit comments

Comments
 (0)