Skip to content

Instantly share code, notes, and snippets.

View phproberto's full-sized avatar

Roberto Segura phproberto

View GitHub Profile
@phproberto
phproberto / default.php
Created March 11, 2014 23:29
Sample email this page link
<?php $url = JUri::getInstance()->toString(); ?>
<a class="email" title="Email a friend" href="mailto:?subject=Interesting information&body=I thought you might find this information interesting: <?php echo $url; ?>">Email</a>
@phproberto
phproberto / sample.php
Last active December 28, 2015 08:39
Load jQuery for Joomla! 2.5 - 3.x
<?php
if (version_compare(JVERSION, '3.0', '<'))
{
if (JFactory::getApplication()->get('jquery') !== true)
{
// Load jQuery in no conflict mode with B/C support
JHtml::script(JUri::root() . 'templates/joostrap/js/jquery.min.js');
JHtml::script(JUri::root() . 'templates/joostrap/js/jquery-migrate.min.js');
JHtml::script(JUri::root() . 'templates/joostrap/js/jquery-noconflict.js');
@phproberto
phproberto / README.md
Last active December 25, 2015 06:39
Ubuntu: JS minify compatible for bootstrap files using + Joomla bootstrap minify example

This uses UglifyJS to create minified files.

Install node:

# python-software-properties is needed to use add-apt-repository
sudo apt-get install python-software-properties python g++ make
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
@phproberto
phproberto / sample.php
Last active December 17, 2015 12:39
Retrieve JForm post data with JInput
<?php
// Required objects
$input = JFactory::getApplication()->input;
// Get the form data
$formData = new JRegistry($input->get('jform', '', 'array'));
// Get any data being able to use default values
$id = $formData->get('id', 0);
@phproberto
phproberto / plugin-parcheado.js
Last active December 16, 2015 16:59
Apaño para Ciro
(function($){
// AQUI TU CODIGO JS USANDO $
})(jQuery);
@phproberto
phproberto / .gitconfig
Last active February 4, 2022 15:23
My git config file
[color]
status = auto
diff = auto
branch = auto
interactive = auto
ui = true
[alias]
amend = !"git commit --amend -C HEAD"
st = status
ci = commit
@phproberto
phproberto / examples.md
Last active December 11, 2015 14:38
Joomla! overridable asset loader

Joomla! overridable media asset loader

Asset loader based on @dongilbert asset loader ( https://gist.github.com/4205674 )

Stylesheets

ELHtml::asset('style.css');
@phproberto
phproberto / overridable-media.md
Last active December 10, 2015 21:58
Joomla! overridable media cheatsheet
@phproberto
phproberto / README.md
Created December 7, 2012 11:15
Trick to make com_taxonomy use content blog templates

Force com_taxonomy to use content category blog templates.

This method uses a hidden menu item to customize the com_taxonomy tag results.

Demo

You can see it in action in:

@phproberto
phproberto / override_controllers_admin_AdminImportController.php
Created October 26, 2012 11:07
Prestashop importer override to update prices without losing product names
<?php
class AdminImportController extends AdminImportControllerCore
{
public function __construct()
{
parent::__construct();
}