0

As soon as a set a default bucket view (for instance the table view) the bucket won't show any results or facets anymore when you open it. You have to press the search button explicitly. This is a unwanted extra click I would like to avoid.

Why is this and is there a way to make it show the results when you open the bucket?

When I open a bucket with a default view I see this (note that now you have to press the search button for results to show up): enter image description here

Without a default view I see this (note how the result appear immediately): enter image description here

Iam using sitecore 9.2.

2
  • Can you please add some screenshots or add some more details here for what you want to achieve? Commented Oct 30, 2019 at 7:05
  • @MahendraShekhawat added some screenshots
    – Barsonax
    Commented Oct 31, 2019 at 8:27

1 Answer 1

0

Alright, I think this is a bug in Sitecore and I will suggest you to reach to support team for this, but I found a workaround for this. You need to update the ItemBucket.utils.js file for this -

\sitecore\shell\Applications\Buckets\Scripts\ItemBucket.utils.js

In this file, you need to update few lines in establishViews function, a hack is to trigger the click event based on the current view by adding a line- $j("#" + window.CurrentView).trigger("click");-

 if (window.CurrentView && window.CurrentView !== "list") {
            $j("#views a").removeClass("active");
            $j("#" + window.CurrentView).trigger("click");
            $j("#" + window.CurrentView).addClass("active");
        }

in additional, there one more line need to update for showing the active view after the click in the same function from $j("#" + filter.ID).addClass("active"); to $j("#" + filter.ViewName).addClass("active");-

$j.each(views, function (index, filter) {
            $j("#" + filter.ViewName).click(function () {
                CurrentView = filter.ViewName;
                a.find(".sb_up").click();
                pageNumber = 0;

                $j.each(defaultViews, function (subIndex, subfilter) {
                    $j("." + subfilter).removeClass("active");
                });
                $j("#" + filter.ViewName).addClass("active");
                $j('.content').css({ 'opacity': 1.0 });
                $j("#ajaxBusy").css({ display: "block" });
                var n = buildQuery();
                runQuery(n, pageNumber, h, OnSearchRunFail);
                runFacet(n, pageNumber, meme, OnSearchRunFail);

                $j(".navAlpha").html("");
                $j(".slide-out-div").html("").prepend(LoadGifText);
                $j("#ajaxBusyFacet").css({
                    display: "none",
                    margin: "0px auto",
                    width: "44px"
                });
            });
        });
9
  • This is not relevant to my question and as you can see in the screenshots I already have a persistent filter.... I just want the results to show up when opening the bucket which has nothing to do with these filters you can configure.
    – Barsonax
    Commented Oct 31, 2019 at 9:37
  • This is a workaround for your problem, generally, if you don't have any filter you can simply put your start location in Default Bucket Query and it will work. If you are saying this is not working for you, it means you have a different problem. Commented Oct 31, 2019 at 10:17
  • This only works if you haven't set a default view.
    – Barsonax
    Commented Oct 31, 2019 at 10:23
  • I have changed my answer, I hope this will resolve your problem. Commented Oct 31, 2019 at 13:07
  • The view is now active but I still dont see any results
    – Barsonax
    Commented Nov 15, 2019 at 11:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.