1. Static Pages in Blogger

    body

    This is a long-standing feature/hack request from much of the Blogger community. Pages that are not posts. This hack is a little messy and not the be-all solution, but I feel it is mature enough to publish as a start.

    The pages are all addressed as http://yourblog.blogspot.com/?page=pagename

    As always there are multiple options for this hack, but the basic starting is the same:

    1. Go to Google Pages (you're on the new Blogger, you have a Google Account) and create the page you want.
    2. Click the 'View live' link from the Google Pages editor (after publishing the page)
    3. Note the URL in the location bar / address bar, you will need it later

    You will need to add this code to the <head> section of your blog first time only, subsequent pages you can skip this:

    <script src='http://jscripts.ning.com/get.php?xn_auth=no&amp;amp;id=2999987' type='text/javascript'/>

    In code that follows, replace the red pagename with the what you want used as pagename in the URL (See above) and the red URL.

    If you want to just redirect to the other page (example) use this code:

    <script type='text/javascript'>

    //make sure the WidgetData object and staticpage section are defined
    if(typeof(WidgetData) != 'object') WidgetData = {};
    if(typeof(WidgetData['staticpage']) != 'object') WidgetData['staticpage'] = {};

    WidgetData['staticpage']['pagename'] = {
    'url':'URL',
    'type':'redirect'
    };
    </script>

    If you want the other page superimposed in an IFRAME (example) use this code:

    <script type='text/javascript'>

    //make sure the WidgetData object and staticpage section are defined
    if(typeof(WidgetData) != 'object') WidgetData = {};
    if(typeof(WidgetData['staticpage']) != 'object') WidgetData['staticpage'] = {};

    WidgetData['staticpage']['pagename'] = {
    'url':'URL',
    'type':'iframe'
    };
    </script>

    If you want the other page superimposed (example) use this code:

    <script type='text/javascript'>

    //make sure the WidgetData object and staticpage section are defined
    if(typeof(WidgetData) != 'object') WidgetData = {};
    if(typeof(WidgetData['staticpage']) != 'object') WidgetData['staticpage'] = {};

    WidgetData['staticpage']['pagename'] = {
    'url':'URL'
    };
    </script>

    If you want the other page included in a DIV so that it fits better into your page (you must style the DIV so that it works well. The example simply styles it to fill the page), use this code and put a DIV in your code with an ID the same as pagename:

    <script type='text/javascript'>

    //make sure the WidgetData object and staticpage section are defined
    if(typeof(WidgetData) != 'object') WidgetData = {};
    if(typeof(WidgetData['staticpage']) != 'object') WidgetData['staticpage'] = {};

    WidgetData['staticpage']['pagename'] = {
    'url':'URL'
    };
    </script>

    If you want the other page included as an IFRAME in a DIV so that it fits better into your page (you must style the DIV so that it works well. The example simply styles it to fill the page), use this code and put a DIV in your code with an ID the same as pagename:

    <script type='text/javascript'>

    //make sure the WidgetData object and staticpage section are defined
    if(typeof(WidgetData) != 'object') WidgetData = {};
    if(typeof(WidgetData['staticpage']) != 'object') WidgetData['staticpage'] = {};

    WidgetData['staticpage']['pagename'] = {
    'url':'URL',
    'type':'iframe'
    };
    </script>

    Creative Commons Licence © 2006-2008 Stephen Paul Weber. Some Rights Reserved.
    There is an RSS Feed for comments on this post.
    You can trackback from you own site.

    10 Comments

    1. Comment at 2007-01-15 21:05 by CANADA Deepak
      body

      One question..
      Will these pages be crawled as inside the same site as your blog URL?

    2. Comment at 2007-01-16 11:58 by CANADA Singpolyma
      body

      Yes, but the search engines will index the content as the content of your blog's homepage (because they are JavaScript and search engines ignore that).

    3. Comment at 2007-04-04 20:24 by UNITED KINGDOM Ubuntu Linux Mozilla Firefox 2.0.0.3 Jack
      body

      Couldn't seem to make any of the methods work, although none of your examples seem to be working any more so I wasn't entirely sure what I was doing.

    4. Comment at 2007-04-06 21:13 by CANADA Windows XP Mozilla Firefox 2.0.0.2 Stephen Paul Weber
      body

      @Jack – None of the examples will work anymore because my old blog now redirects here. If you try to install one again and then give me a link to your blog I can take a look :)

    5. Comment at 2007-09-03 17:03 by UNITED STATES Mac OS X Mozilla Firefox 2.0.0.6 Chris
      body

      how do i do this
      "//make sure the WidgetData object and staticpage section are defined"?

    6. Comment at 2007-09-12 10:37 by CANADA Ubuntu Linux Mozilla Firefox 2.0.0.6 Stephen Paul Weber
      body

      @Chris – The code where that comment is does that…

    7. Comment at 2008-06-26 08:36 by GERMANY Windows XP Internet Explorer 7.0 René Fischer
      body

      You wrote …

      > If you want to just redirect to the other page (example) use this code:
      >
      >

      … but where i have to paste this code?

      Greetings
      René

    8. Comment at 2008-06-30 09:51 by CANADA Linux Mozilla Firefox 3.0b5 Stephen Paul Weber
      body

      @Rene anywhere really – in your <head> section is best

    9. Comment at 2008-06-30 15:16 by GERMANY Linux Mozilla Firefox 3.0 René Fischer
      body

      Thanks a lot. I give this a try, after fixing my comment problems ;-)

    10. Comment at 2008-08-26 18:56 by AUSTRIA Windows XP Mozilla Firefox 3.0.1 kajdo
      body

      hi, i also spent some time to do a static about me page on my blogspot site … here is the result http://detect-it.blogspot.com/search/label/xxx … look at detect-it.blogspot.com – the how-to is not finished yet, but i will clean up the code and probably make a widget for this purpose …

      i think there are many advantages to use the “static page way” i do … try it and if you have any ideas – or other comments -> let me know

      have fun
      kajdo

    Reply / Comment

    advanced comment form |

Stephen Paul Weber