PHP Classes

Thanks for the article

Recommend this page to a friend!

      PHP Classes blog  >  10 Tips to Adapt PHP ...  >  All threads  >  Thanks for the article  >  (Un) Subscribe thread alerts  
Subject:Thanks for the article
Summary:Thanks for the article
Author:Louis Mahe
Date:2015-04-16 12:57:08
Update:2015-04-17 03:56:32

  1. Thanks for the article   Reply   Report abuse  
Picture of Louis Mahe Louis Mahe - 2015-04-16 18:27:56
Many thanks for this article that came really at the precise moment I needed it ! Moreover, the article was really well written and easy to follow.

I was not at all concerned with being kind to Google : on the opposite, Google is forbidden on my site, which is a scholar work space with restricted access and doesn't need any advertising. But more and more users are
using mobiles to access the site, and the result was really bad. Now it is nearly perfect, but on top of css and media queries (which also work in js, at least on Firefox) I had also to developp some tricks to keep the stuff staying inside the width of the page.

For instance I had to split long words in order for them to fit in the room they were supposed to be.
For that purpose, I choosed to insert invisible white space at many points in the words to let the words split when the width of the page is getting down. I looked for a single character for doing that (like the word-breaking command \- of Tex) but I did'nt find anything else that the stupid html thing : <span style="font-size:1%;"> </span>. Then I added this "short space" to some particular characters like "-,_,." to break file names, and in the middle of some pairs like "ss,nn,mm".
You have to be carefull in doing that since you don't want to break the html code (for instance you cannot break "sp" because of the many "span" you have in the code).

Another major problem was the size of the images : these images are posted by the users, using ckeditor together with fileman, and the size of the images is written in pixel and thus has a fixed size. So I had to make a function to recognize the width and height in the html code and transform the px-size in the right %-size.

But eventually it works fine and this is great ! Thanks again.

  2. Re: Thanks for the article   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2015-04-17 03:56:32 - In reply to message 1 from Louis Mahe
Yes, unfortunately not all content can be adapted to mobile devices just with some CSS tricks.

Sometimes you have to manually tweak the content, especially when it is contributed by the users. That is frustrating because it is time consuming.

At least now Google tells you what pages in your sitemap are not yet mobile friendly, so you do not have to wonder too much.