View Full Version : URL international characters problem
Ricardo
12-13-2006, 05:42 PM
There is a problem with esyndicat that has not been resolved for a long time about international characters. (I'm doing it in Portuguese)
Take a look here:
A category, or the link details with the words anúncios grátis will make an URL like this: an-ncios-gr-tis-
The right thing was to create an URL in this manner: anuncios-gratis
It is good to have the whole words showing up for Google and search engine purposes. The broken words won't be of any help for searches on Google.
I know this problem can be fixed because I use many other scripts that work properly.
Is this an easy thing to fix? If it is, just send me the code that I need to change.
Thanks,
Ricardo
Dave Baker
12-13-2006, 06:22 PM
Hello Ricardo,
The opportunity of use international characters in names of categories was realized a long time ago.
Open Admin Panel » Configuration » General Configuration » Enable path field for categories » enabled » "Save Changes" button
Admin Panel » Browse » Create Category:
Path: Have to consist of latin symbols and it will use in urls of categories.
Title: Can include international characters which will use in names of categories.
Ricardo
12-13-2006, 07:17 PM
Dave,
Thanks for the information, I remember that my previous version had the path option for categories. The new 2.0 came disabled and I didn't notice. That's working now.
The main issue is actually how to make the link title work properly in the "Link Details."
Example:
http://www.sitename.com/category/an-ncios-gr-tis-|1.html
Is there any automatic way to make the link title work properly? For categories I can edit the path manually, that's fine, but for links it would be annoying to edit each and every new link... if there was that option, I couldn't find it though.
Thanks,
Ricardo
John Turner
12-14-2006, 05:55 AM
Hi Ricardo,
Here the solution:
1. Create new field for listings via Admin Panel » Manage Listing Fields
with following information:
Name: link_path
Title: Link Path
Show On Pages: all are empty
Required Field: No
Visible for admin only: Yes
Field Type: Text
Field Length: 200
Field Default Value: need to be empty
2. Open your '../templates/{YOUR TEMPLATE}/link-display.tpl'
***find following code
<a href="{$config.base}{$config.dir}{$link.path}/{convert_str string=$link_title}-l{$link.id}.html">{$lang.link_details}</a>
***replace with following code
<a href="{$config.base}{$config.dir}{$link.path}/{if $link.link_path eq ''}{convert_str string=$link_title}{else}{$link.link_path}{/if}-l{$link.id}.html">{$lang.link_details}</a>
*** save and close it.
3. You need to edit all your links which title you want to change.
It might helps.
Ricardo
12-14-2006, 06:43 PM
That works really good!
Those keywords are very important for searches, so it's really nice to have the whole words showing up.
Thanks for your help!
Ricardo
John Turner
12-15-2006, 07:18 AM
You are welcome.
Always at your services.
Ricardo
12-18-2006, 09:26 PM
Since this is related to the topic above, let me ask here.
How can I make the Google sitemap work accordingly?
Right now the google-sitemap.php will show the URL like this:
<loc>http://www.diretorio.net/compras/an-ncios-gr-tis-l9.html</loc>
It should be:
<loc>http://www.diretorio.net/compras/anuncios-gratis-l9.html</loc>
On google-sitemap.php look for this line:
<loc>'.$gDirConfig['base'].$gDirConfig['dir'].dir_form_path($one['path'],$one['title']).'-l'.$one['id'].'.html</loc>
The problem is that it's calling the ['title'] of the link, and the title is Anúncios Grátis.
How can I call the recently created link_path instead? (the link_path is anuncios-gratis)
What do you suggest?
Thanks,
Ricardo
John Turner
12-19-2006, 05:55 AM
Hi Ricardo,
In compliance with my previous post.
You should make some changes with code.
1. open "../classes/Dir.php"
***find following code
function getSitemapLinks()
{
$sql = "SELECT cat.`path` , lcat.`id_link` id, link.`title` ";
$sql .= "FROM `{$this->mPrefix}categories` AS cat ";
***replace it with following code
function getSitemapLinks()
{
$sql = "SELECT cat.`path` , lcat.`id_link` id, link.`title`, link.`link_path` ";
$sql .= "FROM `{$this->mPrefix}categories` AS cat ";
*** Save and close it.
2. open "../google-sitemap.php"
***find following code
$feed .= '<url>';
if ($gDirConfig['mod_rewrite'])
{
$feed .= '<loc>'.$gDirConfig['base'].$gDirConfig['dir'].dir_form_path($one['path'],$one['title']).'-l'.$one['id'].'.html</loc>';
}
***replace it with following code
$feed .= '<url>';
if ($gDirConfig['mod_rewrite'])
{
$one['title'] = $one['link_path'] ? $one['link_path'] : $one['title'];
$feed .= '<loc>'.$gDirConfig['base'].$gDirConfig['dir'].dir_form_path($one['path'],$one['title']).'-l'.$one['id'].'.html</loc>';
}
*** Save and close it.
It might helps.
If you'll have any question please feel free to contact me.
Ricardo
12-19-2006, 01:04 PM
Changed evertyhing and it's working great.
I think there are no more issues with international characters.
Thanks one more time for the great support!
Ricardo
John Turner
12-20-2006, 05:53 AM
You are welcome Ricardo.
Please feel free to contact us any time.
vBulletin® v3.7.0, Copyright ©2000-2009, Jelsoft Enterprises Ltd.