News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Viewport Tag

Started by NeedIt, April 12, 2015, 11:24:15 AM

Previous topic - Next topic

NeedIt

I am getting dinged on my site by Google, because I needed to add a viewport meta tag.  This forces the web pages on my site to render correctly for mobile devices.My SMF 2.0 Forum is not rendering correctly by Google's standards either and I need to change it asap or they will undoubtedly start unranking my forum pages. 

Can you please advise?  How do I add that viewport meta tag into the forum?

NOTE:  I have the basic, default theme and have only the Ad Management package.

Here is the actual html statement that I need to add:

<meta name="viewport" content="width=device-width, initial-scale=1">

Also, google mentions small font size as an issue, but I am not worried about that for now.  I feel that if I can just figure out how to add the above that Google will take me off their hit list.

Kindred

basically, none of the 2.0 standard themes will be "mobile friendly" by Google's (IMO rather silly and unrealistic) standards.

there are several responsive themes for 2.0... however, very few, if any, mods support responsivve design - so, the moment you add a mod, it will "break" the responsiveness of the theme (and yes, I suspect that the ad manager mod is one of those)

If you actually think that line is all that you have to add is that one -- then you would add it in the theme's index.template.php  -- but I suspect that is not going to be sufficient for google
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

NeedIt

Quote from: Kindred on April 12, 2015, 11:28:46 AM
basically, none of the 2.0 standard themes will be "mobile friendly" by Google's (IMO rather silly and unrealistic) standards.

there are several responsive themes for 2.0... however, very few, if any, mods support responsivve design - so, the moment you add a mod, it will "break" the responsiveness of the theme (and yes, I suspect that the ad manager mod is one of those)

If you actually think that line is all that you have to add is that one -- then you would add it in the theme's index.template.php  -- but I suspect that is not going to be sufficient for google

Thx Kindred.  I am going to check out the index.template.php. 

My guess - and this is strictly a guess - is that this will be good enough.  I think it is unrealistic for them to expect all forum communities to instantly change overnight.  I just believe they are pushing everyone in that direction.  But, if you look at what that viewport setting does, it actually does make a big difference in mobile experience and, furthermore, it is very easy for their bot to check.  Checking font/pixel size has got to be a much more problematic algorithm for them, but the viewport is a no brainer.

NeedIt

That worked very well for anyone else who reads this.  I just pasted the statement into the index.template.php file in the appropriate spot and it worked great.  (Made a backup first of course.)

Topman


peterwaalker

Please what line in the index.template.php should I add the code below to fake responsiveness of my forum.
Needlt has done his own right with the code he got from Google webmaster tools.
I will not be bothered about fonts. What is bothering me now is auto size adjustment for devices.
Im using SMF 2.0.x Anecdota 20g theme.
Thanks

meta name="viewport" content="width=device-width, initial-scale=1"


Quote
<meta name="viewport" content="width=device-width, initial-scale=1">

Kindred

theme specific questions should be requested in the thread dedicated to supporting that theme...

the line would get added in index.template.php - along with the other met tags (probably right near/above the <title> tag)
but that may vary by theme - which is why we tell people to get support for their  specific themes in the threads dedicated to those themes.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

peterwaalker

Quote from: Kindred on April 18, 2015, 08:09:11 AM
theme specific questions should be requested in the thread dedicated to supporting that theme...

the line would get added in index.template.php - along with the other met tags (probably right near/above the <title> tag)
but that may vary by theme - which is why we tell people to get support for their  specific themes in the threads dedicated to those themes.

Do you remember that Crip is the owner of the Anecdota Theme. And he is no longer alive.
I have asked some questions in his support thread with No reply. See http://custom.simplemachines.org/themes/index.php?lemma=793
Please help me tell me the line i should look for and other meta so that i can trace and place it.
Thanks Once again

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

peterwaalker

Quote from: Kindred on April 18, 2015, 04:18:46 PM
I did...

Okay.
Please any remedy to my predicament?
So that I can trace and try out.

peterwaalker

I have found meta tag line of code in my index.template.php
Where exactly should i add the code below.

Should i add this code Before or After echo?below
Code (Add After or Before?) Select
<meta name="viewport" content="width=device-width, initial-scale=1">


   
Code ( Add After or Before?) Select
echo '
<meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
<meta name="description" content="', $context['page_title_html_safe'], '" />', !empty($context['meta_keywords']) ? '
<meta name="keywords" content="' . $context['meta_keywords'] . '" />' : '', '
<title>', $context['page_title_html_safe'], '</title>';

// Please don't index these Mr Robot.
if (!empty($context['robot_no_index']))
echo '
<meta name="robots" content="noindex" />';

// Present a canonical url for search engines to prevent duplicate content in their indices.
if (!empty($context['canonical_url']))
echo '
<link rel="canonical" href="', $context['canonical_url'], '" />';


Kindred

add it between the meta and title.. as I said
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: