Showing posts with label Module. Show all posts
Showing posts with label Module. Show all posts

Wednesday, 17 July 2013

Use Module Title as link in Joomla 1.6 , 1.7 , 2.5

1 – Open your module .xml file  example - modules/mod_articles_news/mod_articles_news.xml
2 –  Add the following line between the first set of <fieldset name=”basic”></fieldset> tags
<field name="title_link" type="text" default="" label="Title link" description="" />
Save your XML file.
3 – Now go to templates/system/html/modules.php open it & find the xhtml function or find this line “ xhtml (divs and font headder tags) ” here you can find this function
function modChrome_xhtml($module, &$params, &$attribs)
{
 if (!empty ($module->content)) : ?>
  <div class="moduletable<?php echo htmlspecialchars($params->get('moduleclass_sfx')); ?>">
  <?php if ($module->showtitle != 0) : ?>
   <h3><?php echo $module->title; ?></h3>
  <?php endif; ?>
   <?php echo $module->content; ?>
  </div>
 <?php endif;
}

& replace with
function modChrome_xhtml($module, &$params, &$attribs)
{
 if (!empty ($module->content)) : ?>
  <div class="moduletable<?php echo htmlspecialchars($params->get('moduleclass_sfx')); ?>">
  <?php if ($module->showtitle != 0) : ?>
   <?php $title_link = $params->get('title_link'); ?>
   <h3><?php if($title_link) { ?> <a href="<?php echo $params->get('title_link');  ?>"> <?php } ?><?php echo $module->title; ?><?php if($title_link) { ?></a><?php } ?></h3>
  <?php endif; ?>
   <?php echo $module->content; ?>
  </div>
 <?php endif;
}

4 – now you have link area in your module basic parameter add your link  :)
Conclusion - Its very simple hack  or trick in joomla i hope in joomla! 3.0 joomla add this feature by default :) if you get any kind of issue or can’t get right result kindly leave your comment or contact with me thanks

Tuesday, 16 July 2013

Use sh404SEF to create friendly web link

One of the most way to SEO an webpage is create an friendly web link. With Joomla, we can choice sh404SEF component as a best solution.
This is step by step how to use it.



  1. Download load sh404SEF 4.1.0.1559  here. This version is used for Joomla 2.5 and 3.0
  2. Install this component into your Joomla website


  3. Enter sh404SEF Control Panel by this way: menu Component->sh404sef->Control Panel

  4. At Quick Start tab, choice all are Yes, and Rewriting mode is with .htaccess (mod_rewrite), then Press Start button
  5. Now press Configuration Button at top right and choice tab General->Main. At Character replacements list add more these characters:
    , á|a, à|a, ả|a, ã|a, ạ|a, â|a, ấ|a, ầ|a, ẩ|a, ẫ|a, ậ|a, ă|a, ắ|a, ằ|a, ẳ|a, ẵ|a, ặ|a, đ|d, é|e, è|e, ẻ|e, ẽ|e, ẹ|e, ê|e, ế|e, ề|e, ể|e, ễ|e, ệ|e, í|i, ì|i, ỉ|i, ĩ|i, ị|i, ó|o, ò|o, ỏ|o, õ|o, ọ|o, ô|o, ố|o, ồ|o, ổ|o, ỗ|o, ộ|o, ơ|o, ớ|o, ờ|o, ở|o, ỡ|o, ợ|o, ú|u, ù|u, ủ|u, ũ|u, ụ|u, ư|u, ứ|u, ừ|u, ử|u, ữ|u, ự|u, ý|y, ỳ|y, ỷ|y, ỹ|y, ỵ|y, Á|A, À|A, Ả|A, Ã|A, Ạ|A, Â|A, Ấ|A, Ầ|A, Ẩ|A, Ẫ|A, Ậ|A, Ă|A, Ắ|A, Ằ|A, Ẳ|A, Ẵ|A, Ặ|A, Đ|D, É|E, È|E, Ẻ|E, Ẽ|E, Ẹ|E, Ê|E, Ế|E, Ề|E, Ể|E, Ễ|E, Ệ|E, Í|I, Ì|I, Ỉ|I, Ĩ|I, Ị|I, Ó|O, Ò|O, Ỏ|O, Õ|O, Ọ|O, Ô|O, Ố|O, Ồ|O, Ổ|O, Ỗ|O, Ộ|O, Ơ|O, Ớ|O, Ờ|O, Ở|O, Ỡ|O, Ợ|O, Ú|U, Ù|U, Ủ|U, Ũ|U, Ụ|U, Ư|U, Ứ|U, Ừ|U, Ử|U, Ữ|U, Ự|U, Ý|Y, Ỳ|Y, Ỷ|Y, Ỹ|Y, Ỵ|Y
  6. It has many options, but you can use default.
  7. Go to you File Manager on your hosting, Edit file htaccess.txt - Find code:
        ########## Begin - Joomla! core SEF Section
    #
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !^/index.php
    RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$ [NC]
    RewriteRule (.*) index.php
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
    #
    ########## End - Joomla! core SEF Section
    
    
    And replace by this code:
    
    
    ########## Begin - Joomla! core SEF Section
    #
    #RewriteCond %{REQUEST_FILENAME} !-f
    #RewriteCond %{REQUEST_FILENAME} !-d
    #RewriteCond %{REQUEST_URI} !^/index.php
    #RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$ [NC]
    #RewriteRule (.*) index.php
    #RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
    #
    ########## End - Joomla! core SEF Section
    #
    ########## Begin - 3rd Party SEF Section
    ############# Use this section if you are using a 3rd party (Non Joomla! core) SEF extension - e.g. OpenSEF, 404_SEF, 404SEFx, SEF Advance, etc
    #
    RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional - see notes##
    RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$ [NC]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule (.*) index.php
    #
    ########## End - 3rd Party SEF Section
    
    
    
    
  8. Change name of htaccess.txt to .htaccess
  9. Turn off all SEO Setting in Global Configuration of Joomla.
