Can the view results counter be edited to display in descending order vs. ascending? Or, can the output be limited to displaying the last record?

Setting items to display = 1 results in the first item in the counter displayed and I would like to display the last item. The counter results rise and fall so setting to skip a fixed number of records doesn't help.

CommentFileSizeAuthor
#2 randomsort.png30.91 KBmanogolf
#2 theminginfo.png25.7 KBmanogolf
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

 Or, can the output be limited to displaying the last record?

You can easily theme the field output and check on which row you are currently and just display when you want it, else return '';

manogolf’s picture

FileSize
25.7 KB
30.91 KB

Perhaps if I knew a bit more about theming the field output this may be easier, but as a rookie my skills are weak at best. I've attached two screen captures and was hoping you could let me know if I'm on the right scent. The first capture is a shot of the view setting being used. Output is three and I would like to limit the display to the last current record added.
The second capture is where I think you are pointing me. If so which template should my focus turn too? And how would the else return"; look when integrated?

coolhandlukek2’s picture

Hi,

I have a similar issue where it would solve a lot of problems if the output from the Sort criteria 'Global: Sort order' could be set to desending. Did you find a solution?

Re your other question

** Setting items to display = 1 results in the first item in the counter displayed

You can do this by adding a views filter on your contnent type ie if role 3 set the filter on role 3 then in Basic setting set your Items to display = 1

thx

coolhandlukek2’s picture

Found a solution on befused - Thx for posting
http://befused.com/drupal/views-count-results
Rename or delete "Showing and or result to your view title"

Exclude from display your results and then paste this in to your header / footer

$view = views_get_current_view();

// execute view query
$view->execute();

// results are now stored as an array in $view->result
$count = count( $view->result );

print "Showing <b>$count</b> results";
esmerel’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.