Listview No Items Found Message

0
Is it possible to change the ‘no items found’ message that appears in list views if the list has no items? OR, is it possible to interrogate the $currentObject to see if it is has no items?
asked
3 answers
3

I have something like this in a .scss file. Change the content part and add class custom-empty-label to your listview:

.mx-listview.custom-empty-label {
	li.mx-listview-empty {
		margin-top: 10px;
		padding: 4px;
		> label {
			display: none;
		}
	}
	li.mx-listview-empty:after {
		content: "I wish to say something different"
	}
}

 

Or, if you fill the listview by association, you could use a visibility constraint like “$currentObject/Object_AssociatedObject != empty”.

Also as Sjors mentioned the default message can be edited in Project > System texts > Listview , but then it goes in all empty listviews.

answered
1

Hi Russell,

Through Project > System texts > Listview there's an option to change the text:

It's not possible to use $currentobject by default to determine if listview should be shown or not. This would require extra logic and a boolean on your currentobject when saving it.

An extra possibillity which I often use is with CSS (SCSS) because the listview does get an extra ‘empty’ class  and use display:none;  to hide it.

answered
0

might not exactly be the answer, but we have these 2 helper classes.

 

// hide elements

.hide-empty{

    .mx-listview-empty{

        display: none !important;

    }

}

 

.hide-loadmore{

    > .mx-listview-loadMore{

        display: none !important;

    }

}

answered