Skip to content

Instantly share code, notes, and snippets.

View fastnetwebdesign's full-sized avatar

Philip Locke fastnetwebdesign

View GitHub Profile
@fastnetwebdesign
fastnetwebdesign / 0_reuse_code.js
Last active September 22, 2015 11:13
GistBox - Hints/Tips (useful - Phil)
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@fastnetwebdesign
fastnetwebdesign / gist:2cf0955d7d059aae4355
Last active September 22, 2015 11:16
custom_html map
<?php
$templateName = JFactory::getApplication()->getTemplate();
if ( !file_exists(JPATH_SITE.'/templates/'.$templateName.'/images/Map_marker.png') )
StarTekHelper::getInstance()->addScriptDelayed('window.__noMarkers = true;');
$location = JRequest::getVar('location');
//$location = count($location) ? $location[0] : 'London';
// Search results variables
//$resultsWord = ($this->pagination->total == 1) ? 'Result' : 'Results';
@fastnetwebdesign
fastnetwebdesign / gist:afb58cd8545d3224021e
Created January 8, 2015 18:44
order articles in blog view by fieldsattach id dependant on array
<?php
// Pull in and use FieldsAttach component helper file for getting extra fields id's
JLoader::register('fieldattach', 'components/com_fieldsattach/helpers/fieldattach.php');
?>
<!-- order articles in blog view by fieldsattach id dependant on array -->
<?php foreach ($this->intro_items as $key => &$item)
{
$team = fieldattach::getValue($item->id, 1, false);
@fastnetwebdesign
fastnetwebdesign / gist:d57eb68d74142832ea36
Created December 17, 2014 16:55
Dynamically load article template based on category ID
switch ($this->item->catid)
{
case('9'):
case('11'):
echo $this->loadTemplate('inset');
break;
case('10'):
echo $this->loadTemplate('news');
break;
default:
@fastnetwebdesign
fastnetwebdesign / gist:2a9ba26d4606111e88ff
Last active August 29, 2015 14:10
pull module into Joomla html override or remove div if no module
<?php
// Render modules inside this html override
$doc = JFactory::getDocument();
$renderer = $doc->loadRenderer('modules');
$raw = array('style' => 'xhtml');
?>
<!-- remove the whole div if no module assigned in this position-->