Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#25 2015-09-25 08:25:05

Pyanepsion
New Member
From: Clermont-Ferrand
Registered: 2015-09-22
Posts: 7
Website

Re: Image name instead ID in html

The big CMS always know, at one time or another, major changes to correct errors of the initial codage.

By example, Wordpress has seen a major change in his script with version 3. We must also understand that the more time passes, more it becomes complicated to fix bugs departure. The mismanagement images is one. This update dish will probably not without difficulty and will require perhaps, as sometimes sees a conversion routine of the old system to the new.

This is a very important point that I think should become a priority to achieve during the next release.

It is unthinkable today that the URL of an image on a page, a script, and more generally a file to be reinterpreted by the script without our consent :
— If one wants to write for an image “/photo/my-image.png”, it must not become “http://example.com/photo/my-image.png” or worse “http://example.com/ image /1873 / my-image.png “or really worse” http://example.com/ image/1873.png “.
— If one wants to write for a CSS “style/screen.css”, it must not become “http://example.com/css.php?n=default”, etc.

This is all the more important that it can make the difference in SEO with some American, Chinese, or Russian search engines.


Mais je vous le demande : peut-on encore parler de police sans sérifs ?

Offline

#26 2015-09-25 12:11:18

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,687
Website GitHub Twitter

Re: Image name instead ID in html

The problem, as mentioned a number of times here, is duplicate image names. How do you propose to solve it? There are sites with thousands of images which makes name duplication possible. Also there are non web savvy users who use spaces or special (or restricted) characters for their images.

The txp method might not be the most SEO friendly but I find it to be the safest if we want to attract the average Joe who just want to either create or just update their website easily.

As always I am not absolute re this matter but I also think that it is not something that it can’t be ‘solved’ hastily. Food for thought.


Yiannis
——————————
neme.org | hblack.net | State Machines | NeMe @ github
I do my best editing after I click on the submit button.

Offline

#27 2015-09-25 13:15:57

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,171
Website

Re: Image name instead ID in html

You’re absolutely right in that the longer one waits, the more difficult it becomes to change. I wasn’t necessarily defending the numbering scheme used by txp, just noting that it’s not a simple fix and not without repercussions. Whether its mismanagement or just a different management approach is debatable.

If you want to achieve full-text image names in your source code at this point in time, the rewriting scheme discussed in this thread is one possible solution. In addition, it is one you could expand to accommodate language-specific seo requirements: just adjust the htaccess rewriting scheme and adapt your image names accordingly.

For the record, there’s nothing stopping you using folders and flat files, they just won’t be managed through txp. The disadvantage is you can’t then use the various image output and organisation tags.

The css is more straightforward: you can use an /assets/styles/screen.css-type setup and simply link to them directly from your template. If you don’t want to lose the ability to use the presentation tab to edit them (I personally prefer to use a code editor), you can also use rvm_css to maintain flat file css through the admin area.


TXP Builders – finely-crafted code, design and txp

Offline

#28 2016-04-18 09:55:59

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: Image name instead ID in html

maniqui wrote #288593:

Hi all,
I’ve rewritten the regex a bit, to have just one rule to rule them all. :P
Test and report back :)

See also the other half for this trick (on how to implement SEO/human-friendly URLs for images).

Thanks Julián; unfortunatly the regex didn’t work for me but the following is ok RewriteRule ^(.+[/])?([0-9]+t?)(?:[-/]).+(png|gif|je?pg|bmp|webp)$ $1$2.$3 [NC,L] (I don’t use smd_thumbnail).

Edit: for ovh hosting some .htaccess changes are needed

Last edited by NicolasGraph (2016-10-05 13:40:33)


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#29 2018-05-17 06:48:34

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,687
Website GitHub Twitter

Re: Image name instead ID in html

After watching this TED talk on how google reads images for its search results, I am bringing back this thread with an idea. What if the image names were using the site name as a prefix? ie something like site_name_134.jpg. If we used this method, the images would be site branded.

> Edit: Scrap that as it will make changing of domain names a real nightmare!

Last edited by colak (2018-05-17 12:28:00)


Yiannis
——————————
neme.org | hblack.net | State Machines | NeMe @ github
I do my best editing after I click on the submit button.

Offline

#30 2018-05-18 09:21:59

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 10,481
Website GitHub

Re: Image name instead ID in html

colak wrote #311861:

Scrap that as it will make changing of domain names a real nightmare!

I was wondering that! Very thoughtful talk though, as it shows the fragility of search results from a moral standpoint. Thanks for sharing.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

Board footer

Powered by FluxBB