Skip to content

Instantly share code, notes, and snippets.

View sergiois's full-sized avatar

Sergio Iglesias sergiois

View GitHub Profile
@sergiois
sergiois / color-rrss.css
Last active March 30, 2021 15:35
Colores de las redes sociales para CSS
Twitter: #41b7d8
Facebook: #3b5997
Google: #d64937
LinkedIn: #0073b2
Vimeo: #388fc5
Flickr: #ff0084
Pinterest: #cb2027
Skype: #00aff0
Youtube: #c4302b
Instagram: #3f729b
@sergiois
sergiois / bootstrap-grid-centered.css
Created August 25, 2017 12:23
Para centrar los div del grid de Bootstrap 3
.row-centered {
text-align:center;
}
.col-centered {
display:inline-block;
float:none;
text-align:left;
margin-right:-4px;
}
@sergiois
sergiois / get_url_template.php
Created May 26, 2017 09:02
Get URL Joomla Template
$app = JFactory::getApplication();
$path = JURI::base(true).'/templates/'.$app->getTemplate().'/';
@sergiois
sergiois / get_params_plugin.php
Created October 7, 2016 09:59
Código para recoger los parámetros de un plugin en cualquier lugar por código
$plugin = JPluginHelper::getPlugin('my_plugin_type', 'my_plugin');
// Check if plugin is enabled
if ($plugin)
{
// Get plugin params
$pluginParams = new JRegistry($plugin->params);
$param1 = $pluginParams->get('param1');
$param2 = $pluginParams->get('param2');
@sergiois
sergiois / system_messages_joomla.css
Last active December 25, 2015 19:09
Estilos personalizados para mensajes de sistema nativos de Joomla! (en lugar de usar los de la hoja de estilos de system)
#system-message-container #system-message dt{display:none;}
#system-message-container #system-message dd{margin:0; padding:10px;}
#system-message-container #system-message dd ul{margin:0; padding:0;}
#system-message-container #system-message dd ul li{margin:0; padding:0;}
#system-message-container #system-message dd.error.message{background: none repeat scroll 0 0 rgba(218, 49, 75, 0.2); color: #DA314B;}
#system-message-container #system-message dd.message.message{background: none repeat scroll 0 0 rgba(16, 151, 244, 0.2); color: #075C97;}
#system-message-container #system-message dd.success.message{background: none repeat scroll 0 0 rgba(140, 193, 76, 0.2); color: #8CC14C;}
#system-message-container #system-message dd.warning.message{background: none repeat scroll 0 0 rgba(250, 167, 50, 0.2); color: #FAA732;}
@sergiois
sergiois / itemid_article_joomla.php
Created October 14, 2013 11:32
Función para conseguir la URL completa de un artículo con el Itemid correspondiente
<?php
$url = ContentHelperRoute::getArticleRoute($article->id.':'.$article->alias, $article->catid);
?>
@sergiois
sergiois / responsive.css
Created October 7, 2013 16:54
Estructura de media queries > css responsive
/* resolucion 800 x 600 */
@media (min-width: 800px) and (max-width: 959px) {
}
/* resolucion 768 x 1024 */
@media (min-width: 768px) and (max-width: 799px) {
}
@sergiois
sergiois / constantes_joomla.php
Created October 4, 2013 19:34
Constantes que facilitan la tarea de accesos a distintas partes del CMS Joomla!
<?php
JPATH_ADMINISTRATOR The path to the administrator folder.
JPATH_BASE The path to the installed Joomla! site.
JPATH_CACHE The path to the cache folder.
JPATH_COMPONENT The path to the current component being executed.
JPATH_COMPONENT_ADMINISTRATOR The path to the administration folder of the current component being executed.
JPATH_COMPONENT_SITE The path to the site folder of the current component being executed.
JPATH_CONFIGURATION The path to folder containing the configuration.php file.
JPATH_INSTALLATION The path to the installation folder.
JPATH_LIBRARIES The path to the libraries folder.
@sergiois
sergiois / id_url_jooma.php
Last active December 22, 2015 04:29
Quitar id en urls amigables de Joomla
<?php
// Editar fichero components\com_content\router.php
// Dentro de función ContentBuildRoute(&$query)
// Cambiar $advanced = $params->get('sef_advanced_link', 0); por
$advanced = $params->get('sef_advanced_link', 1);
// Dentro de función ContentParseRoute($segments)
// Cambiar $advanced = $params->get('sef_advanced_link', 0); por
$advanced = $params->get('sef_advanced_link', 1);
@sergiois
sergiois / frontpage_joomla.php
Last active December 22, 2015 04:29
Cómo saber si estamos en la página de inicio de Joomla
// Básico
<?php $menu = & JSite::getMenu();
if ($menu->getActive() == $menu->getDefault()) {
echo 'This is the front page';
} ?>
// Multi-idioma
<?php
$app = JFactory::getApplication();
$menu = $app->getMenu();