This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.
Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.
Before posting questions here you might want to review the developer documentation.
This is really a very small issue.
I was adding some images to an Image Gallery Module.
The way we had the images stored on our network is with spaces between the words.
example: "sally sells seashells - at the seashore.jpg"
I noticed the ToCleanFileName strips the whitespaces... so the file looses some "meaning" to google
"sally sells seashells - at the seashore.jpg" --> "sallysellsseashells-attheseashore.jpg".
I removed a the .Replace(" ", string.Empty) and added a regex replace
string pattern = @"(\s)+(-)*(\s)*"; return Regex.Replace(s, pattern, "-")
this makes the file name a little better from a web perspective
"sally sells seashells - at the seashore.jpg" --> "sally-sells-seashells-at-the-seashore.jpg"
I know the base cause is the way we name images on our local network, but thought in the case of files served by the web server that "-" for spaces is better
Thoughts?
Hi Warner,
I will change it replace multiple spaces with a single space and then to replace single spaces with - instead of empty string. It is a good idea.
Best,
Joe
Glad I could help~ :)
i noticed that
public static string ToCleanFileName(this string s, bool forceLowerCase)
and
public static string ToCleanFolderName(this string s, bool forceLowerCase)
Do not convert the space to dash. I would think these 2 should.
thoughts?
sounds reasonable to me, I will make that change.
Will make for some longer urls... but i think the added SEO benefit will be enjoyed by everyone. :)