Skip to content

Instantly share code, notes, and snippets.

View phproberto's full-sized avatar

Roberto Segura phproberto

View GitHub Profile
@phproberto
phproberto / explanation.md
Created October 27, 2017 11:54
Dummy router for Jooma Blank Component causing no 404 pages

Reproduce the issue:

  • You have Blank Component assigned to the home page of your Joomla! site.
  • When you manually enter a wrong url you don't get any 404 error. Your site redirects all the non-existing urls to the home page.

Explanation

Joomla redirects all the non-existing urls to the router of the component assigned as home page. Blank component does not have a router so you just get redirected to the home page.

This is a dummy empty router that will force an empty option be set if the component router is called to parse any url. This should not break anything because Blank Component cannot work without a menu item assigned to it. It only ensures that the router does not parse any url.

@phproberto
phproberto / plg_system_test.php
Last active November 27, 2017 21:20
Experimento de cambio del formato de RSS para Ciro
<?php
/**
* The update check and notification email code is triggered after the page has fully rendered.
*
* @return void
*/
public function onAfterRender()
{
$app = JFactory::getApplication();
@phproberto
phproberto / blog.php
Last active February 15, 2018 10:56
Joomla: Use custom field for layout in category view
<?php
/**
* @package Joomla.Site
* @subpackage com_content
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;