It appears EasySocial requires menu item ID to be appended to the non-SEF URL passed to JRoute::_()
call. There is ESR::getItemId()
method that can retrieve the menu item ID of a given view. So something like this could work:
JRoute::_('index.php?option=com_easysocial&view=albums&Itemid=' . ESR::getItemId('albums'))
However, the most common way is to use magic static methods of ESR
class. This is what EasySocial and the included modules generally used. The method name is the view and it accepts an array of arguments:
ESR::albums(['layout' => 'default', 'id' => $someId]);
Before you can use EasySocial classes, you need to load easysocial.php
file:
$engine = JPATH_ADMINISTRATOR . '/components/com_easysocial/includes/easysocial.php';
if (!is_file($engine)) {
// EasySocial is not installed, return early or use some fallback code
}
require_once $engine;