<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Lapiz Corto &#187; Joomla!</title>
	<atom:link href="https://www.lapizcorto.com/tag/joomla/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.lapizcorto.com</link>
	<description>Para esas soluciones que nunca recuerdas</description>
	<lastBuildDate>Mon, 14 Dec 2015 08:34:34 +0000</lastBuildDate>
	<language>es-ES</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.9.1</generator>
	<item>
		<title>Joomla: Check if component content is empty</title>
		<link>https://www.lapizcorto.com/joomla-check-if-component-content-is-empty/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=joomla-check-if-component-content-is-empty</link>
		<comments>https://www.lapizcorto.com/joomla-check-if-component-content-is-empty/#comments</comments>
		<pubDate>Thu, 10 Jan 2013 12:52:10 +0000</pubDate>
		<dc:creator><![CDATA[Jiden]]></dc:creator>
				<category><![CDATA[Joomla!]]></category>
		<category><![CDATA[component]]></category>
		<category><![CDATA[empty]]></category>
		<category><![CDATA[getbuffer]]></category>

		<guid isPermaLink="false">http://www.lapizcorto.com/?p=748</guid>
		<description><![CDATA[We use and love Blank Component to show pages without component but even with no title Blank Component still shows html code. This article describes the method used to fully remove component output. Blank component at least will output something like: That&#8217;s not an empty page. To achieve this first we did a com_blankpage template [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>We use and love <a title="Joomla Blank Component" href="http://extensions.joomla.org/extensions/style-a-design/personal-layout/17363">Blank Component</a> to show pages without component but even with no title Blank Component still shows html code. This article describes the method used to fully remove component output.<br />
<span id="more-748"></span><br />
Blank component at least will output something like:</p>
<pre class="brush: php; title: ; notranslate">
&lt;div class=&quot;blank&quot;&gt;
&lt;/div&gt;
</pre>
<p>That&#8217;s not an empty page. To achieve this first we did a com_blankpage template override copying the file:</p>
<p><strong>components/com_blankcomponent/views/default/tmpl/default.php</strong></p>
<p>to:</p>
<p><strong>templates/YOURTEMPLATE/html/com_blankcomponent/default/default.php</strong></p>
<p>and comment/remove any output inside the template like:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

// no direct access
defined('_JEXEC') or die;
?&gt;
</pre>
<p>Now in your template index.php add this code:</p>
<pre class="brush: php; title: ; notranslate">
            $document = JFactory::getDocument();
            $compOutput = $document-&gt;getBuffer('component');

            if (!empty($compOutput)) {
                $output = '&lt;jdoc:include type=&quot;component&quot; /&gt;';
            }
</pre>
<p>That will fully disable component output.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.lapizcorto.com/joomla-check-if-component-content-is-empty/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Joomla: Alternate category layouts</title>
		<link>https://www.lapizcorto.com/joomla-alternate-category-layouts/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=joomla-alternate-category-layouts</link>
		<comments>https://www.lapizcorto.com/joomla-alternate-category-layouts/#comments</comments>
		<pubDate>Fri, 11 May 2012 11:21:32 +0000</pubDate>
		<dc:creator><![CDATA[Jiden]]></dc:creator>
				<category><![CDATA[Joomla!]]></category>
		<category><![CDATA[category template]]></category>
		<category><![CDATA[override]]></category>

		<guid isPermaLink="false">http://www.lapizcorto.com/?p=716</guid>
		<description><![CDATA[We were searching in Joomla content category layouts similar to K2 category templates. Since Joomla 1.6 this is possible. In K2 it&#8217;s quite simple, you just set clone and rename the default template and assign it to category. In Joomla content the system is harder to set but it&#8217;s more powerful since you can override [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>We were searching in Joomla content category layouts similar to K2 category templates. Since Joomla 1.6 this is possible.</p>
<p>In K2 it&#8217;s quite simple, you just set clone and rename the default template and assign it to category. In Joomla content the system is harder to set but it&#8217;s more powerful since you can override also category parameters and translation strings.</p>
<p>The information for this article was extrated from <a title="Joomla docs - Layout overrides" href="http://docs.joomla.org/Layout_Overrides_in_Joomla_1.6">Joomla Docs: Layout overrides in Joomla 1.6</a><span id="more-716"></span></p>
<p>There are two ways to override a category template:</p>
<h3>1. Categories not linked in menus.</h3>
<p>This is the basic override and works as the K2 category template. In your template you have to clone and rename the blog category files. In:</p>
<p><strong>templates/YOURTEMPLATE/html/com_content/category</strong></p>
<p>copy and rename the files:</p>
<p><strong>blog.php</strong>, <strong>blog_children.php</strong>, <strong>blog_item.php</strong> and <strong>blog_links.php</strong></p>
<p>for example if you want a category template called &#8220;product&#8221; rename the files to:</p>
<p><strong>product.php</strong>, <strong>product_children.php</strong>, <strong>product_item.php</strong>, <strong>product_links.php</strong></p>
<p>The final folder appearence will look like:</p>
<p><a href="http://www.lapizcorto.com/wp-content/uploads/2012/05/category.png"><img class="alignnone size-full wp-image-725" title="Category override folder" src="http://www.lapizcorto.com/wp-content/uploads/2012/05/category.png" alt="" width="414" height="447" /></a></p>
<p>Now in the category edit form you will see an alternate layout available:</p>
<p><a href="http://www.lapizcorto.com/wp-content/uploads/2012/05/category_assign.png"><img class="alignnone size-full wp-image-722" title="Category layout override assign" src="http://www.lapizcorto.com/wp-content/uploads/2012/05/category_assign.png" alt="" width="497" height="215" /></a></p>
<p>It&#8217;s done. Now you can adjust the templates to your needs.</p>
<h3>2. Category linked in menu</h3>
<p>Category overrides through menu links allow you an advanced override system. The method it&#8217;s the same used in the case 1 plus add a layout XML file. This will give us full control to customize the layout.</p>
<p>Follow the steps of case 1 and also copy the file:</p>
<p><strong>components/com_content/views/category/tmpl/blog.xml</strong></p>
<p>to:</p>
<p><strong>templates/YOURTEMPLATE/html/com_content/category/product.xml</strong></p>
<p>The final folder status:</p>
<p><a href="http://www.lapizcorto.com/wp-content/uploads/2012/05/category_xml.png"><img class="alignnone size-full wp-image-732" title="Category with XML override" src="http://www.lapizcorto.com/wp-content/uploads/2012/05/category_xml.png" alt="" width="247" height="493" /></a></p>
<p>Now you only have to customize the XML layout to give it the name, translations, etc. (read the <a title="Joomla Docs - Layout overrides" href="http://docs.joomla.org/Layout_Overrides_in_Joomla_1.6">Joomla docs</a> for more info)</p>
<p>You will have a new menu type that you can select to make a new menu item:</p>
<p><a href="http://www.lapizcorto.com/wp-content/uploads/2012/05/menu_type.png"><img class="alignnone size-medium wp-image-737" title="New menu type" src="http://www.lapizcorto.com/wp-content/uploads/2012/05/menu_type-300x230.png" alt="" width="300" height="230" /></a></p>
<p>Parametrize it to your needs and you are done!!</p>
<p>Hope this helps <img src="https://www.lapizcorto.com/wp-includes/images/smilies/icon_smile.gif" alt=":-)" class="wp-smiley" /> </p>
]]></content:encoded>
			<wfw:commentRss>https://www.lapizcorto.com/joomla-alternate-category-layouts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Joomla: funciones para obtener la plantilla actual o por defecto</title>
		<link>https://www.lapizcorto.com/joomla-funciones-para-obtener-la-plantilla-actual-o-por-defecto/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=joomla-funciones-para-obtener-la-plantilla-actual-o-por-defecto</link>
		<comments>https://www.lapizcorto.com/joomla-funciones-para-obtener-la-plantilla-actual-o-por-defecto/#comments</comments>
		<pubDate>Tue, 24 Apr 2012 08:40:19 +0000</pubDate>
		<dc:creator><![CDATA[Jiden]]></dc:creator>
				<category><![CDATA[Joomla!]]></category>
		<category><![CDATA[plantillas]]></category>
		<category><![CDATA[template_styles]]></category>

		<guid isPermaLink="false">http://www.lapizcorto.com/?p=615</guid>
		<description><![CDATA[Compartimos dos nuevas funciones Necesitábamos obtener el nombre de la plantilla actual o por defecto en Joomla. La plantilla actual es la plantilla asignada al Itemid del menú en el que nos encontramos. Cuando no hay Itemid o este no tiene asignada una plantilla específica se carga el nombre de la plantilla por defecto. Un [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Compartimos dos nuevas funciones</p>
<p>Necesitábamos <strong>obtener el nombre de la plantilla actual o por defecto en Joomla</strong>. La plantilla actual es la plantilla asignada al Itemid del menú en el que nos encontramos. Cuando no hay Itemid o este no tiene asignada una plantilla específica se carga el nombre de la plantilla por defecto.</p>
<p>Un requisito de la implementación era que el código tenía que poderse usar en plugins. Esto invalida el método basado en el propio menú de Joomla que está más extendido por internet.</p>
<pre class="brush: php; title: ; notranslate">
/**
* Get the name of the default themplate
* @author Jiden - Digital Disseny, S.L.
* @version 18/04/2012
*
* @param 0/1 $client_id - 0 frontend default | 1 backend default
*/
public function getDefaultTplName($client_id = 0) {
$result = null;
$db = JFactory::getDBO();
$query =  &quot; SELECT template FROM #__template_styles &quot;
.&quot; WHERE client_id=&quot;.(int)$client_id.&quot; &quot;
.&quot; AND home = 1 &quot;;
$db-&gt;setQuery($query);
try {
$result = $db-&gt;loadResult();
} catch (JDatabaseException $e) {
return $e;
}

return $result;
/**
* Get the name of the current template
* Works also @ plugins method
* @author Jiden - Digital Disseny, S.L.
* @version 23/04/2012
*
* @return string the name of the active template
*/
public function getCurrentTplName() {
// required objects
$app =&amp; JFactory::getApplication();
$jinput = $app-&gt;input;
$db = JFactory::getDBO();
// default values
$menuParams = new JRegistry();
$client_id = $app-&gt;isSite() ? 0 : 1;
$itemId = $jinput-&gt;get('Itemid',0);
$tplName = null;

// try to load custom template if assigned
if ($itemId) {
$sql = &quot; SELECT ts.template &quot; .
&quot; FROM #__menu as m &quot; .
&quot; INNER JOIN #__template_styles as ts&quot; .
&quot; ON ts.id = m.template_style_id &quot; .
&quot; WHERE m.id=&quot;.(int)$itemId.&quot; &quot; .
&quot;&quot;;
$db-&gt;setQuery($sql);
$tplName = $db-&gt;loadResult();
}
// if no itemId or no custom template assigned load default template
if( !$itemId || empty($tplName)) {
$tplName = getDefaultTplName($client_id);
}

return $tplName;
}
}</pre>
]]></content:encoded>
			<wfw:commentRss>https://www.lapizcorto.com/joomla-funciones-para-obtener-la-plantilla-actual-o-por-defecto/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Joomla: functions to get current/default template</title>
		<link>https://www.lapizcorto.com/joomla-functions-to-get-currentdefault-template/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=joomla-functions-to-get-currentdefault-template</link>
		<comments>https://www.lapizcorto.com/joomla-functions-to-get-currentdefault-template/#comments</comments>
		<pubDate>Tue, 24 Apr 2012 08:30:32 +0000</pubDate>
		<dc:creator><![CDATA[Jiden]]></dc:creator>
				<category><![CDATA[Joomla!]]></category>
		<category><![CDATA[current]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[templates]]></category>

		<guid isPermaLink="false">http://www.lapizcorto.com/?p=601</guid>
		<description><![CDATA[Today we are sharing two new functions. We needed to get the current and the default Joomla templates. Current template is the template style assigned to the menu entry. Default template is template used when no template style is assigned to menus. A requisite was that both methods must work on plugins so the alternative [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Today we are sharing two new functions.</p>
<p>We needed to <strong>get the current and the default Joomla templates</strong>. Current template is the template style assigned to the menu entry. Default template is template used when no template style is assigned to menus.</p>
<p>A requisite was that both methods must work on plugins so the alternative method based on menu object ( commonly seen on internet ) wasn&#8217;t valid for us.</p>
<pre class="brush: php; title: ; notranslate">
/**
* Get the name of the default themplate
* @author Jiden - Digital Disseny, S.L.
* @version 18/04/2012
*
* @param 0/1 $client_id - 0 frontend default | 1 backend default
*/
public function getDefaultTplName($client_id = 0) {
$result = null;
$db = JFactory::getDBO();
$query =  &quot; SELECT template FROM #__template_styles &quot;
.&quot; WHERE client_id=&quot;.(int)$client_id.&quot; &quot;
.&quot; AND home = 1 &quot;;
$db-&gt;setQuery($query);
try {
$result = $db-&gt;loadResult();
} catch (JDatabaseException $e) {
return $e;
}

return $result;
/**
* Get the name of the current template
* Works also @ plugins method
* @author Jiden - Digital Disseny, S.L.
* @version 23/04/2012
*
* @return string the name of the active template
*/
public function getCurrentTplName() {
// required objects
$app =&amp; JFactory::getApplication();
$jinput = $app-&gt;input;
$db = JFactory::getDBO();
// default values
$menuParams = new JRegistry();
$client_id = $app-&gt;isSite() ? 0 : 1;
$itemId = $jinput-&gt;get('Itemid',0);
$tplName = null;

// try to load custom template if assigned
if ($itemId) {
$sql = &quot; SELECT ts.template &quot; .
&quot; FROM #__menu as m &quot; .
&quot; INNER JOIN #__template_styles as ts&quot; .
&quot; ON ts.id = m.template_style_id &quot; .
&quot; WHERE m.id=&quot;.(int)$itemId.&quot; &quot; .
&quot;&quot;;
$db-&gt;setQuery($sql);
$tplName = $db-&gt;loadResult();
}
// if no itemId or no custom template assigned load default template
if( !$itemId || empty($tplName)) {
$tplName = getDefaultTplName($client_id);
}

return $tplName;
}
}</pre>
]]></content:encoded>
			<wfw:commentRss>https://www.lapizcorto.com/joomla-functions-to-get-currentdefault-template/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Joomla: cargar archivos de idioma</title>
		<link>https://www.lapizcorto.com/joomla-cargar-archivos-de-idioma/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=joomla-cargar-archivos-de-idioma</link>
		<comments>https://www.lapizcorto.com/joomla-cargar-archivos-de-idioma/#comments</comments>
		<pubDate>Thu, 19 Apr 2012 09:23:19 +0000</pubDate>
		<dc:creator><![CDATA[Jiden]]></dc:creator>
				<category><![CDATA[Joomla!]]></category>
		<category><![CDATA[idioma]]></category>
		<category><![CDATA[language]]></category>

		<guid isPermaLink="false">http://www.lapizcorto.com/?p=570</guid>
		<description><![CDATA[En ocasiones queremos forzar la carga de un archivo de lenguaje determinado de un componente desde un módulo, plugin o similar. En nuestro caso queríamos cargar en una librería archivos de lenguaje. El sistema es sencillo: Esto cargaría los archivos de idioma actual desde lib/mylibrary/language La función tiene parámetros adicionales para cargar un idioma en [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>En ocasiones queremos forzar la carga de un archivo de lenguaje determinado de un componente desde un módulo, plugin o similar.</p>
<p>En nuestro caso queríamos <strong>cargar en una librería archivos de lenguaje</strong>. El sistema es sencillo:</p>
<pre class="brush: php; title: ; notranslate">
$lang =&amp; JFactory::getLanguage();
$lang-&gt;load('lib_mylibrary', JPATH_LIBRARIES . DIRECTORY_SEPARATOR . 'mylibrary');
</pre>
<p>Esto cargaría los archivos de idioma actual desde lib/mylibrary/language</p>
<p>La función tiene parámetros adicionales para cargar un idioma en concreto o para forzar la recarga. Por ejemplo si quisiéramos forzar la carga del idioma español quedaría:</p>
<pre class="brush: php; title: ; notranslate">
$lang =&amp; JFactory::getLanguage();
$lang-&gt;load('lib_mylibrary', JPATH_LIBRARIES . DIRECTORY_SEPARATOR . 'mylibrary', 'es-ES', true);
</pre>
<div style="margin-bottom: 15px;">Más información sobre la función de carga y sus parámetros:</div>
<div style="background-color: #ffffcc; color: #444444; padding: 10px; border: 1px solid #E0E0E0; border-radius: 10px;">
<div><strong>JLanguage::load(string $extension, string $basePath, string $lang, boolean $reload, boolean $default)</strong></div>
<p>Loads a single language file and appends the results to the existing strings</p>
<dl>
<dt>Parameters:</dt>
<dd> </dd>
<dd><strong>string</strong> <strong>$extension</strong> The extension for which a language file should be loaded.</dd>
<dd> </dd>
<dd><strong>string</strong> <strong>$basePath</strong> The basepath to use.</dd>
<dd> </dd>
<dd><strong>string</strong> <strong>$lang</strong> The language to load, default null for the current language.</dd>
<dd> </dd>
<dd><strong>boolean</strong> <strong>$reload</strong> Flag that will force a language to be reloaded if set to true.</dd>
<dd> </dd>
<dd><strong>boolean</strong> <strong>$default</strong> Flag that force the default language to be loaded if the current does not exist.</dd>
<dt>Returns:</dt>
<dd>  boolean True if the file has successfully loaded.</dd>
<dt>Since:</dt>
<dd>11.1</dd>
</dl>
</div>
]]></content:encoded>
			<wfw:commentRss>https://www.lapizcorto.com/joomla-cargar-archivos-de-idioma/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Joomla: get POST jForm variables sent with jInput</title>
		<link>https://www.lapizcorto.com/joomla-get-post-jform-variables-sent-with-jinput/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=joomla-get-post-jform-variables-sent-with-jinput</link>
		<comments>https://www.lapizcorto.com/joomla-get-post-jform-variables-sent-with-jinput/#comments</comments>
		<pubDate>Fri, 13 Apr 2012 11:58:39 +0000</pubDate>
		<dc:creator><![CDATA[Jiden]]></dc:creator>
				<category><![CDATA[Joomla!]]></category>
		<category><![CDATA[jform]]></category>
		<category><![CDATA[jinput]]></category>
		<category><![CDATA[post]]></category>

		<guid isPermaLink="false">http://www.lapizcorto.com/?p=566</guid>
		<description><![CDATA[Method to receive with jInput the jForm $_POST variables in Joomla administration.]]></description>
				<content:encoded><![CDATA[<p>Method to receive with jInput the jForm $_POST variables in Joomla administration.</p>
<pre class="brush: php; title: ; notranslate">
$jinput = JFactory::getApplication()-&gt;input;
$variables = $jinput-&gt;post-&gt;get('jform',array(),'ARRAY');
</pre>
]]></content:encoded>
			<wfw:commentRss>https://www.lapizcorto.com/joomla-get-post-jform-variables-sent-with-jinput/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Joomla: función para obtener las posiciones de un template</title>
		<link>https://www.lapizcorto.com/joomla-funcion-para-obtener-las-posiciones-de-un-template/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=joomla-funcion-para-obtener-las-posiciones-de-un-template</link>
		<comments>https://www.lapizcorto.com/joomla-funcion-para-obtener-las-posiciones-de-un-template/#comments</comments>
		<pubDate>Wed, 04 Apr 2012 16:34:20 +0000</pubDate>
		<dc:creator><![CDATA[Jiden]]></dc:creator>
				<category><![CDATA[Joomla!]]></category>
		<category><![CDATA[funciones]]></category>
		<category><![CDATA[plantilla]]></category>

		<guid isPermaLink="false">http://www.lapizcorto.com/?p=559</guid>
		<description><![CDATA[Necesitábamos una función para cargar las posiciones disponibles en un template. Al no encontrar mucha información al respecto hemos decidido publicar la función resultante para ahorrar tiempo a quien pueda necesitarla. Usaríamos la función así: Y obtendríamos algo parecido a: Array ( [0] =&#62; debug [1] =&#62; header-top [2] =&#62; header [3] =&#62; header-bottom [4] [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Necesitábamos una función para cargar las posiciones disponibles en un template. Al no encontrar mucha información al respecto hemos decidido publicar la función resultante para ahorrar tiempo a quien pueda necesitarla.</p>
<pre class="brush: php; title: ; notranslate">
/**
* Parse templateDetails.xml and get available positions
* @author Jiden - Digital Disseny, S.L.
* @version 04/04/2012
*
* @param string $tplPath - path of the current theme
* @param boolean $nameAsKey - set position name as output array key?
*
* @return array of positions
*/
function getTplPositions($tplPath, $nameAsKey = false) {
$outputArray = array();
$templateXML = $tplPath.'/templateDetails.xml';
// try to load positions from template XML file
$xml = JFactory::getXML($templateXML);
if (is_object($xml)) {
$positions = $xml-&gt;xpath('positions/position');
if ($positions) {
foreach ($positions as $position) {
$name = (string)$position-&gt;data();
// clean name
$name = preg_replace(&quot;/(\-a|\-b|\-c|\-d|\-e|\-f)$/i&quot;, &quot;&quot;, $name);
// do not add duplicates
if(!in_array($name, $outputArray)) {
// use position name as array key?
if($nameAsKey) $outputArray[$name] = $name;
else $outputArray[] = $name;
}
}
}
}
return $outputArray;
}
</pre>
<p>Usaríamos la función así:</p>
<pre class="brush: php; title: ; notranslate">
$tplPath = JPATH_SITE . '/templates/' . $this-&gt;template;
$positions = getTplPositions();
print_r($positions);
</pre>
<p>Y obtendríamos algo parecido a:</p>
<pre>Array
(
    [0] =&gt; debug
    [1] =&gt; header-top
    [2] =&gt; header
    [3] =&gt; header-bottom
    [4] =&gt; topmenu
    [5] =&gt; rsidebar-top
    [6] =&gt; rsidebar
    [7] =&gt; rsidebar-bottom
    [8] =&gt; lsidebar-top
    [9] =&gt; lsidebar
    [10] =&gt; lsidebar-bottom
    [11] =&gt; main-top
    [12] =&gt; main
    [13] =&gt; main-bottom
    [14] =&gt; component-top
    [15] =&gt; component
    [16] =&gt; component-bottom
    [17] =&gt; footer-top
    [18] =&gt; footer
    [19] =&gt; footer-bottom</pre>
<p>Esperamos haberte ahorrado algo de tiempo.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.lapizcorto.com/joomla-funcion-para-obtener-las-posiciones-de-un-template/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Joomla: function to get template positions</title>
		<link>https://www.lapizcorto.com/joomla-function-to-get-template-positions/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=joomla-function-to-get-template-positions</link>
		<comments>https://www.lapizcorto.com/joomla-function-to-get-template-positions/#comments</comments>
		<pubDate>Wed, 04 Apr 2012 16:27:26 +0000</pubDate>
		<dc:creator><![CDATA[Jiden]]></dc:creator>
				<category><![CDATA[Joomla!]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[templates]]></category>

		<guid isPermaLink="false">http://www.lapizcorto.com/?p=543</guid>
		<description><![CDATA[We needed a function to get available template positions. Didn&#8217;t found lot of info out there so we created our own function. Now you can use the function as: That will return  something like: Array ( [0] =&#62; debug [1] =&#62; header-top [2] =&#62; header [3] =&#62; header-bottom [4] =&#62; topmenu [5] =&#62; rsidebar-top [6] [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>We needed a function to get available template positions. Didn&#8217;t found lot of info out there so we created our own function.</p>
<pre class="brush: php; title: ; notranslate">
/**
* Parse templateDetails.xml and get available positions
* @author Jiden - Digital Disseny, S.L.
* @version 04/04/2012
*
* @param string $tplPath - path of the current theme
* @param boolean $nameAsKey - set position name as output array key?
*
* @return array of positions
*/
function getTplPositions($tplPath, $nameAsKey = false) {
$outputArray = array();
$templateXML = $tplPath.'/templateDetails.xml';
// try to load positions from template XML file
$xml = JFactory::getXML($templateXML);
if (is_object($xml)) {
$positions = $xml-&gt;xpath('positions/position');
if ($positions) {
foreach ($positions as $position) {
$name = (string)$position-&gt;data();
// clean name
$name = preg_replace(&quot;/(\-a|\-b|\-c|\-d|\-e|\-f)$/i&quot;, &quot;&quot;, $name);
// do not add duplicates
if(!in_array($name, $outputArray)) {
// use position name as array key?
if($nameAsKey) $outputArray[$name] = $name;
else $outputArray[] = $name;
}
}
}
}
return $outputArray;
}
</pre>
<p>Now you can use the function as:</p>
<pre class="brush: php; title: ; notranslate">
$tplPath = JPATH_SITE . '/templates/' . $this-&gt;template;
$positions = getTplPositions();
print_r($positions);
</pre>
<p>That will return  something like:</p>
<pre>Array
(
    [0] =&gt; debug
    [1] =&gt; header-top
    [2] =&gt; header
    [3] =&gt; header-bottom
    [4] =&gt; topmenu
    [5] =&gt; rsidebar-top
    [6] =&gt; rsidebar
    [7] =&gt; rsidebar-bottom
    [8] =&gt; lsidebar-top
    [9] =&gt; lsidebar
    [10] =&gt; lsidebar-bottom
    [11] =&gt; main-top
    [12] =&gt; main
    [13] =&gt; main-bottom
    [14] =&gt; component-top
    [15] =&gt; component
    [16] =&gt; component-bottom
    [17] =&gt; footer-top
    [18] =&gt; footer
    [19] =&gt; footer-bottom</pre>
]]></content:encoded>
			<wfw:commentRss>https://www.lapizcorto.com/joomla-function-to-get-template-positions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solucionar errores com_installer , com_joomlaupdate tras actualizar Joomla a 2.5.4</title>
		<link>https://www.lapizcorto.com/solucionar-errores-com_installer-com_joomlaupdate-tras-actualizar-joomla-a-2-5-4/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=solucionar-errores-com_installer-com_joomlaupdate-tras-actualizar-joomla-a-2-5-4</link>
		<comments>https://www.lapizcorto.com/solucionar-errores-com_installer-com_joomlaupdate-tras-actualizar-joomla-a-2-5-4/#comments</comments>
		<pubDate>Wed, 04 Apr 2012 12:15:32 +0000</pubDate>
		<dc:creator><![CDATA[Jiden]]></dc:creator>
				<category><![CDATA[Joomla!]]></category>
		<category><![CDATA[com_installer]]></category>
		<category><![CDATA[com_joomlaupdate]]></category>

		<guid isPermaLink="false">http://www.lapizcorto.com/?p=540</guid>
		<description><![CDATA[Tras actualizar una de nuestras páginas de Joomla empezamos a apreciar un montón de errores en la administración parecidos a: Error cargando Componente: com_joomlaupdate, 1 Error cargando Componente: com_installer, 1 Al parecer &#8220;algo&#8221; ha borrado los registros com_installer &#38; com_joomlaupdate de la tabla #__extensions. Tras obtener los registros de un Joomla 2.5.4 recién instalado y [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Tras actualizar una de nuestras páginas de Joomla empezamos a apreciar un montón de errores en la administración parecidos a:</p>
<p><span style="color: #ff0000;"><strong>Error cargando Componente: com_joomlaupdate, 1</strong></span><br />
<span style="color: #ff0000;"><strong> Error cargando Componente: com_installer, 1</strong></span></p>
<p>Al parecer &#8220;algo&#8221; ha borrado los registros com_installer &amp; com_joomlaupdate de la tabla <strong>#__extensions</strong>. Tras obtener los registros de un Joomla 2.5.4 recién instalado y restaurarlos en la base de datos que daba error desaparecen los mensajes de error.</p>
<p>Para solucionar el error ejecuta esta query de SQL reemplazando <strong>#__extensions</strong> con el nombre de tu tabla de extensiones. Por ejemplo si el prefijo de tu base de datos <strong>jml25_</strong> sustituye <strong>#__extensions</strong> con <strong>jml25_extensions</strong></p>
<pre class="brush: plain; title: ; notranslate">

INSERT INTO `#__extensions` (`extension_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `custom_data`, `system_data`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES (10, 'com_installer', 'component', 'com_installer', '', 1, 1, 1, 1, '{&quot;legacy&quot;:false,&quot;name&quot;:&quot;com_installer&quot;,&quot;type&quot;:&quot;component&quot;,&quot;creationDate&quot;:&quot;April 2006&quot;,&quot;author&quot;:&quot;Joomla! Project&quot;,&quot;copyright&quot;:&quot;(C) 2005 - 2012 Open Source Matters. All rights reserved.\\t&quot;,&quot;authorEmail&quot;:&quot;admin@joomla.org&quot;,&quot;authorUrl&quot;:&quot;www.joomla.org&quot;,&quot;version&quot;:&quot;2.5.0&quot;,&quot;description&quot;:&quot;COM_INSTALLER_XML_DESCRIPTION&quot;,&quot;group&quot;:&quot;&quot;}', '{}', '', '', 0, '0000-00-00 00:00:00', 0, 0);

INSERT INTO `#__extensions` (`extension_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `custom_data`, `system_data`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES (28, 'com_joomlaupdate', 'component', 'com_joomlaupdate', '', 1, 1, 0, 1, '{&quot;legacy&quot;:false,&quot;name&quot;:&quot;com_joomlaupdate&quot;,&quot;type&quot;:&quot;component&quot;,&quot;creationDate&quot;:&quot;February 2012&quot;,&quot;author&quot;:&quot;Joomla! Project&quot;,&quot;copyright&quot;:&quot;(C) 2005 - 2012 Open Source Matters. All rights reserved.\\t&quot;,&quot;authorEmail&quot;:&quot;admin@joomla.org&quot;,&quot;authorUrl&quot;:&quot;www.joomla.org&quot;,&quot;version&quot;:&quot;2.5.0&quot;,&quot;description&quot;:&quot;COM_JOOMLAUPDATE_XML_DESCRIPTION&quot;,&quot;group&quot;:&quot;&quot;}', '{}', '', '', 0, '0000-00-00 00:00:00', 0, 0);

</pre>
<p>Espero que a alguien le ahorre algo de tiempo.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.lapizcorto.com/solucionar-errores-com_installer-com_joomlaupdate-tras-actualizar-joomla-a-2-5-4/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Solve com_installer , com_joomlaupdate errors after Joomla 2.5.4 upgrade</title>
		<link>https://www.lapizcorto.com/solve-com_installer-com_joomlaupdate-errors-after-joomla-2-5-4-upgrade/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=solve-com_installer-com_joomlaupdate-errors-after-joomla-2-5-4-upgrade</link>
		<comments>https://www.lapizcorto.com/solve-com_installer-com_joomlaupdate-errors-after-joomla-2-5-4-upgrade/#comments</comments>
		<pubDate>Wed, 04 Apr 2012 12:04:58 +0000</pubDate>
		<dc:creator><![CDATA[Jiden]]></dc:creator>
				<category><![CDATA[Joomla!]]></category>
		<category><![CDATA[com_installer]]></category>
		<category><![CDATA[com_joomlaupdate]]></category>

		<guid isPermaLink="false">http://www.lapizcorto.com/?p=529</guid>
		<description><![CDATA[Just upgraded one of our Joomla sites and noticed that administration shows errors like: Error loading Component: com_joomlaupdate, 1 Error loading Component: com_installer, 1 Seems that &#8220;something&#8221; deleted com_installer &#38; com_joomlaupdate entries in the #__extensions table. I got the deleted values from a clean Joomla 2.5.4. install and after restoring them to the broken database [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Just upgraded one of our Joomla sites and noticed that administration shows errors like:</p>
<p><span style="color: #ff0000;"><strong>Error loading Component: com_joomlaupdate, 1</strong></span><br />
<span style="color: #ff0000;"><strong>Error loading Component: com_installer, 1</strong></span></p>
<p>Seems that &#8220;something&#8221; deleted com_installer &amp; com_joomlaupdate entries in the <strong>#__extensions</strong> table. I got the deleted values from a clean Joomla 2.5.4. install and after restoring them to the broken database all works fine again.</p>
<p>So to solve the problem you just have to run a sql query replacing <strong>#__extensions</strong> with your exact table name so if your database prefix is, for example, <strong>jml25_</strong> replace <strong>#__extensions</strong> with <strong>jml25_extensions</strong></p>
<pre class="brush: plain; title: ; notranslate">

INSERT INTO `#__extensions` (`extension_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `custom_data`, `system_data`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES (10, 'com_installer', 'component', 'com_installer', '', 1, 1, 1, 1, '{&quot;legacy&quot;:false,&quot;name&quot;:&quot;com_installer&quot;,&quot;type&quot;:&quot;component&quot;,&quot;creationDate&quot;:&quot;April 2006&quot;,&quot;author&quot;:&quot;Joomla! Project&quot;,&quot;copyright&quot;:&quot;(C) 2005 - 2012 Open Source Matters. All rights reserved.\\t&quot;,&quot;authorEmail&quot;:&quot;admin@joomla.org&quot;,&quot;authorUrl&quot;:&quot;www.joomla.org&quot;,&quot;version&quot;:&quot;2.5.0&quot;,&quot;description&quot;:&quot;COM_INSTALLER_XML_DESCRIPTION&quot;,&quot;group&quot;:&quot;&quot;}', '{}', '', '', 0, '0000-00-00 00:00:00', 0, 0);

INSERT INTO `#__extensions` (`extension_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `custom_data`, `system_data`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES (28, 'com_joomlaupdate', 'component', 'com_joomlaupdate', '', 1, 1, 0, 1, '{&quot;legacy&quot;:false,&quot;name&quot;:&quot;com_joomlaupdate&quot;,&quot;type&quot;:&quot;component&quot;,&quot;creationDate&quot;:&quot;February 2012&quot;,&quot;author&quot;:&quot;Joomla! Project&quot;,&quot;copyright&quot;:&quot;(C) 2005 - 2012 Open Source Matters. All rights reserved.\\t&quot;,&quot;authorEmail&quot;:&quot;admin@joomla.org&quot;,&quot;authorUrl&quot;:&quot;www.joomla.org&quot;,&quot;version&quot;:&quot;2.5.0&quot;,&quot;description&quot;:&quot;COM_JOOMLAUPDATE_XML_DESCRIPTION&quot;,&quot;group&quot;:&quot;&quot;}', '{}', '', '', 0, '0000-00-00 00:00:00', 0, 0);

</pre>
<p>Hope this helps.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.lapizcorto.com/solve-com_installer-com_joomlaupdate-errors-after-joomla-2-5-4-upgrade/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
