Advertisement:

Author Topic: Viewport Tag  (Read 5235 times)

Offline NeedIt

  • Jr. Member
  • **
  • Posts: 307
Viewport Tag
« on: April 12, 2015, 11:24:15 AM »
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.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,826
  • Gender: Male
    • Kindred-999 on GitHub
Re: Viewport Tag
« Reply #1 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
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline NeedIt

  • Jr. Member
  • **
  • Posts: 307
Re: Viewport Tag
« Reply #2 on: April 12, 2015, 11:34: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.

Offline NeedIt

  • Jr. Member
  • **
  • Posts: 307
Re: Viewport Tag
« Reply #3 on: April 13, 2015, 01:34:55 AM »
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.)

Offline Topman

  • Full Member
  • ***
  • Posts: 484
  • Helping the UK new home buyer
    • newbuildhomes on Facebook
    • @@NewHomeExpert1 on Twitter
    • Brand New Homes
Re: Viewport Tag
« Reply #4 on: April 17, 2015, 08:25:54 AM »

Offline peterwaalker

  • Jr. Member
  • **
  • Posts: 271
Re: Viewport Tag
« Reply #5 on: April 18, 2015, 08:00:59 AM »
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">

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,826
  • Gender: Male
    • Kindred-999 on GitHub
Re: Viewport Tag
« Reply #6 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.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline peterwaalker

  • Jr. Member
  • **
  • Posts: 271
Re: Viewport Tag
« Reply #7 on: April 18, 2015, 03:19:43 PM »
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

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,826
  • Gender: Male
    • Kindred-999 on GitHub
Re: Viewport Tag
« Reply #8 on: April 18, 2015, 04:18:46 PM »
I did...
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline peterwaalker

  • Jr. Member
  • **
  • Posts: 271
Re: Viewport Tag
« Reply #9 on: April 18, 2015, 06:09:10 PM »
I did...

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

Offline peterwaalker

  • Jr. Member
  • **
  • Posts: 271
Re: Viewport Tag
« Reply #10 on: April 18, 2015, 07:03:39 PM »
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'], '" />';

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,826
  • Gender: Male
    • Kindred-999 on GitHub
Re: Viewport Tag
« Reply #11 on: April 18, 2015, 07:39:48 PM »
add it between the meta and title.. as I said
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.