Can you help please?
I've build a simple module which displays two 'back to top of page' arrows, one bottom left and the other bottom right. It works well if inside an existing template module position or in the component area using {loadmodule mod_backtotop}. However, I want to be able to automatically display the module as soon as it's installed, either without the need for a module position or maybe create a new module position upon installation?
I hope this makes sense, I'm not sure if I've explained it well.
Any help gratefully received. Thanks in advance.
UPDATE:
Thanks to @Lodder this is the code I used. Hopefully this will help others.
if (strtolower($type) === 'install')
{
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$fields = array(
$db->quoteName('position') . ' = ' . $db->quote('backtotop'),
$db->quoteName('showtitle') . ' = 0',
$db->quoteName('published') . ' = 1'
);
$conditions = array(
$db->quoteName('module') . ' = ' . $db->quote('mod_backtotop')
);
$query->update($db->quoteName('#__modules'))->set($fields)->where($conditions);
$db->setQuery($query);
$db->execute();
}