Skip to content

Commit 189165c

Browse files
committed
update docs
1 parent 31bdf6b commit 189165c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

docs/fe-content.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,15 @@ $blogPosts = inspirecms_content()->getByDocumentType(documentType: 'blog_post',
3737
$blogPosts = inspirecms_content()->getPaginatedByDocumentType(documentType: 'blog_post', isPublished: true, page: 1, perPage: 10);
3838
```
3939

40+
> [!note]
41+
>
42+
> These functions return Content model instances. To access content properties and use them in templates, convert the model to a DTO using the `toDto()` method:
43+
>
44+
> ```php
45+
> $contentDto = $content->toDto($locale ?? app()->getLocale());
46+
> $title = $contentDto->getTitle();
47+
> ```
48+
4049
---
4150
4251
## Accessing Content Properties

0 commit comments

Comments
 (0)