Pretty URLS running .... but... one question!

General project discussion. NOT for help questions.
STW_andrew
New Member
New Member
Posts: 3
Joined: Fri Mar 14, 2008 9:15 pm

Re: Pretty URLS running .... but... one question!

Post by STW_andrew »

Well the thing is any image I select, the address is reverted to uploads/images/EE-large.jpg in the image window and is unviewable.

the image is viewable outside of the news portion and on itself [http://www.spottheweasel.com/uploads/im ... -large.jpg] but in thre confines of the news articles it's thrown off.
nivekiam

Re: Pretty URLS running .... but... one question!

Post by nivekiam »

You have 4 options:

1) Use absolute URLs, if using the insert image function of TinyMCE or some other WYSIWYG editor you may need to edit the URL after inserting the image.
Example:
2) put a forward slash at the beginning of the path, if using the insert image function of TinyMCE or some other WYSIWYG editor you may need to edit the URL after inserting the image.
Example:
/uploads/images/EE-large.jpg
3) put the {metadata} tag back into your template, log into your Admin Panel, go to Extensions > Tags and lookup the metadata tag for more info.  This will, by default, put a base tag in your meta data.  You could also manually put a base tag in your meta data.
Example:
4) don't use Pretty URLs for News.
STW_andrew
New Member
New Member
Posts: 3
Joined: Fri Mar 14, 2008 9:15 pm

Re: Pretty URLS running .... but... one question!

Post by STW_andrew »

Ahhh, kay. Option 3 did it. Thanks  :D
smiley
New Member
New Member
Posts: 9
Joined: Wed Feb 06, 2008 11:22 am

Re: Pretty URLS running .... but... one question!

Post by smiley »

Zappa wrote: I've tried the pretty url modification as Nivekiam has given instruction for but I have characters in the title of my news articles with special characters such as £, $, !. These special characters are showing in the url so is there a way how to strip out any characters which are not in the alphabet so you can have a url like /news/hello-world instead of /news/hello-world!

Thanks
I have same problem. because there is many special characters in my news title.

But instead of that, maybe is solution to put news title with special character in window title.
On my last internet project I used Cute News. It didnt had pretty urls, but I put news title on top of window explorer (example: CMS Made Simple Forum: Pretty URLS running ....)   And it works for SEO engines!

So, it would be great to have pretty urls with special characters, but permanently solution could be to put news title on top of internet browser.
If I found solution how to do this, I will let you know
smiley
New Member
New Member
Posts: 9
Joined: Wed Feb 06, 2008 11:22 am

Re: Pretty URLS running .... but... one question!

Post by smiley »

I found solution for special characters.
Actually, it is on this link: http://forum.cmsmadesimple.org/index.ph ... 01279.html

Make changes in other files like fritzfs says.
Edit file modules/News/action.default.php at about line 312 and replace with this: (and put your special characters)

Code: Select all

$prettyurl = 'news/'. $onerow->title .'/'.$row['news_id'].'/'.($detailpage!=''?$detailpage:$returnid);	
	
    $prettyurl = str_replace('ė', 'e', $prettyurl);
    $prettyurl = str_replace('ą', 'a', $prettyurl);
    $prettyurl = str_replace('č', 'c', $prettyurl);
    $prettyurl = str_replace('ę', 'e', $prettyurl);
    $prettyurl = str_replace('į', 'i', $prettyurl);
    $prettyurl = str_replace('š', 's', $prettyurl);
    $prettyurl = str_replace('ų', 'u', $prettyurl);
	$prettyurl = str_replace('ū', 'u', $prettyurl);
	$prettyurl = str_replace('ž', 'z', $prettyurl);
   
$prettyurl = str_replace('Б', 'b', $prettyurl);
$prettyurl = str_replace('В', 'v', $prettyurl);
$prettyurl = str_replace('Г', 'g', $prettyurl);
$prettyurl = str_replace('Д', 'd', $prettyurl);
$prettyurl = str_replace('Е', 'e', $prettyurl);
$prettyurl = str_replace('Ё', 'e', $prettyurl);
$prettyurl = str_replace('Ж', 'zh', $prettyurl);
$prettyurl = str_replace('З', 'z', $prettyurl);
$prettyurl = str_replace('И', 'i', $prettyurl);
$prettyurl = str_replace('Й', 'i', $prettyurl);
$prettyurl = str_replace('К', 'k', $prettyurl);
$prettyurl = str_replace('Л', 'l', $prettyurl);
$prettyurl = str_replace('М', 'm', $prettyurl);
$prettyurl = str_replace('Н', 'n', $prettyurl);
$prettyurl = str_replace('О', 'o', $prettyurl);
$prettyurl = str_replace('П', 'p', $prettyurl);
$prettyurl = str_replace('Р', 'r', $prettyurl);
$prettyurl = str_replace('С', 's', $prettyurl);
$prettyurl = str_replace('Т', 't', $prettyurl);
$prettyurl = str_replace('У', 'u', $prettyurl);
$prettyurl = str_replace('Ф', 'f', $prettyurl);
$prettyurl = str_replace('Х', 'kh', $prettyurl);
$prettyurl = str_replace('Ц', 'ts', $prettyurl);
$prettyurl = str_replace('Ч', 'ch', $prettyurl);
$prettyurl = str_replace('Ш', 'sh', $prettyurl);
$prettyurl = str_replace('Щ', 'shch', $prettyurl);
$prettyurl = str_replace('Ы', 'y', $prettyurl);
$prettyurl = str_replace('Э', 'e', $prettyurl);
$prettyurl = str_replace('Ю', 'yu', $prettyurl);
$prettyurl = str_replace('Я', 'ya', $prettyurl);
$prettyurl = str_replace('а', 'a', $prettyurl);
$prettyurl = str_replace('б', 'b', $prettyurl);
$prettyurl = str_replace('в', 'v', $prettyurl);
$prettyurl = str_replace('г', 'g', $prettyurl);
$prettyurl = str_replace('д', 'd', $prettyurl);
$prettyurl = str_replace('е', 'e', $prettyurl);
$prettyurl = str_replace('ё', 'e', $prettyurl);
$prettyurl = str_replace('ж', 'zh', $prettyurl);
$prettyurl = str_replace('з', 'z', $prettyurl);
$prettyurl = str_replace('и', 'i', $prettyurl);
$prettyurl = str_replace('й', 'i', $prettyurl);
$prettyurl = str_replace('к', 'k', $prettyurl);
$prettyurl = str_replace('л', 'l', $prettyurl);
$prettyurl = str_replace('м', 'm', $prettyurl);
$prettyurl = str_replace('н', 'n', $prettyurl);
$prettyurl = str_replace('о', 'o', $prettyurl);
$prettyurl = str_replace('п', 'p', $prettyurl);
$prettyurl = str_replace('р', 'r', $prettyurl);
$prettyurl = str_replace('с', 's', $prettyurl);
$prettyurl = str_replace('т', 't', $prettyurl);
$prettyurl = str_replace('у', 'u', $prettyurl);
$prettyurl = str_replace('ф', 'f', $prettyurl);
$prettyurl = str_replace('х', 'kh', $prettyurl);
$prettyurl = str_replace('ц', 'ts', $prettyurl);
$prettyurl = str_replace('ч', 'ch', $prettyurl);
$prettyurl = str_replace('ш', 'sh', $prettyurl);
$prettyurl = str_replace('щ', 'shch', $prettyurl);
$prettyurl = str_replace('ы', 'y', $prettyurl);
$prettyurl = str_replace('э', 'e', $prettyurl);
$prettyurl = str_replace('ю', 'yu', $prettyurl);
$prettyurl = str_replace('я', 'ya', $prettyurl);
$prettyurl = str_replace('Ъ', '', $prettyurl);
$prettyurl = str_replace('ъ', '', $prettyurl);
$prettyurl = str_replace('Ь', '', $prettyurl);
$prettyurl = str_replace('ь', '', $prettyurl);
    $prettyurl = preg_replace("/[^A-Za-z0-9\/]/","-", $prettyurl);
Post Reply

Return to “General Discussion”