Saturday, 6 April 2013
GCalendar in Joomla: Daylight Savings problem
We spent days trying to find a way to configure Daylight Savings into the calendar. All it allowed us to do in the global settings was to choose a time zone - of course we had set it to Europe/London - but without an option of respecting Daylight Savings automatically. In despair, I eventually uninstalled the component and reinstalled it. At this point there was a new version (3.0.0) of GCalendar available, so I chose that. In the component control panel there turned out to be an options button at the top right of the screen, which we may simply have missed seeing before. In the options you can set the time zone and once I had done so, suddenly all the times appeared correctly again within the web site. Huge sighs of relief all round.
Sunday, 1 August 2010
Custom image folder for Joomla Contacts
Because my church web site has a large number of contacts, I wanted to put all the photos in their own folder. Joomla's Contacts component normally expects photos to be stored at the default image location, /images/stories. I have a folder named portraits under this folder, but Joomla doesn't recurse into it when you select an image in the contact form.
It turns out that you have to make only three small edits to get this working, but I spent a frustrating few hours investigating before I found out how. To save you the trouble, here's the recipe. All file paths are relative to the Joomla root.
- Edit /components/com_contact/views/contact/tmpl/default.php. On line 52, change
<?php echo JHTML::_('image', 'images/stories' . '/'.$this->contact->image, ...
to
<?php echo JHTML::_('image', 'images/stories/portraits' . '/'.$this->contact->image, ... - Edit /administrator/components/com_contact/admin.contact.php. On line 227, change
$lists['image'] = JHTML::_('list.images', 'image', $row->image );
to
$lists['image'] = JHTML::_('list.images', 'image', $row->image, NULL, '/images/stories/portraits/' ); - Edit /administrator/components/com_contact/admin.contact.html.php. On line 437, change
jsimg='../<?php echo $cparams->get('image_path'); ?>/' + ...
to
jsimg='../<?php echo $cparams->get('image_path'); ?>/portraits/' + ...
Afterwards, you will have to open each contact you've previously created and select the portrait anew. I did try doing a bulk edit by exporting the contacts table to CSV and globally replacing, but that was a dismal failure.
The Joomla maintainers are apparently part way through parameterising the location of the stories folder (see the call to get('image_path') above). Ideally the location of the portraits would be a separate parameter. I didn't have time to do this, but this investigation clearly reveals the places where the parameter would need to be used.
