Removing Summary Text from the CListView Widget - Bhavik Mistry
152
post-template-default,single,single-post,postid-152,single-format-standard,ajax_fade,page_not_loaded,,qode-title-hidden,overlapping_content,qode-theme-ver-10.1.1,wpb-js-composer js-comp-ver-5.0.1,vc_responsive

Removing Summary Text from the CListView Widget

There may a time when you want to disable the summary text that accompanies the CListView widget. The summary text is the information that generally appears before the widget is rendered, giving the user information along the lines of “Total 7 results.” or “Showing 7 of 33 records”.¬†Unfortunately there is no Boolean property to easily turn this on and off. Instead we manipulate the template controlling how the widget is rendered:

'template' => '{items}{pager}',

This bit of code is placed within the widget’s configuration when you’re building your view. You can see it in action below:

<?php $this->widget('zii.widgets.CListView', array(
                    'dataProvider' => $dataProvider,
                    'itemView' => '_index',
                    'emptyText' => 'There are currently no active projects to view.',
                    'enablePagination' => false,
                    'enableSorting' => false,
                    'template' => '{items}{pager}',
                ));?>

Let me know if I missed anything.

–bhavik . . .

No Comments

Sorry, the comment form is closed at this time.