I'm using Jsitemap and SH404sef, and found that the XML sitemap was rendering as HTML rather than XML.
To fix this, go to the configuration options in SH404SEF, General > Advanced tabs and ensure that the setting '301 redirects from non-SEF to SEF' in the configuration of sh404sef is not enabled.
If you still experience issues after changing this setting you can also change the sh404sef settings: configuration > by component and choose 'Leave as non-sef' or 'Use Joomla router' for Jmap.
Additionally, within the Jsitemap settings Configuration > Advanced settings it's important to ensure that the following parameter is disabled and set to 'No' as by default in order to always use native raw links for each sitemap:
Set the Join table #1 for the where condition filter 'id' = your category ID that is 1 category that should be included
Here's a handy feature of JCE to make it display the name of each HTML element and container as they are used in the text editor.
K2 extra fields can be a royal pain sometimes. They are not nearly as flexible as they should be. For instance, using the image extra field spits renders the image inside it's <img src /> tags. But what if you just want the URL of the image? Perhaps you need the image URL to use inside a CSS background image. Here's how:
Note that the alias of the extra field in my example is myImage. Change this to match your own custom field alias.
Also note that I am using this code inside a mod_k2_content module.
<?php
$fetchSrc1 = explode('src="', $item->extraFields->myImage->value);
$fetchSrc2 = explode('"', $fetchSrc1[1]);
?>
<?php echo $fetchSrc2[0]; ?>
For using on K2 item pages, replace the first line with the following:
$fetchSrc1 = explode('src="', $this->item->extraFields->myImage->value);
Sometimes you need to know the category of the current K2 item, but reneder this information outside of the K2 template files. To check anything K2 outside of the K2 container, the code below is a good starting point.
By expanding this code a bit, you can check for all sorts of things, always from outside of the K2 container. For instance, I can use the following inside the <head> tags to trigger something specific to an item.
<?php
// Check if the item belongs to a specific category
// Gets component, view, and ID from the non-SEF URL
$whatComp = JFactory::getApplication()->input->get('option');
$whatView = JFactory::getApplication()->input->get('view');
$whatId = JFactory::getApplication()->input->get('id');
// Check if you are on K2 and viewing an item
if($whatComp == 'com_k2' && $whatView == "item") {
// Check the database for the category ID of the current K2 item
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('catid');
$query->from($db->quoteName('#__k2_items'));
$query->where($db->quoteName('id')." = ".$db->quote($whatId));
$db->setQuery($query);
$myCatID = $db->loadResult();
// The number to be compared below is the ID of the category
if($myCatID == '17') {
// do something
}
}
?>
<?php
$parent = JTable::getInstance('K2Category', 'Table');
$parent->load($this->category->parent);
echo $parent->name;
?>
Using FTP to regain access to your site's administrator, The failsafe way to regain access to your site's administrator backend is using an FTP application or your hosting control panel's File Manager to rename a file.
Go inside the plugins/system/admintools/admintools directory on your site (on older versions of Admin Tools: plugins/system/admintools). You will see a file named main.php. Rename it to main-disable.php. This will turn disable the Web Application Firewall from executing and you can access your site's back-end again.
After you have fixed the cause of your issue remember to rename main-disable.php back to main.php, otherwise your site will remain unprotected!
I've been working on a website that uses Mijoshop (the Joomla e-Commerce and shopping cart component built using Opencart). Problems occurred when I wanted to use product images as CSS background images, rather than HTML images. The client had uploaded a bunch of images that contained spaces within the file names, making them unsuitable to be used in the CSS background-image property (which just left empty white spaces where the images should have appeared(. There were so many that it just wasn't feasable to rename them manually, so I needed to figure out an automated solution, which became a three step process:
I found this opencart ocmod script that removes spaces from any images uploaded. It worked great and was easy to install directly using the extensions installer from Mijoshop main menu. The file can be found here.
Whilst this ensured that any images uploaded from this point on wouldn't have any spaces withn the filenames, this script didn't fix the problem for any images already uploaded into the Opencart catalog. The next step in this solution addresed that problem.
I found a handy program called Rename-it! which made easy work of btach removing all spaces in the exisiting files. I tested this locally on desktop rather than applying it directly to the server. Rename-It! is free, easy to use, and also didn't install any crappy third party bloat software. Too easy!
The tables in the website database need to match the newly renamed files. We can do this with a simple SQL find and replace script that removes the spaces in the filenames. make sure to change the table name and column name to match those used by your website
UPDATE table_name
SET image = REPLACE(column_name, ' ', '');
The default Joomla contact form component does allow us to modify it slightly and add new fields to the contact form. New fields are contained within a field group. Follow the steps below and view the video tutorial for further explanation on these concepts.
This tutorial will show you how to embed a video into a Gantry particle position on a Joomla website. This tutorial does require the website to have installed the Joomla Works All Videos plugin.
Whilst in this tutorial I use a video that is hosted on Youtube, the same concepts can be slightly modified for any videos that are hosted on your own web server. For a deeper explanation of the differences I suggest watching my previous tutorial Embedding locally hosted videos on a Joomla website.