You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Contentstack Utils SDK lets you interact with the Content Delivery APIs and retrieve embedded items from the RTE field of an entry.
127
137
128
138
### Fetch Embedded Item(s) from a Single Entry
139
+
#### Render HTML RTE Embedded object
140
+
To get an embedded items of a single entry, you need to provide the stack API key, environment name, delivery token, content type and entry UID. Then, use the `ContentstackUtils.render` functions as shown below:
141
+
```swift
142
+
import ContentstackUtils
143
+
144
+
let stack:Stack = Contentstack.stack(apiKey: API_KEY, deliveryToken: DELIVERY_TOKEN, environment: ENVIRONMENT)
129
145
130
-
To get an embedded items of a single entry, you need to provide the stack API key, environment name, delivery token, content type and entry UID. Then, use the Contentstack.Utils.render functions as shown below:
146
+
stack.contentType(uid: contentTypeUID)
147
+
.entry(uid: entryUID)
148
+
.include(.embeddedItems)
149
+
.fetch { (result: Result<EntryModel, Error>, response: ResponseType) in
To get a single entry, you need to provide the stack API key, environment name, delivery token, content type and entry UID. Then, use `ContentstackUtils.jsonToHtml`functionas shown below:
161
+
```swift
162
+
import ContentstackUtils
133
163
134
164
let stack:Stack = Contentstack.stack(apiKey: API_KEY, deliveryToken: DELIVERY_TOKEN, environment: ENVIRONMENT)
> Node: Supercharged RTE also supports Embedded items to get all embedded items while fetching entry use `includeEmbeddedItems` function.
179
+
148
180
### Fetch Embedded Item(s) from Multiple Entries
149
-
To get embedded items from multiple entries, you need to provide the stack API key, environment name, delivery token, and content type UID. Then, use the Contentstack.Utils.render functions as shown below:
181
+
#### Render HTML RTE Embedded object
182
+
To get embedded items from multiple entries, you need to provide the stack API key, environment name, delivery token, and content type UID. Then, use the `ContentstackUtils.render` functions as shown below:
To get a Multiple entry, you need to provide the stack API key, environment name, delivery token, and content type UID. Then, use `Contentstack.Utils.jsonToHtml`functionas shown below:
208
+
```swift
209
+
import ContentstackUtils
210
+
211
+
let stack:Stack = Contentstack.stack(apiKey: API_KEY, deliveryToken: DELIVERY_TOKEN, environment: ENVIRONMENT)
212
+
213
+
stack.contentType(uid: contentTypeUID)
214
+
.entry()
215
+
.query()
216
+
.include(.embeddedItems)
217
+
.find { (result: Result<EntryModel, Error>, response: ResponseType) in
0 commit comments