Creat custom document type to have image list with title and description
Hi we have a requirement in Umbraco to create a Image list with possible to
add title and description for each
image. What is the best apporaoch to achieve in the back office?
can we use archetype or is it easy to customize existing document type and
create a new one which consist of image upload, text box and text area.
Would be great if you provide some sample to create custom document type?
One approach (simple version) could be something like you mentioned that you create a new DocumentType for the image with a Upload field, title (textfield) and description (textarea). Then allow the template that you want to display the images to have children of the created type.
Then you could create as many images you like, under say a page, and in your view just display them like this (not tested, just a concept):
@foreach(var image in CurrentPage.Images){
<img src="@image.Upload"/>
<p>@image.Title</p>
<p>@image.Description</p>
}
Hello Raja, did this help you or do you have anymore questions? Did you try any off the examples i pasted? Let me know if this still is an issue for you so that i can try my best to help out.
I follwed yourway i got what i want to achieve ,but the thing is In my system I created templates, I am working with along team when committed the code In TFS or SVN. Some of Team Member can Updated this one but He got big problem ,
the Templates What i created its added in visualstudio MVC project,when run the project Its not Populated in the UmbracoDatatypes(i already integrated umbraco to my MVC Project) can u tel me how to fix this one Because total project completed in umbraco but one my college update this one the templates are not populated in umbraco.
Creat custom document type to have image list with title and description
Hi we have a requirement in Umbraco to create a Image list with possible to add title and description for each image. What is the best apporaoch to achieve in the back office? can we use archetype or is it easy to customize existing document type and create a new one which consist of image upload, text box and text area. Would be great if you provide some sample to create custom document type?
Hi Raja.
One approach (simple version) could be something like you mentioned that you create a new DocumentType for the image with a Upload field, title (textfield) and description (textarea). Then allow the template that you want to display the images to have children of the created type.
Then you could create as many images you like, under say a page, and in your view just display them like this (not tested, just a concept):
Another approach (bit more advanced but way cooler) is to use Archetype. https://our.umbraco.org/projects/backoffice-extensions/archetype/
In your archetype datatype, add a upload, text and textarea field
then in your content you can add as many images you´d like:
and in your view you iterate the images like this:
And the result:
Hope this helped you!
Hello Raja, did this help you or do you have anymore questions? Did you try any off the examples i pasted? Let me know if this still is an issue for you so that i can try my best to help out.
All the best / Dennis
Thank you Dennis.
I follwed yourway i got what i want to achieve ,but the thing is In my system I created templates, I am working with along team when committed the code In TFS or SVN. Some of Team Member can Updated this one but He got big problem , the Templates What i created its added in visualstudio MVC project,when run the project Its not Populated in the UmbracoDatatypes(i already integrated umbraco to my MVC Project) can u tel me how to fix this one Because total project completed in umbraco but one my college update this one the templates are not populated in umbraco.
is working on a reply...