Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jim 26 posts 86 karma points
    Aug 28, 2015 @ 09:07
    Jim
    0

    Multiple list views

    Hi

    I have a document type that has two allowed child node types enabled via the structure tab. I would like both of these child node types to appear on a separate content tab as a list view.

    I have been able to create two content tabs showing list views but both of the child node types appear in both lists. I would like only one child node type per list and each list on a different tab. (I hope this is clear!).

    Is this possible?

    Thanks

    Jim

  • Jim 26 posts 86 karma points
    Aug 30, 2015 @ 17:37
    Jim
    0

    .....any suggestions?

    Anyone?

  • Marc Goodson 2155 posts 14408 karma points MVP 9x c-trib
    Aug 30, 2015 @ 20:19
    Marc Goodson
    0

    There was a bit of a discussion about it on this thread:

    https://our.umbraco.org/forum/umbraco-7/developing-umbraco-7-packages/47275-Custom-list-views-per-doctype-in-Umbraco-backend

    but think, at this moment in time you would need to create your own ListView style property editor, to be able to customize the datasource, to the extent of filtering by doctype alias on the children to display in the ListView.

  • Jim 26 posts 86 karma points
    Aug 31, 2015 @ 06:57
    Jim
    0

    Hi Marc

    Thanks for the response.

    Your suggestion to create a new property editor (or editors) to filter by doctype alias sounds very promising.

    What would be the easiest way to achieve this?

    I have little Umbraco experience but lots of C# .NET experience. I read somewhere it might be possible to make use of user controls to create property editors but it's not clear whether Umbraco 7 supports this.

    Regards

    Jim

  • Marc Goodson 2155 posts 14408 karma points MVP 9x c-trib
    Sep 01, 2015 @ 00:31
    Marc Goodson
    0

    Hi Jim

    Have a look at the Creating a Property Editor documentation here:

    https://our.umbraco.org/documentation/Tutorials/Creating-a-Property-Editor/

    In Umbraco 4/6 you could use User Controls to create new Property Type Editors, but now this is achieved via AngularJS...

    as Sebastiaan says in the other thread there is a project for a MemberListView that might have some useful pointers...

    You could get some inspiration from the MemberListView package perhaps:

    https://our.umbraco.org/projects/backoffice-extensions/memberlistview-for-umbraco-7

    Source: https://github.com/robertjf/umbMemberListView

    Also not really got to grips with the type of data you are working with, ie the two different doc types, with the one common parent and two ListViews - I'm wondering if this is the best approach, but just lack of context of the problem is making me think this; there maybe a better way... but maybe not, slightly intrigued anyway.

  • Jim 26 posts 86 karma points
    Sep 01, 2015 @ 10:50
    Jim
    0

    Hi Marc

    I've read through the information using the links you provided but I'm not sure it has helped.

    Firstly, I don't really want to create a new property editor from scratch - I simple want to modify the behaviour of the List View slightly. I realise that this involves creating a new editor but it's not clear how I would go about retaining the behaviour of the existing editor.

    I'm also trying to achieve this as simply as I can. This is not (just) laziness but rather a desire not to be diverted for too long from building my project. The implementation of the MemberListView looks interesting but rather is a rather more complicated solution than I was hoping for.

    In fact, in the meantime I have discovered an excellent package called Nested Content, which is almost exactly what I am looking for. The only problem is that it does not support Upload which I was hoping to make use of.

    Just to give you some context, each of my pages displays details of a visit. This is the parent doctype. Each visit can have a number of visit points (day of week, description, destination). Visit point is the first child doctype. Each visit can also have a number of labelled photos associated with it. This is the second child doctype.

    I was hoping to have a one list on one tab holding visit point descriptions and another list on another tab holding associated photos.

    Thanks

    Jim

  • Marc Goodson 2155 posts 14408 karma points MVP 9x c-trib
    Sep 01, 2015 @ 22:03
    Marc Goodson
    0

    Hi Jim

    A lot depends on the number of photos for a visit,

    for a small number you could use a multiple media picker, to associate the media items to the visit content node - or for larger numbers you could create a folder in the media section for each visit, and have the particular visit images uploaded there; and have a media picker property on the visit doc type, pick the folder for the visit that contains the images.

    The ListView is kind of a special property that's been introduced to Umbraco 7 core to enable the content tree below a node to be squashed into a tabular view; so the concept of having two ListViews filtered by different doctypes hasn't been considered, yet.

    The implementation of the ListView is at: /umbraco/Views/propertyeditors/listview/listview.html inside your umbraco site, that again gives you a view of what's going on.

    So whilst building your own is possible, the links give you a bit of context as to what is involved, but might be better as a last resort.

    Have you seen Archetype ?

    https://our.umbraco.org/projects/backoffice-extensions/archetype/

    if the data is being entered via Umbraco Backoffice, then this would give a similar listing of multiple items (with 'file upload'), on each tab - although each row wouldn't be a separate node.

    Another approach would be to perhaps have a 'holding' doctype beneath your Visit doctype eg: a VisitPointList, underneath which just the VisitPoints are created via a ListView, and similary a VisitImagesGallery doctype, underneath which just the Visit Images are created...

    Visit - VisitPointList- VisitPoints Visit - VisitImagesGallery - VisitImages

    maybe feels a bit clunky ?, but no development... anyway with some of your multiple content being images, I'd probably look to draw this from the Media Section, rather than have two list views.

    if these ramblings help at all !

  • Jim 26 posts 86 karma points
    Sep 03, 2015 @ 07:18
    Jim
    0

    Hi Marc

    Thanks again for your comprehensive response.

    From what you say, I can now see that I'm probably not using ListView in the way it was intended. You are right to point out that Architype (like Nested Content) is a much better fit for my requirement. I had looked at Architype on a previous project but rejected it on the grounds that it (like Nested Content) does not support image upload.

    I have also considered multiple media picker but there are a couple of issues with it that make it less than ideal. Firstly, I'm actually using Image Cropper rather than Upload as I need to have a number of alternative crops for each image (for use in a responsive site design). Secondly, each image has no reuse value elsewhere in the site so I'd rather avoid having the user upload it to central repository and then pick it from there.

    I also considered using a 'holding' doctype beneath the Visit doctype, which is a technique I have used on an earlier project. However, the Visits are themselves presented as a list view and once you click through to a specific Visit it's not obvious how you would then add the new child VisitPointList doctype to this.

    My current solution is to use Nested Content for the Visit Points (which do not contain images) which then leaves Visit Images as the only remaining child node, allowing them to be set up as a Listview. It's a bit messy and also relies on the fact that only one of my lists contains images but it's the best I have been able to come up with so far.

    Thank you very much for your help so far and please let me know if you can see a better way of doing this based on the further information above.

    Regards

    Jim

Please Sign in or register to post replies

Write your reply to:

Draft