Skip to content

Instantly share code, notes, and snippets.


Jon Neubauer jneubauer

View GitHub Profile
jneubauer / .htaccess
Created Sep 15, 2015
example of additional htaccess condition preventing broken image and file links from getting routed to Joomla CMS
View .htaccess
## Begin - Joomla! core SEF Section.
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# If the requested path and file is not /index.php and the request
# has not already been internally rewritten to the index.php script
RewriteCond %{REQUEST_URI} !^/index\.php
# and the requested path and file doesn't directly match a physical file
RewriteCond %{REQUEST_FILENAME} !-f
# and the requested path and file doesn't directly match a physical folder
jneubauer / masterplugin.php
Last active Feb 16, 2018
Joomla! plugin that fires all possible plugin events
View masterplugin.php
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
class PlgSystemMasterplug extends JPlugin
function onUserAuthenticate()
error_log('onUserAuthenticate', 0);
jneubauer / edit.php
Last active Aug 29, 2015
Front End Editing Override
View edit.php
<!-- this goes in the template override(e.g., /templates/your-template/html/com_content/form/edit.php) -->
<!-- Instead of just this -->
<?php echo $this->form->renderField('field_name', 'attribs'); ?> <!-- displays a field already in the XML file -->
<!-- You need this -->
<!-- this part can be added anywhere in the file - preferrable towards the beginning, but definitely before the next part -->
<?php if ($this->item->id) : ?> <!-- checking if this is an existing article or not -->
<?php $attribs = json_decode($this->item->attribs); ?> <!-- if it is an existing article, get the attribs part of the existing record (attribs is where we save custom fields). You only need this line once. -->
<?php echo $this->form->setValue('field_name', 'attribs', $attribs->field_name); ?> <!-- set the value of the custom field to what is already saved. Duplicate for the number of fields you need, changing the field_name as needed. -->
<?php endif; ?>

Keybase proof

I hereby claim:

  • I am jneubauer on github.
  • I am jonneubauer ( on keybase.
  • I have a public key whose fingerprint is 59D1 85B1 013D 1F7E B633 689D 1876 E896 AA9A 7850

To claim this, I am signing this object:

View geodata.json
jneubauer / gist:3025457
Created Jun 30, 2012
JFoobar item titles
View gist:3025457
in /components/com_yourcomponent/views/yourcomponents/tmpl/default.php on line 34:
<?php echo $this->escape($item->title); ?>
<a href="index.php?option=com_flashcards&view=flashcard&id=<?php echo $item->id; ?>"><?php echo $this->escape($item->title); ?></a>