Archive for September 2014

The ReCAPTCHA iframe Issue

To get rid of that annoying iframe at the bottom of the contact page, when ReCaptcha is activated, add this to your CSS:

/* ReCaptcha Iframe FIX */

For css to only load on certain pages, this is a great little free plugin:

Joomla Contact, Display Form

Been having a bit of frustration with the default Joomla contact form (Joomla 3.3.3). I like that you can easily create an attractive, simple, clean contact page right out of the box, but am mystified as to why the basic details is set to show by default, and the form only pops up if you click on the header.

This seems entirely opposite to what most people would want in a contact page. I would imagine that most visitors would want to use a simple form, and just send an email. If they really need to phone, send a letter, or visit they can click to get that information.

Here’s my dilemma; I like the accordion “slider” display, and don’t want to set it to “plain.” I just want to change which section is open when the page loads.

So, here’s how you do that:

1. Find the file: [joomla root folder]/components/com_contact/views/contact/tmpl/default.php

2. Copy this file into your template overrides
(e.g. [joomla root folder]/templates/[your template]/html/com_contact/contact/default.php)

3. find this section, approximately lines 52-63:

<?php if ($this->params->get(‘show_tags’, 1) && !empty($this->item->tags)) : ?>
<?php $this->item->tagLayout = new JLayoutFile(‘joomla.content.tags’); ?>
<?php echo $this->item->tagLayout->render($this->item->tags->itemTags); ?>
<?php endif; ?>

<?php if ($this->params->get(‘presentation_style’) == ‘sliders’) : ?>
<?php echo JHtml::_(‘bootstrap.startAccordion’, ‘slide-contact’, array(‘active’ => ‘basic-details’)); ?>
<?php endif; ?>
<?php if ($this->params->get(‘presentation_style’) == ‘tabs’) : ?>
<?php echo JHtml::_(‘bootstrap.startTabSet’, ‘myTab’, array(‘active’ => ‘basic-details’)); ?>
<?php endif; ?>

4.  Cut and past that directly above this line (if you’ve cut the previous section, it should now be at about line 91):

<?php if ($this->params->get(‘show_email_form’) && ($this->contact->email_to || $this->contact->user_id)) : ?>

5.  Replace ‘basic-details’ with ‘display-form’ in both instances in the pasted section.

Now when the page loads the form shows, and the other contact details are collapsed!

You can also move the whole “display-form” section up above the basic details if you like. Personally, I preferred the look of the page with the collapsed section still on top.