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
1.**Browser Request**: User navigates to `/about-us`
@@ -188,17 +206,8 @@ The application is configured through the `appsettings.json` file:
188
206
189
207
The `proxy` section configures the proxy feature, which forwards specific requests to dotCMS or other target servers. This is particularly useful for handling assets, images, and other resources that need to be served directly from dotCMS.
190
208
191
-
Each proxy configuration has the following properties:
192
-
-`enabled`: Boolean to enable/disable the proxy
193
-
-`path`: The URI pattern to match (supports wildcards with *)
194
-
-`target`: The target server URL to proxy to
195
-
196
209
For more details, see [Proxy Documentation](docs/Proxy.md).
197
210
198
-
You can authenticate using either:
199
-
- An API token (preferred for production)
200
-
- Username and password
201
-
202
211
## Architecture Benefits
203
212
204
213
This MVC + Razor approach provides several advantages:
@@ -210,76 +219,11 @@ This MVC + Razor approach provides several advantages:
210
219
5.**Flexibility**: Easy to customize rendering for different content types
211
220
6.**Maintainability**: Standard .NET patterns make the code easy to understand
212
221
213
-
## Key Components
214
-
215
-
-**DotCmsService**: Service for interacting with the dotCMS API. This includes methods to call dotCMS APIs and the dotCMS graphQL endpoint.
216
-
-**DotCmsUVEController**: Controller for handling dotCMS page requests
217
-
-**ProxyActionFilter**: Action filter that proxies requests to dotCMS or other target servers based on configured paths
218
-
-**ContentletTagHelper**: Renders contentlets based on their content type
The DotCmsUVEController acts as a catchall/proxy for dotCMS pages. When a request is made to any path, the `DotCmsUVEController` will:
225
-
226
-
1. Forward the uri to the dotCMS Page API to get the Page response, which includes all data regarding the template, layout, content blocks and content and which can be used to composit a page.
227
-
2. Parse the response into the appropriate models
228
-
3. Render the page using the Razor view
229
-
4. Caches the PageAPI response for up to 1 minute for performance.
230
-
231
-
### TagHelpers
232
-
233
-
The SDK includes custom TagHelpers to simplify common UI components:
234
-
235
-
236
-
#### ContentletTagHelper
237
-
This tag helper accepts a dotCMS contentlet object and passes the content data to a view for appropiate rendering and inclusion on a page. It accepts a Contentlet and based upon that Contentlet's content type, will look for an appropiate `View` file under the `/Views/ContentTypes` to use to render the content.
238
-
239
-
Things that could be improved - perhaps the ContentletTagHelper should also take the
240
-
241
-
#### HeaderTagHelper and FooterTagHelper
242
-
243
-
These TagHelpers provide reusable header and footer components that can be conditionally displayed. The default content is defined in partial views:
- Conditional rendering based on the `show` attribute
271
-
- Default content loaded from partial views
272
-
- Support for custom content when provided between tags
273
-
- Customizable through attributes (`title` for header, `copyright` for footer)
274
-
275
-
See `Views/Shared/_TagHelperExamples.cshtml` for more detailed examples.
276
-
277
-
278
222
## TODOs
279
-
This is a WIP and there is still a lot to do for this example to be complete. These include:
280
223
224
+
This is a WIP and there is still a lot to do for this example to be complete. These include:
281
225
282
-
- Transform dotCMS Graphql Page API response so that it renders like the PageAPI does.
226
+
- Transform dotCMS Graphql Page API response so that it renders like the PageAPI does
283
227
- Add the required `data-attr` for UVE and containers, content
284
228
- Add include the uve-editor.js to "activate" uve when rendered in dotCMS
285
-
- Make content type components "container" aware - meaning look for the content type `View` under `/Views/ContentTypes/{containerName}/{ContentType}.cshtml` and then fall back to `/Views/ContentTypes/{ContentType}.cshtml` if a container specific view is not available.
229
+
- Make content type components "container" aware - meaning look for the content type `View` under `/Views/ContentTypes/{containerName}/{ContentType}.cshtml` and then fall back to `/Views/ContentTypes/{ContentType}.cshtml` if a container specific view is not available
0 commit comments