Copied to clipboard

Flag this post as spam?

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


  • Adrian 38 posts 117 karma points
    Jun 11, 2014 @ 13:46
    Adrian
    0

    Can we control the position of the "Child Items" tab in the content view?

    In some cases having the Child Items tab first is counter intuitive. Can we set where it should appear?

    Content Sample

  • Jan Skovgaard 11242 posts 23390 karma points MVP 6x admin c-trib
    Jun 20, 2014 @ 19:16
    Jan Skovgaard
    0

    Hi Adrian

    The short answer to this is "no".

    You could probably overwrite some of the core code but then you'll need to do it over and over again if you upgrade or when you start new projects etc.

    I'm not sure what the best solution is for this but perhaps it's worth adding a feature request to the issue tracker suggesting it's possible to configure where the child items tab should be placed.

    Cheers, Jan

  • Adrian 38 posts 117 karma points
    Sep 03, 2014 @ 12:47
    Adrian
    0

    I have posted a request to enable sorting but have worked out a patch that can rearrange the tabs.

    If you are happy to patch your Umbraco, whilst waiting for a built in solution:

    I created a JS object to handle checking the Document Type and then if necessary rearrange the tabs. I've used a separate file so that code wont get removed when Umbraco gets updated. Bring this into scope by adding a < script src=... > to ~\umbraco\Views\default.cshtml You will need to add this script tag back after updates.

    var myPatches= {}
    
    myPatches.fixTabsOnEdit = function (data) {
    
        switch (data.contentTypeName) {
            case "Editorial":
            case "EditorialHistoric": {
                myPatches.rearrange(data.tabs);
                break;
            }
            default: {
    
            }
        }
    }
    
    /* move "Child Items" tab to the end, and change the label */
    myPatches.rearrange = function (a) {
        if (a.length) {
            var tmp = a.shift();
            tmp.label = "Comments";
            a.push(tmp);
        }
    }
    

    Then find ~\umbraco\js\umbraco.controllers.js search for contentResource.getById in my version of Umbraco its on line 1882:

     contentResource.getById($routeParams.id)
                .then(function (data) {
                    myPatches.fixTabsOnEdit(data); // pass to my object to check types and rearrange
                    $scope.loaded = true;
                    $scope.content = data;
           ....etc....
    

    the then(...) promise is pretty much the first time the client gets to see the data returned by Umbraco, so I just pass the data to my code to check and process it if necessary.

    Again you will need to patch this again after an update from U-HQ.

  • Sandeep Pote 3 posts 24 karma points
    Aug 06, 2015 @ 17:06
    Sandeep Pote
    1

    I had same issue with List View and was able to solve the same.

    Please see screenshots-

    Created a custom listview

    List View with Tab **Child Items** Tab

    Added a new Tab (Product List) and added new column with the data type as new List View. This added a new column with same list.

    enter image description here

    1. Unchecked Enable List View in document. Create new Tab and sorted accordingly, and here you go-

    enter image description here

    Not sure if this is fundamentally wrong, but worked for me.

  • Henry 21 posts 141 karma points
    Jun 09, 2017 @ 14:09
    Henry
    0

    Awesome - saved me a headache here!

  • Will 6 posts 26 karma points
    Sep 19, 2015 @ 09:24
    Will
    0

    Tried this Approach but you dont see to get the return to list button option which will cause confusion for end users. Think the Patch is the best option

  • David Armitage 190 posts 764 karma points
    Jul 20, 2018 @ 11:20
    David Armitage
    0

    Hi Peeps,

    This must have been fixed with the later versions of Umbraco. I write a quick blog about it here. You will find instructions how to do this.

    https://www.umbrajobs.com/blog/posts/2018/july/umbraco-control-the-position-of-the-child-items-tab-in-the-content-view/

    Kind Regards

    David

  • Ali Kazai 9 posts 79 karma points c-trib
    Aug 07, 2019 @ 11:12
    Ali Kazai
    0

    This has been patched.

    In the list view section there is a Display at tab Number option, just set it to the position you want the child tab to be at. i set it to -1 which will force it before any other tab.

    screenshot of list view

Please Sign in or register to post replies

Write your reply to:

Draft