Display total# Items in Omeka 2.0


I used to use the total_items function in Omeka 1x to display a count of all public Items on my theme home page. Example: <?php echo 'Total casualties posted to date:&nbsp;'. total_items() .'.'; ?>

Functions have changed in 2.0. I see that the new function is total_records and that I am supposed to reference a recordType. I am a bit lost on the recordType and if I need to first declare that function.

Thank you.

Just trying to go with <?php echo 'Total casualties posted to date: '. total_records() .'.'; ?> did not work; it broke my home page.

total_records() wants a type for the records. Something like this:

echo total_records('Item');

will print the total number of Items available.

Generally, in the switch from 1.x to 2.x, the functions are generalized, with the first parameter as the record type, which was built into the function name. So



echo total_records('Item');

Thanks, Patrick! I messed up and original tried to use "Items", which did not work. And thanks for the explanation of functions in 1 vs 2.

No problem. I think there are functions in Omeka where either 'Item' or 'Items' works, and it isn't always clear where one won't work.