How do I add the number of rows shown in a view to a menu link? I want to add the number of rows shown in a view to a menu link, something as follows, for example.


  Companies(29) | Products(152) | Customers(522) | Orders(9888) ..


How can I achieve this?
You can do this with a view, assuming each item is a content type.

Create a new view of Content as an unformatted list of fields. Under 'Advanced' set Use Aggregation to Yes.

Under fields delete the title field, and add Content:Type and Content:NID. 

Configure the Content:Type field as no label and "group by" under Aggregation Settings. Under 'Rewrite Results' check 'Output this field as a link', set it to replace spaces with dashes and to convert to lower case. In the path enter something like "list/[type]", depending on your desired target.

Configure the Content:NID field as no label, and add the prefic " (" and the suffix")". Set it to 'Count' under Aggregation Settings.

Use CSS to have both fields float:left; to line them up.

You can leave the view unsorted or sort by Content:NID->COUNT or by Content:Type. You should leave the filter for Published nodes, and you can add a filter to restrict the content types which will appear.

Then place the block where you want the menu to appear.