Joomla FAQ

General Joomla FAQ based on own experience.

User Rating: 5 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Active

Crazy tasty spiderI had recently to switch from geany code editor to visual studio code (further VS Code). I had my geany setup to use joomla coding standards for my code formatting. I used phpcs to inform me on problems. I didn't know how to use php-cs-fixer to automatically fix issues before and I'd like to add this function.

Since I code not only for Joomla, I need to use PSR2 coding standards for non-joomla code and to use PSR2 for other PHP projects.

For example in PSR2 coding standard a statement should look like this

if (true) {
    echo "yes';
}

In Joomla, the brace must be on the new line.

if (true)
{
    echo "yes';
}

The solution was rather tricky for me. So I write this note also for myself for later reference. I had to install somethings globally, system-wide, and some only per joomla workspace (joomla installation folder where I develop my extensions). I use OpenSuSE linux, but this would not make much difference to apply the steps for another OS.

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive

spiderI used RokSprocket module with tabs layout. But it doesn't allow to select random articles on each page load. It's "random" articles means the same articles in random order on each page load. So instead of having 3 random articles in tabs, I get the same 3 ones in different order.

So I have implemented the same functionality but with real random articles in a dirty way - using 3 RegularLabs extensions (Sourcer, Tabs and Articles Anywhere) and some cutom code.

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive
Multithumb found errors on this page:

There was a problem loading image http://static.xscreenshot.com/small/2017/06/05/18/screen_feec84c36e0396d3548f67a38e13b948
There was a problem loading image http://static.xscreenshot.com/small/2017/06/05/18/screen_feec84c36e0396d3548f67a38e13b948
Joomla RSS doesn't provide a separate image field

I use zapier.com to post my Joomla article simultaniously to Facebook (RSS->Facebook group). And I face a problem, that Facebook illustrates the articles with a photo it choses on it's own (not the article photo). Zapier has an option to select an item photo, but Joomla article RSS doesn't output a separate image field.

So I used my MVC override plugin to extend Joomla and to add such a functionality. You may check this RSS feed as an example http://airsoft.in.ua/?format=feed&type=rss

A RSS part example (not bold part)

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive

xml spiderTo use own XML-defined Joomla from there are several Joomla plugins or advices. Mostly use the same couple of approaches is used.

You XML file is loaded either onContentPrepareForm (Aixeena CCK, ZUNO example) or even earlier (Form XML Override) - onAfterRoute by just adding a for search path like this JForm::addFormPath(JPATH_SITE.'/templates/system/forms/'.$option);

But these methods have one problem (or benefit, depending on the requirement) - you XML form doesn't replace the original one, but extends it. You can replace, redefine or add new fields, but never to remove a field from the original form. Besides, there is a problem with the order of newly added fields.

If you want to load your form instead of the original one, you must reset it with true parameter $form->reset(true);

This will kill the original XML. After that you are free to do like this  $form->load($yourxml); or this $form->loadFile($path_to_your_xml_file);

This is implemented in MVC Override plugin. Just install and place your override XML in the correct place.

Earlier I was younger and stupid and used a mad trick for this. The trick is found below, but please, don't tell anyone about it, because it's a shame on me.

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive

Remove joomla message from queueJoomla 3.6

I needed to remove a message already pulled to Jooma queue by JFactory::getApplication()->enqueueMessage(JText::_('JERROR_NOLOGIN_BLOCKED'), 'warning');

I found a solution here http://www.compago.it/manuali/33-programmazione/382-how-to-create-and-delete-message-in-joomla.html and made it a little more universal:

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive

Cerbalus-aravensis-spider-photo-3 Task

Get original Joomla URL from a SEF one. I.e. I want to know which is the real joomla URL, while the SEF one is http://sandbox2.com.us/index.php/weblinks-component

This may be needed while developing or making modifications in Joomla extension to use the real internal joomla link.

Solution for Joomla 3

The code below alswo works in most cases, but at least once I've met a strange behaviour - url parts were messed up with some Google Analytics variable. So I gave up using it

Result in $url: index.php?Itemid=229&option=com_contact&view=contact&id=1

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive
Multithumb found errors on this page:

There was a problem loading image http://static.xscreenshot.com/2016/03/07/16/screen_4063dcccbdc913660331e2914070b38e
There was a problem loading image http://static.xscreenshot.com/2016/03/07/16/screen_4063dcccbdc913660331e2914070b38e

screen_4063dcccbdc913660331e2914070b38eI needed to update a plugin settings upon an extension installation. Here is a sample of my code.

The problem was a little harder to solve, because of the nested objects in the params object.

The screenshot is hear for better understanding of my data structure.

User Rating: 5 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Active

save spiderWhen established a multilanguage Joomla web-sites (using native language feature), I met a high CPU load with even the system cache plugin enabled. Looking into logs, I found there was a number of bot entries like

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive
Multithumb found errors on this page:

There was a problem loading image http://static.xscreenshot.com/2015/08/23/11/screen_e4119feb1b20277b92eb2f732c6e0737
There was a problem loading image http://static.xscreenshot.com/2015/08/23/11/screen_e4119feb1b20277b92eb2f732c6e0737

asI could not find where to download an AkeebaSubscriptions installable package. Akeeba website provides text 'Only PHP source code is provided' and a link to GitHub. The GitHub repo has a complicated instruction how to build a package.

So I created a small bash script to automatically initialize needed repos and to build the latest package. Surely needed dependencies (like PEAR libraries) still need to be installed manually.
screen_e4119feb1b20277b92eb2f732c6e0737

Run the script in an empty folder and get a resulting zip file. The code I use is below

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive

SpiderAfter migrating a Joomla 1.5 web-site to Joomla 2.5 and next to Joomla 3.1 I have tried to install AkeebaBackup or PhocaGallery. Both installations gave the same error:

Error building Admin Menus

I digged tones of forum posts most of which recommended to remove any records tied to the problematic components from #__assets and #__menu. But there were no records about my components. Finally I found a solution!

FaLang translation system by Faboba
ОУН-УПА: легенда спротиву Українська Дивізія «Галичина» Зиновій Книш: спогади й матеріали до діяння УВО і ОУН Реаніматор електронних текстів Забуттю не підлягає 1917-1991

See a typo?

Select the text block and press

CTRL+Enter

Comments

  • MVC Override - change joomla extensions behaviour without changing core files

    gruz gruz 12.11.2018 21:01
    Hi. It was not working for the filter_tags.xml Try the latest RC ...

    Read more...

     
  • MVC Override - change joomla extensions behaviour without changing core files

    rogerco rogerco 12.11.2018 17:18
    Hi, Having difficulty seeing how to override an XML form file on the admin site. Trying to replace ...

    Read more...

     
  • bxSlidary - slider for Phoca Gallery with Ajax sliders load

    ferry ferry 08.11.2018 01:12
    Helo, Sorry for late response. I reinstalled the phocagallery component (uninstall and then reinstall ...

    Read more...

     
  • bxSlidary - slider for Phoca Gallery with Ajax sliders load

    gruz gruz 06.11.2018 05:45
    Hi. The module was developed 2 years ago for a project, which is dead now. It seems you are the only ...

    Read more...

     
  • bxSlidary - slider for Phoca Gallery with Ajax sliders load

    ferry ferry 06.11.2018 05:37
    Hi, I've installed this module, but the gallery didn't showup. I activated the debug, but can not ...

    Read more...