Tuesday, 26 January 2010 22:11

The Problem

A common issue is when Projectfork is used on the Frontend with the Joomla Template Hidden, the Projectfork theme doesn't display as intended (or in our demos).

The issue is that even though the Joomla template is being hidden, the active template.css is still being loaded since Projectfork is loaded inside Joomla.

The Fix

You can fix this by adding a conditional to your active template's component.php file.

1. Grab the active component in a variable:

Right after the <head> of your component.php add this code to see which component is being used

<?php
// Detecting Active Component
$option = JRequest::getCmd('option', '');
?>

2. Put a conditional around the template.css so it won't be loaded for Projectfork pages

Before (your template code will look something like this)

<link rel="stylesheet" href="/templates/<?php echo $this->template ?>/css/template.css" type="text/css" />

After (with the conditional added)

<?php if($option != "com_projectfork"){?>
<link rel="stylesheet" href="/templates/<?php echo $this->template ?>/css/template.css" type="text/css" />
<?php } ?>
Last modified on Tuesday, 26 January 2010 22:44