Done. Now you can check you web link again.

Wednesday, 10 July 2013

Fix error "Could not create directory" on Joomla

Sometime, Installing an extension we have error about "Could not create directory" like this:

This tutorial will show you how to solve the problem 
"JFolder::create: Could not create directory"
or 
"JFolder::create: Path not in open_basedir paths; Unable to create destination" in Joomla.
Firstly:
If you have tried everything else on your installation (changing the $log_path to ./log, change $tmp_path to ./tmp (in  configuration.php file, chmod folders to 777) and you still can't install any module or component in Joomla, then continue reading.
This solution is helpfull if you can't change the ownership of the files and directories on your server (usually shared hosts) and you don't want to wait for help from your hosting provider.

If it still error or have new error, It means you have to do next step.

First you need to chmod to 777 the following directories:
/administrator/backups/
/administrator/components/
/administrator/language/
/administrator/language/en-GB/
/administrator/modules/
/administrator/templates/
/components/
/language/
/language/en-GB/
/modules/
/plugins/
/plugins/content/
/plugins/editors/
/plugins/editors-xtd/
/plugins/search/
/plugins/system/
/plugins/user/
/plugins/xmlrpc/
/tmp/
/templates/
/cache/
1. Open "your-website.com/libraries/joomla/filesystem" with your default FTP client.
Please make backup of the file first.
2. Download filename "folder.php".
3. Open folder.php in your default text editor
4. Go to line 210
5. Look for:     " if (strpos($path, $test) === 0) { "  and change it to "if (strpos($path, $test) === 1) { "
6. Than look for (line 216):  " if ($inBaseDir == false) { "  and change to  " if ($inBaseDir == true) { "
7. Save your file (folder.php)
8. Upload it to the location "your-website.com/libraries/joomla/filesystem". 

That's it!
No more errors when you want to install any component, plugins, module, etc.. in backend of joomla

Saturday, 6 July 2013

Hide list Catelogy on result Search page format

When we use Virtuemart_search module, list of catelogy will be showed before result list.
Some case, I want to hide this catelogy list and only show result list. This solution I found on internet.

In search module \modules\mod_virtuemart_search\tmpl\default.php  line 4 says:

Code:
<form action="<?php echo JRoute::_('index.php?option=com_virtuemart&view=category&search=true&limitstart=0&virtuemart_category_id='.$category_id )
The result of search is intended to be shown in category view. So, what do we have here? $category_id=0 (parent category!) and sub-categories on top of the default category view, then the list of products (if any), found in our search.

Temporary solution: if we don't need categories in category view, at least in our search result, check if it is a search request. Change line 72 in \components\com_virtuemart\views\category\tmpl\default.php from this:

Code: 
if(!empty($this->category->children)){
to this:

Code:
if(!empty($this->category->children ) && !(boolean)JRequest::getVar('search', false)){

This is my result