2

I am working on an enterprise wiki site collection inside my sharepoint server 2013 on-premises. and inside this site collection i have enabled the Metadata navigation and filter site feature:-

enter image description here

Then i defined the following fields to be used inside the Key filters:-

enter image description here

so the result i got is that when i navigate to the wiki pages library, i will get the key filters fields on the left hand side of the screen as follow:-

enter image description here

now our customer did not like this look and feel. and they asked us to made the key filters columns to be displayed in a grid on the top of the page. now i find this list view web part which suppose to work well https://splistviewfilter.codeplex.com/ . but the problem i got with this list view web part is that the filter will work well on the first click, but when i do a paging the filter setting will be ignored.

so my question is that can i using css/javascript to realign the built-in key filters to be show as follow:-

  1. in a grid view, 3 columns per row, instead of being displayed under each other
  2. show the key filter at the top of the page instead of being displayed at the left hand side of the page ?

something such as :-

enter image description here

6
+50

I did some tests myself and it should be pretty straight forward.

You can use a local jQuery reference instead of a CDN.

This hides the Key filter Div and then moves the Div containg the filter to above the pages main content (list, hidden filters etc.).

<style type="text/css">
    .ms-tv.box {
        display:none; /* Hide the Key filters until the jquery has moved the element */
        margin-left:0px; /* Align the key element Div with "New Item buttons" */
    }
    #idKeyFiltersContainer {
        width: auto !important; /* Stretch the background color for the key filter buttons */
    }
    .ms-KFLabelAndBodyContainer {
        display: inline-block;
        float: left;
    }
    #navresizerVerticalBarPositionHelper {
        display: none; /* Hides the vertical bar that allows stretching the left navigation */
    }
</style>

<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha256-k2WSCIexGzOj3Euiig+TlR8gA0EmPjuc79OEeY5L45g="crossorigin="anonymous"></script>

<script>
$(document).ready(function() {
    $(".ms-tv-box").insertBefore("#DeltaPlaceHolderMain").show();
});
</script>

About aligning three columns per row, you will have to tinker with the width of the .ms-KFLabelAndBodyContainer element. If you don't want it strictly to be three columns, you could try to add a dynamic width like width:20%;.

This is how it look's like in my environment.

enter image description here

  • worked well.. now from the time i posted the question i was able to manage to move the filters to the top of the page using $("#idKeyFiltersContainer").appendTo("#DeltaPageStatusBar"); but failed to show the fields on the same row.. now it is working well.. – john Gu Aug 14 '17 at 15:49
  • Glad you got it working! – Christoffer Aug 15 '17 at 5:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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