Hi John, thanks for response. Please see screen attached.
The way I am writing this out at the moment is by using @Html.Raw(CurrentPage.contentCards)
This writes out the HTML and it looks ok. However, how can I access each content card individually. I am not sure whether to use CurrentPage or Model.
If I could do that I could order them in the way you suggested. At the moment @Html.Raw(CurrentPage.contentCards) return the html, so it is not straightforward to order. By the way the ContentCard in the image is a macro container that contains multiple macros that take some parameters and a template for it.
Thanks for any advice!
If you reorder in the backend does it now translate in to how the html renders? Are you using a custom package for the document type as I'm not familiar with view in your screenshot?
I'm not sure my initial comment has any relevance sorry. I wasn't sure what you meant.
Yea if I reorder the items in the back office it does reorder the html rendered. But I want it to be ordered the opposite way by default.
I am not using a custom package. For that list I created my own Data Type macro container, which holds by macro I created, which is a macro that takes some parameters and some simple html template. Not sure if this is the best way to do it but it seems neater than not using a macro container.
Changing order or items added to a macro container
Hi,
I am adding multiple content block to page.
By default when you add a new one, it is added below the previous ones.
Is it possible to default the position so that the new one added is at the top of this list?
I want to display them on the page newest first?
Any ideas how this can be done?
Thanks,
Hi Damon,
Do you have a screenshot to help with understanding what you mean?
I believe you looking for something like .OrderBy("CreateDate desc") on the foreach
Hi John, thanks for response. Please see screen attached.
The way I am writing this out at the moment is by using @Html.Raw(CurrentPage.contentCards)
This writes out the HTML and it looks ok. However, how can I access each content card individually. I am not sure whether to use CurrentPage or Model.
If I could do that I could order them in the way you suggested. At the moment @Html.Raw(CurrentPage.contentCards) return the html, so it is not straightforward to order. By the way the ContentCard in the image is a macro container that contains multiple macros that take some parameters and a template for it. Thanks for any advice!
John,
where is the documentation for these methods? Such as ("CreateDate desc") - how do you know what to use here?
If you reorder in the backend does it now translate in to how the html renders? Are you using a custom package for the document type as I'm not familiar with view in your screenshot?
I'm not sure my initial comment has any relevance sorry. I wasn't sure what you meant.
Yea if I reorder the items in the back office it does reorder the html rendered. But I want it to be ordered the opposite way by default.
I am not using a custom package. For that list I created my own Data Type macro container, which holds by macro I created, which is a macro that takes some parameters and some simple html template. Not sure if this is the best way to do it but it seems neater than not using a macro container.
Why, is there a package to allow custom ordering?
Thanks,
is working on a reply...