Register Your Domains Hassle-Free
Showing posts with label Template editing. Show all posts
Showing posts with label Template editing. Show all posts

Wednesday, 10 April 2013

How to tick the "expand widgets" checkbox in Blogger's new template editor

This QuickTip is about finding the "expand widgets" option in Blogger's template editor.



Today, Blogger Buzz announced a new version of the template editor.

This is exciting in all sorts of ways, including that it implies that Blogger will continue to support template editing:   some people suspected that Dynamic Templates, which don't allow template editing, might be the way of the future.

But there's one immediate issue: many of the existing "How to do XXXX in Blogger" tutorials include statements like
Open your template for editing, and tick the "Expand widgets" checkbox

or

Open your template for editing, and make sure that "Expand widgets" isn't ticked


However today's changes have deleted the Expand Widgets checkbox.

So - what do you do if you need to expand the widgets?   Luckily, this is one of the things that has been made easier, once you find out where the option has moved to.


How to see expanded code for a gadget / widget


The equivalent of ticking the "expand" check-box is to:


1)    Find the gadgetID in the usual way.


2)   Open the template for editing, and find the reference to the widget / gadgetID in the code
(Either using the browser's find feature - or  the "Jump to Widget" feature that is now in the post editor.)


3)    Click on the fold marker for that gadget.
This is the horizontal arrow ( ? ) which is in the very left side of the editing window on the same line as the gadget name.

Clicking it turns the sideways arrow into a down-arrow, and shows you the code that's included in that gadget - or at least as much of it as Blogger is going to let you see.




To un-tick the expand check-widgets checkbox, just make sure that all the fold-arrows are horizontal. (they work as toggles - clicking them changes them from one expanded to contracted, or vice versa).


What else has changed?

I'll be updating Blogger-HAT's main "How to edit your Blogger template" article soon - this is just a quick heads-up to start with.

If you've found any more features of the new template editor that you like (or don't) or which need more explanation then drop a comment below and I'll see what I can do.

Thursday, 3 May 2012

Google's guide to HTML and CSS styles

Google have released their own style guide for HTML and CSS code.

It will be interesting to see how much of it they apply in future changes to Blogger templates

But for Bloggers who do a lot of modifications to their own template, there might be some useful tips. I especially like the one about putting CSS rules into alphabetical order for maintainability.

Doing this would mean adding CSS rules manually rather than than through Design > Customize > Advanced > Add CSS

And it will be harder to do a code-compare to see the difference between our customized template and the current standard-issue ones.  But storing like-named rules together appeals to me more than just tagging new ones on the end.

Tuesday, 1 May 2012

Adding gadgets to your mobile-template makes your blog better for smartphone visitors

This article shows how to add gadgets to the mobile version of your blogger template.

Gadgets and mobile templates

Previously I've described how to add a gadget to your blog.

If you have not enabled a mobile template for your blog, then visitors who look at it using a mobile device (smartphone, tablet etc) will see all your content and gadgets.   But they will probably have to scroll left and right a lot, because your blog will be a lot wider than their screen.  There might be some issues if you have gadgets that require javascript or particular media players, which their device doesn't have installed. But these are exactly the same as the issues for your visitors who are using desktop computers.

But if you have enabled a mobile template, then readers who are using a mobile device see a different design which is tailored to their screen-width, though still using the colour/theme that you chose.

Blogger faced some challenged when they built these mobile templates: many bloggers put a lot of effort into design and providing gadgets that.    But a 300-ish pixel screen simply does not have room for a sidebar and blog content, and may not have space for some of the things that gadgets do, either.

What Blogger have done is to say that only some gadgets are normally shown on mobile-template versions of your blog:
  • Header
  • Blog Posts
  • Profile
  • Pages
  • AdSense
  • Attribution

However it's easy to add other gadgets to your own customized mobile template, and to set up gadgets that are only seen by readers using mobile-devices - provided you are willing to take the risks of editing your template.

(I've described how to remove the attribution gadget from mobile-templates before, because it's one that some people particularly hate - and of course the same approach can be used for the other standard gadgets too.)


How to add a gadget to the mobile template

First, check that mobile has been enabled for your blog, and that your mobile template is set up to show customizations:   go to the Template tab, click on the gear-wheel under mobile, tick Yes (for show mobile template), then select Custom, and press the Save button.


Add the gadget to your blog, in the usual way:  when you are choosing the parameters, make sure you think about the amount of screen-space that your mobile-readers will have to see it.

Find the gadget ID.

Edit your template: you don't need to expand the widgets.

Locate the gadget code, by searching for the ID you found (tip: use your brower's search function, eg ctrl/F). It will look something like this (slightly different, of course, if the gadget you are working on is of a different type):
<b:widget id='PlusBadge1' locked='false' title='Google+ Badge' type='PlusBadge'/>
To show the gadget on the mobile version of your blog, add mobile='yes' to the code, like this:
<b:widget id='PlusBadge1' locked='false' mobile='yes' title='Google+ Badge' type='PlusBadge'/>

To show the gadget only on the mobile template and not to desktop users, add mobile='only' to the code, like this:
<b:widget id='PlusBadge1' locked='false' mobile='only' title='Google+ Badge' type='PlusBadge'/>

Save the changes.

Use either a mobile device (ideally), or another tool that lets you test blogs as they would appear on different screen sizes, to check that the gadgets are showing as you think they should.


Update:   

Since first writing this post, I have found out that due to a bug in Blogger, if you have a gadget with mobile='only' set, then when you try to make changes to the blog using the Dashboard > Layout editor:

  • They will not save, and 
  • If you try to preview, you get an error message:

The template is updated in other place. Please reload the original page and retry it again.
Error 500

The only way I have found to get around the error is to remove the mobile='only' statement.

If you really want to have mobile-only gadgets, then you may need to:

  1. Remove the mobile='only' statement
  2. Make the Layout editor changes
  3. Replace the mobile='only' statement.




What gadgets should you add to your mobile template?

There are no hard-and-fast rules here:   it's all about what you want your mobile visitors to be able to access.   I have seen people add blog-rolls, linked-lists, polls, profiles, and various other simple widgets.

Gadgets that I think could be more troublesome are slideshows, popular posts (if you try to show a thumbnail), newsreel, subscriptions, gadgets from Amazon.com and other 3rd parties.

You just need to remember amount of screen space which your visitors have, and how large the images are likely to be for them.   And also that gadgets are likely to be shown as the bottom of the list-of-posts (which is how the blog-posts gadget shows the home page of your mobile blog), so won't be nearly so obvious as they are in the sidebar.


Why put gadgets only in the mobile blog?

You may wonder why a gadget should only go on the mobile version.

One reason is to provide a simpler alternative to a full-featured gadget that is shown on the non-mobile version of the blog. For example, I use a two-page google-custom-search option here on Blogger-Hints-and-tips. This lets me control what sites are searched, and use some advanced display features. But a mobile-sized screen won't cope with this. So if I wanted to make Blogger-HAT more mobile-friendly, I'd add a regular search-gadget, but only show it to on mobile-devices so that non-mobile visitors didn't get confused.


Positioning gadgets on the mobile template

Tatami layout 1As far as I can see, Blogger users do not easily have any control over the positioning of gadgets in the mobile-template versions of our blogs.

Some experiments make me think that:
  • Gadgets from the header in the regular layout are put above the list of posts in the mobile view
  • Gadgets from the footer in the regular layout are put below the list of posts in the mobile view
  • Gadgets from the sidebar in the regular layout are put below the list of posts in the mobile view

But there could be more going on here - please let me know if you've worked out any more rules that are applied.

Also, I have no idea how mobile templates will cope with tricks like gadgets that are put above your header: test your blog extra carefully if you've tweaked your template in this way before adding mobile-specific tweaks.


Troubleshooting

Stopping gadgets from showing on mobile-template blogs (ie adding mobile='no') does not require you to choose the Custom option from the list of mobile template.   But adding them (except for the ones in the default list) does.

The default mobile gadgets are  only shown if you have put them onto your blog template: if they are not in your blog at the moment, then they will not automatically be shown just because you enable a mobile template.

What other problems have you had with mobile-templates?



Related Articles

Putting a gadget into your blog

Turning your blog's mobile template on

Advantages and disadvantages of editing your blogger template

Finding the id for any gadget

Adding a google-custom-search

Giving your blog a home-page

Sunday, 22 April 2012

Finding the gadget ID for a widget in your blog

This article shows you how to find the "identifier" for a gadget in your blog.  This isn't useful in itself, but is a set in various other template customizations, including putting a gadget on a single page only.


Sometimes you need to find the code-name for a gadget that you have added to your blog, so you can edit your template and control how and where that gadget is displayed.

This may be part of giving your blog a home-page, controlling how your blog looks on mobile devices, or various other tweaks.

Luckily this is very simple.


How to find the id-code for any gadget


"gadget", "widget", and even "page-element" all mean the same thing.  I generally use "gadget", because the Page Elements tab currently says "Add a Gadget".  But they're absolutely the same.


Add the gadget to your blog in the usual way.


Edit it again, but don't make any changes to it.


Maximise the window, so you can see the very end of the address bar in the window - at the top of the screen.


Notice the word at the very end of the address, ending in a number.   This is the Gadget-id.


In this example, it's Text1,   Other possible values are HTML1, Attribution1, Followers1, etc.


Picture of the widget-settings window, showing the widget-id in the browser address bar at the end of the address


What does the number mean?

The digits at the end of the widget-id show to the number of times that a gadget of this type has been added to the blog:  in a complicated situtation, with lots of gadgets of the same type, it can get into double, or even treble-figures.)



Related Articles

Controlling what goes on the homepage

Adding a gadget / widget / page-element to your blog

Editing your blogger template

Putting a gadget on your static-pages only - or your home page

Friday, 24 February 2012

Options for adding gadgets to your blog

There are (at least) three different ways of adding a gadget to your blog.  This article explains what a gadget / widget is, and looks at the advantages and disadvantages of each method.

Gadgets and Blogs

A gadget is simply a small thing that does "something useful". In real-life, it may be a bottle-opener, screw-driver, pocket-knife, etc.

On your blog, a gadget may be called a  widget or page-element. But it's the same idea: a small piece bit of code that does something useful. You could put a gadget into a post, but usually they're found in the sidebar, header or footer.

There are three main ways to install a gadget into your blog:
  1. The Add a Gadget wizard provided by Blogger
  2. Manually installing the code into your template
  3. Using a customized "add to Blogger" button provided by some 3rd parties who make gadgets for websites

The pros and cons of with each approach are listed here.

Note that adding gadgets to blogs with dynamic-view templates is a little different - the following lists are written with layout or designer templates in mind.


Blogger's Add a Gadget feature

The add a gadget option is a built-in part of the Blogger software. It is the first way that most people add extra useful tools to their blogs.

Advantages
  • Easy to use - you can move items around with just drag and drop
  • Gives access to Blogger's pre-built tools
  • In gadgets built by Blogger, the screen where you enter the details (title, picture location, code, which labels to include, etc) is usually easy to understand: they don't use geeky words like "parameter" (even though this is really what they are asking for on the screens)
  • You have total control over where to put gadgets - you just drag-and-drop them in to place.

Disadvantages
  • You don't have total control over item formatting and placement
  • There is no easy way to back up your settings
  • If you use the same type of gadget many times, and don't give each one a title, it can be confusing to see in the layout which gadget you are working with.
  • There are some gadgets available in the add-a-gadget wizard that did not come from Blogger -and some of them don't work properly. (Google do not guarantee that all the gadets in the list are correct, or that they are free of viruses, malware, etc.)
  • You cannot see the code behind any of the gadgets, so you can never be 100% certin what they do.

Manually installing code into the template:

Adding a gadget into your template is just the same as adding any other code: you need to get the code, and you need to know exactly where to put it.   As well as the usual advantages and disadvantages of editing your template, there are these ones:

Advantages
  • You have total control over item placement, alignment and formatting
  • Code you have installed is fully backed up when you back up your template
  • You can use code from anywhere, not just from Google
  • You can control what pages the gadget appears on, by adding some extra code at the same tim you add the gadget.

Disadvantages
  • You need to get the code from somewhere: either you need to write it yourself, or from a 3rd party that you trust.
  • It's not nearly as easy - you need to edit your template
  • You need to position items using code, drag and drop will not work.
  • You can use code from anywhere, not just from Google - so you might be tempted to use code from dodgy 3rd party sources.
  • If you do make calls to 3rd parties, and they later disappear, then your gadgets will give an odd-looking messages instead of working the way they used to.

Suggestion:
If you are going to install code from 3rd parties, make sure that you read it over first. If it calls pictures, consider making a copy of those pictures youeself, and changing the code to link to your copy instead of theirs. If it has calls to scripts that are hosted somewhere, consider doing the same - but be aware that the downside is that if the code needs to change for a future version of Blogger (or windows), you won't automatically get the new code.

Another option:
If you have the code, then you can also add it to an individual post or page, by pasting it into the HTML table of the editor.  If you link to this from the menu bar, then readers will have a way to get to it from every post, otherwise they will only see it when they see the page/post you put it in.


Use a 3rd party's "add to Blogger" option:

Many websites that let you generate code to do "something useful" also ask you where you want to put that code.

If you choose "a website", they just give you the HTML, which you can install in the normal way.

Choosing "Blogger" in the AddThis gadget window shows a big red "Install Blogger Widget" button

But if you tell them that the code is going into Blogger, they give you a button, or perhaps even open a new window or tab for you, call www.blogger.com, and go into the Add-a-gadget screen and put a gadget with their code into the screen: all you need to do is check that it's ok, move it to a different place if wanted, and press Save changes.

The big advantage of this approach is that it is easy: you don't have to copy-and-paste the code yourself.


Disadvantages:
As well as all the regular disadvantages of adding a gadget using Blogger's add-a-gadget too, there are some specifc ones for this approach:
  • If the 3rd party is dishonest, they may ask you to enter your Blogger ID and password into their site - and you have no guarantees that they won't do nasty things with them.
  • If you have more than one Blog, you may accidentally put the gadget onto the wrong one
  • If your blog is complex, it may be hard to find where on the layout screen the new gadget has been put
  • You don't get an opportunity to look at the code to check if it does strange things.
  • Because you don't look at the code, you cannot make a backup copy of it (and because it's put into your gadgets, a template backup may not include it or the user-settings that you chose).


My Recommendation

There is no "one right way" to install gadgets: some of Blogger's built-in gadgets are very handy, and I make a lot of use of them. But in general:

Usually, I just tell the 3rd party sites that I'm putting their code onto "my website" and install the code that they give me in into a regular HTML/Javascript gadget.  There is a slight risk that this could cause problems if the other company offers slightly different code for Blogger vs regular websites - butI have not yet found a case where this happens.

If you're adding code from a 3rd party, then it's a good idea to store a copy of that code in a documentation blog (or similar), so that you can easily re-cereate it it if the gadget is accidentally deleted.



Related Articles:



How to put posts into your pages in blogger

Using Blogger's widget-addition tool

Advantages and disadvantages of editing your template

Use a private blog to store documentation about your blog

Adding 3rd party HTML into your blog

Templates types in Blogger.

Wednesday, 1 February 2012

How to edit your Blogger template

This article is about how to edit Blogger templates, using either the old or new interfaces.

It supports many other articles on this site, which suggest specific template changes to solve particular problems.



Previously, I've looked at whether it's a good idea to edit your Blogger template or not.

For many people, editing the template is acceptable, because it is the only way to do what they want (remove the attribution, show a gadget on the homeppage only, add a Facebook like button to posts, etc).


In general, the process to follow is:
  • Open the template-editor
  • Make a back-up copy of the template, as it is now
  • Make the change
  • Check that it works, and if not, go back to the previous template.

Of course it's not quite that simple - there are different procedures for working with dynamic vs designer or layout templates.


How to open Blogger's template editor, for dynamic template blogs:


If your blog has a dynamic template, then use the see-all-posts icon for the blog to get into it the blog-options screen for the blog that you want to edit.

When you are in the see-all-posts mode, the the address bar in your browser is like this:
http://www.blogger.com/blogger.g?blogID=5381944372768369653#allposts/postNum=0

Copy your blogID number - that is, the digits between blogID= and #allposts (it's bold in the example above)

Go go
http://www.blogger.com/html?blogID=NNNNNNNNNNNNNNNNNNN
where you have replacd NNN... with your blogID


Note:  the last time I tried this, it automatically opened in the old interface's template editor.   As always, make sure you take a backup copy of the template - see instructions below before changing this.


How to open Blogger's template editor, for non-dynamic templates


  • Go to the Design tab
  • Click Edit HTML
  • Note:  this step has now been removed - however I've left it here for now, because I suspect that it may come back in future:
    Click Proceed




How to edit your template

Make a backup copy of your current template:

It's tempting to skip this if you're only making a small change. I even skip it myself sometimes. And it's not needed if this is the first time you've ever customised your template - because you can recover from problems by just reinstalling the standard template.

But if you would be upset to lose any template changes you made earlier, or if the change you are making now is not minor, then I strongly recommend making a copy before you start, just in case.  To do this
  • Click the Backup / Restore button near the top right of the dashboard (as shown below)
  • Click the Download Full Template button, and then wait while the file downloads.
  • After the download has finished, find the place where your computer puts downloaded files.
  • Find the file that was just created,
  • Rename it to something sensible
     (eg MyBlog template backup before change 31 Jan 2012.xml)
  • Move the file to somewhere safe: usually somewhere on your computer is fine - or you make like to upload it to somewhere like Google Docs, to be absolutely certain that it won't get lost.





Make the change to your template:

  • Check whether the change you are making needs the Expand Widgets checkbox off or on, and put it to the right state.
    (If the article telling you want to change doesn't mention it, then assume it should be off.)
  • Find the code you need to change:

    See this article from Southern Speakers if you're not sure how to use the find-feature that Blogger have now built into the template editor.

    Note:   many of the "how to" articles say to make sure that the Expand Widgets checkbox off or on.   This checkbox has now been removed from Blogger's template editor.    If the instructions you are following says to leave it "off", then you should just be able to follow it as is.    However if you are told to turn it on, then you need to find the correct part of the code by searching for the widget-id or section name, and then "unfold" that to see the complete code.   
  • Make the change (this article doesn't go into the principles of template design, there are plenty of other articles and websites about that: I'm assuming that you know what you need to do).
  • Click the Preview button:

If Blogger can make sense of the change you made, then a new window or tab opens, showing a view that looks like your blog's homepage. It's not a real copy of your blog (the links won't work, the spacing might not be quite the same, and it will have the word "Preview" diagonally in the top left corner).


Do a quick check that the screen looks right - for some changes you even be able to tell if the change has been successful just from this preview screen.

However:  If the new window/tab shows an error message like
Your template could not be parsed as it is not well-formed. Please make sure that all XML elements are closed properly. <br/> XML error message: The element type "div" must be terminated by the matching end-tag "</div>".Error 500
or
Your template could not be parsed as it is not well-formed. Please make sure that all XML elements are closed properly. <br/> XML error message: Element type "b:widget" must be followed by either attribute specifications, ">" or "/>".
then Blogger has not been able to understand the change you made. Sometimes the error message gives a clue about what's wrong, although it can be misleading.   Check that you made the change correctly - fix any errors and click Preview again.  If it still doesn't work, ask for help from the place that suggested the change you are making.

Once you are happy that the preview screen looks OK, click the Save or Save template button.


How to test your template change:


Some template changes can be checked very easily, sometimes from the preview screen.

But if your change isn't visible on the front screen, you must check it after you have applied it. What to verify depends on your template type, what the change was, and what other features (eg the page-gadget as a menu, the archive widget, ) your blog uses. You need to decide what to test, based on all of these.

At least, I alwways click on and check on these things when I've made a major template change:
  1. the home page
  2. the items in the menu bar
  3. a label value
  4. an archive widget entry
  5. custom-search-engine results
  6. comments

And if I'm being particularly reader-focussed, I'll also check these things in more than one browser:   usually in the current version of Internet Explorer, Firefox and Chrome.


Fixing Problems:


If you find that the template change has caused problems, then ou have have a choice to make:
Can you and your readers live with the problems on your blog for "a while", while you look for other solutions? 
Or 
Do you need to remove the change right now, so visitors can use your blog as it was while you solve the issues.

There is no right answer to this question:   It's a personal decision, based on the blog, and your readers.

But if you do need to remove the template change, here's how to do it:
  • Click the Backup / Restore button near the top right of the dashboard
  • Click Choose File and find the file that you downloaded earlier
  • Click Upload.


It is best to restore your template before you have changed any gadgets.  If you get a message about widgets being missing, then it means that the gadgets associated with your blog are not the ones referred to in the template.   If this happens, you need to decide whether to deep or delete any "orphaned" ones, and may need to check their settings again.


Making complicated changes:


If you your template may need a lot of "surgery" while you figure out how to make a change, then it may be a good idea to build a private test-blog to do the work in, and only copy the contents into your "real" blog template when you are certain that you've got it correct (or correct-enough).




Related Articles:


Advantages and disadvantes of editing your Blogger template

 How to expand the widgets in your template editor.

Adding CSS formatting rules to your blog, without editng the template

How to remove the "powered by Blogger" attribution from designer-template blogs

Putting a gadget on the homeppage only

Planning changes to your blog - without readers seeing what you are doing

Wednesday, 28 September 2011

Removing dynamic templates from your blog

Dynamic templates can be removed from your blog - but be careful if you want to keep any gadets etc that were on your blog before it went dynamic.


Overview:

Previously, I've described the initial version of dynamic templates for blogger, and the second release.

This 2nd version is a lot better integrated with the rest of Blogger, but it has some consequences for many other parts of the system.

In particular, if you want to go back to using a design or layout template there is a real risk of losing all your previous gadgets if you aren't careful how your remove the dynamic template.


Dynamic view template = no Design option in the dashboard drop down

One effect of choosing a Dynamic template for your blog is that the Design option is not on the main-menu drop down in the dashboard in the new, the post-Sept-11 Blogger interface.


Instead, there is just Template, which takes you straight to the Template designer:  this happens because, unlike layout or designer templates, you have no control over the layout of a blog with dynamic template, and cannot edit the HTML behind it.

If you want to have this level of control, including being responsible for the consequences of editing your template, then you need to remove the dynamic template, and switch back to a regular one.


How to remove a dynamic template from your blog:

When you have chosen a dynamic template, there is an option in the Design screen to " Revert to previous template".


If you click this link, your blog template goes back to how it was before you applied the designer template, including all gadgets and layout customisations.

BUT

If you choose "revert to previous template", and then pick a different designer or layout template before saving, then you will lose all gadgets and customisations that are not on the "standard" version of the new template.

The moral of the story:  always back up before making major changes to your blog.   (And even then I'm not 100% convinced you will be able to restore your gadgets to exactly how they were.)

NB   Any posts you have made in the meantime are kept - it is simply the template that is changed here, not the blog contents.


Disabling dynamic views for your blog:

In new-interface-Blogger, I cannot see any way to turn Dynamic views off.

In pre-Sept-11-Blogger, there is still an option to turn Dynamic views off, under Settings > Formatting.

This is still relevant, because people can see your blog using dynamic views, even if you haven't chosen a dynamic template, by using    www.YourURL.blogspot.com/view   (although this may not work for blogs with custom URLs)



Related Articles:



Dynamic templates, version I

How to enable a dynamic template for your blog

Letting your readers the ability to see your blog in dynamic views.

Advantages and disadvantages of editing your blog's template

Giving your readers the option of using dynamic views

Types of template in Blogger

Dynamic templates: turning them on in your blog

This article is about the 2nd version of dynamic templates that Blogger have released:  what they are, how to add them to your blog, and what restrictions they have.


Announcing Dynamic Templates, part II

In March 2011, Blogger announced Dynamic Views, and I posted describing them, and telling you how to give your readers the ability to see your blog in dynamic views.

Today, they've announced them again (without acknowledging the previous announcement!).  This time with a few differences:
  • There are seven templates (instead of five)
  • Some templates allow for blogs that don't have great photos in every post
  • You can set your blog up so that visitors automatically see it using one of the dynamic-view templates:  it's just another option in the template designer (see Setting up your Blog to use a Dynamic Template, below).
  • Most (all?) templates include some gadgets: search, RSS feed link, link to Blogger, and regular sized +1, Tweet and Like buttons (instead of the anorexic ones in regular designer templates at the moment)

There are still restrictions:  blogs must be public, with RSS site feeds enabled.

And there are still lots of things missing:   for example, blog-owners have no control over gadgets or layout, fonts or color scheme (even though the announcement says this is coming, I cannot find where to access it).



You cannot add gadgets to a blog with a dynamic template.   So you cannot install Google Analytics, or AdSense or any other sort of advertising.  That said, this help article does say that Blogger will continue to support AdSense for blogs that already have it, so the work around may be to use a regular designer template, put in some ads, and then switch to a dynamic template.


Setting up your Blog to use a Dynamic Template

To make a dynamic view the default option for your blog:

1)  Check that it is public,

2)  Check that the RSS site feeds is switched to full or jump-break

2)  Choose Design > Template Designer (pre-Sept-11 interface), or Template from the dashboard drop-down (post-Sept-11 Blogger)

3)  Choose Dynamic from the list of options   (if it's not in the list, then post probably your blog doesn't meet one of the conditions above.

4)  From the row underneath, choose which of the options (ie dynamic template types) you would like as a default.




Next: 

Removing a dynamic template from your blog - be careful, don't lose your gadgets!



Related Articles:



Dynamic templates, version I

Letting your readers the ability to see your blog in dynamic views.

Changing the colours in your blog

Why RSS matters, and how to enable it

Installing Google Analytics into Blogger

Setting up AdSense for your blog

Monday, 22 August 2011

Lining up the first post and the sidebar

In some Blogger templates, there is a big gap between the bottom of the header and the start of the first post, and this means that the posts and the sidebar are not aligned.  This article explains how to adjust the gap, and so remove that problem.



Blogger template layouts

Isométrica a04In the templates that Blogger provides, as well as all third-party templates, the amount of space between elements on the screen is not accidental:   designers put a lot of effort into working out what spacing will look good, and then finding ways to put CSS code into the template so that the spacing they want is shown in any browser software that Blogger supports.
But there are times when you may want to change this spacing, and this is easy to do, provided you are willing to accept the disadvantages of editing your template, and if  you can work out exactly which part of the template code to change.


The pre-Header gap

A pet-hate of mine is the blank space above the first post, which looks strange unless you put something else in to the space.  In this example, I've got an AdSense link-unit in the area highlighted in red, just to fill in the empty area:



How to change this

1  Edit your template  - don't forget to take a backup.


2  Find this code  (use the text-find feature in your browser, eg ctrl/f in Chrome to make finding it easier)
h3.post-title, .comments h4 {
  font: $(post.title.font);
  margin: .75em 0 0;
}
The exact numbers used in your template may be different:  the key thing is to find the CSS command that is putting a margin above the post header.  In the template that I took this example from (Simple), it's the "0.75em" - which puts 75% of the space of a the post-header characters as a blank space above the header.


3   Change the first margin value:  how much to change it by depends on your template, but in some cases I've used 0 successfully.

In CSS, when a margin statement has three numbers beside it, they refer to the

  • top, 
  • left-and-right, 
  • bottom 

margins respectively.   So if you want to do something else to the post-header, eg indent it, this is the place to make changes


4   Click Preview to see what the blog will look like - keep doing this until you get the right setting.


5   When you are happy with the spacing, click Save Template to apply the changes to your blog.   (Or Clear Edits if you cannot get it right and need to stop trying).


Note:  If you make a big change to your template like this, it would be a good idea to check out out in at least one version of the other browsers that your readers use - at the moment, this usually means Internet Explorer 8, Firefox and Chrome.   But it may depend on your niche - a tool like Google Analytics will give you some statistics about what browsers, and screen sizes, your visitors have.

Also, it is possible to make this change by just installing a new CSS rule for h3.post-title into your blog - because the latest one found is always the one used, and because the template designer's Add CSS function puts the rules you add after the othr rules.   I don't recommend it here, though, because working with the original rule makes it easier to see the effect of making changes to any of the values in the area.


Other affected spacing

If you have more than one post per page, then this change will also reduce the amount of space between the bottom of one post and the header of the next one.   Depending on your template, you want want to add a little more space into the margin statement in the bottom of the post-footer, eg
.post-footer {
  margin: 20px -2px 20;
  padding: 5px 10px;
}

If you display comments in your blog, you also need to check the impact on comments, because the original command applied to h4 items in comments as well.

If you are making a lot of changes, you may want to make a test blog, and plan your changes in private before applying them to your main blog.



Related Articles:



Setting up Google Analytics to get statistics about for your visitors

Adding a new CSS rule to your blog's template

Advantanges and disadvantages of editing your template.

How to edit your blogger template

Who did your blogger template come from - the quick way of finding out

Making a test-blog for template changes

Planning changes to your blog in private

Friday, 10 June 2011

Editing your Blog's template: advantanges and disadvantages

This article is about the consequences of modifying your blog's template.


Overview
Previously I've explained that your blog is made up of a number of components:   your content, and a number of other parts including the blog template.

Initially, every blog has a blog-templates chosen from the options supplied by Google when the blog was created.  However it's possible to change to a different blog-template at any time, and there are lots of options both from Google (custom, layout and now designer templates), and from third parties.

You can edit your template, from the Layout / Edit HTML tab.   And the recommended answer to many "how do I ..." questions in the Blogger Help Forum is to do just that.

However there are some consequences, and (at least) one of Blogger's software engineers recommends not editing your template [in the comments following from this post]- even though s/he also says that doing so is very much part of the supported features that Blogger offers.

This article explains these consequences, so that you can make an informed decision about whether to edit your template or not.


Google's blog-templates

Google / Blogger offers four different types of template:  Custom, Layout, Designer and Dyamic.  (Ref:  types of blog template) - and there are mobile variations within the Designer options, too.

For Layout, Designer and Dynamic templates, they also offer a number of different styles, for example Minima, Minima Stretch, Denim, Rounders, Thisaway Rose, Simple, Awesome, etc).

For each style of template, Google has a current version.   But there are also earlier versions that used to be current but have been superseded as problems with them have been found and fixed:




When Google make a change to their "master copy" of a particular template, they also look at all the blogs that already use that template:  if a blog's copy of the template has not been editied (by the owner), then it is updated to include the changes that Google made to the master copy.



But if a blog's template has been changed, Google cannot update it with the improvements that they've made to the master template, because doing so would over-write the change that the blog-owner made.


Advantages and Disadvantages

The major disadvantage of editing your blog template is that you may not get the benefits of improvements that Google make to the master template.

There are some other disadvantages too:
  • You might make a mistake, and corrupt your template (possibly in subtle ways that you don't notice at first).
  • You need to take back-ups, just in case you make a really horrible mistake - and it can get confusing managing all the versions of the backup file.
  • It's more difficult to get support from the Blogger Help Forum is your template is non-standard (because the helpers there don't know how you've changed things
  • When it's time to update your blog to use a new template, there is no way to make a list of all the changes that you have applied to your current template (unless you've got a copy of the un-changed template as it was when you applied it to your blog for the first time).
But there are some pretty major advantages:
  • You can make changes to your blog that you cannot make in any other way
  • It's easy to back up any changes that you make:  while there are some changes that could be put into HTML/Javascript gadgets on your blog, there is no easy way to back these up.  If you accidentally delete a gadget, the only way to get it back is to re-create it manually.

Final thoughts:

The Add CSS function in the Template Designer is at attempt to let us change our templates in a way that is known, and gets around these issues.   But I'm not convinced that it always shows all the template changes I've makde, and there are some changes I want to make that don't relate to the CSS.

Personally, I'm going to continue editing the HTML in my blog-template.

You need to make the own decisions about whether to do so or not.   Hopefully this article will help you to understand the consequences, either way.




Related Articles: 




Components in your blog

Types of blog template.

Adding a new CSS rule to your blog's template

Setting up Google Analytics for your blog

Adding a line between your posts

Friday, 6 May 2011

Installing code into your blog

This article is about how to install code into your blog.

Why you might want to install code:

Javascript Code example There are plenty of websites suggesting to tweak your blog.  A few these tell you how to use standard Blogger tools, but many have written code that does something useful that Blogger doesn't currently provide.

Also, there are lots of tutorials about how to do things with HTML, CSS or Javascript - no matter what "development environment" (Blogger, Dreamweaver, etc) you're working in.     For example, I recently wanted to put tables with scroll-bars into the posts of one site, and, after a bit of googling found a method that works across all the common browsers.  (Well it worked when I tested it first - sadly it wasn't working in Chrome when I finally finished loading the content, but that's another story!).

I'm generally wary about installing things from 3rd parties.  But there are times when it's a good thing to do because the benefits for your blog outweigh the risks - for example, I'm happy to install code from AdSense, Amazon Associates, Chitika, PayPal and various other well known brands.


How to install code:

Two previous articles describe how to install 3rd party HTML into your blog, and how to add CSS to your blog.

The only other type of code that you can add is Javascript.  To add this:

1  Edit your template, in the usual way.

2  Find the </head> statement

3  Put the code immediately before </head>, using this format:
<script type='text/javascript'>
//<![CDATA[

THE CODE GOES HERE


//]]>
</script>

4  Click the Preview button, to check that the blog loads and looks ok.

5  If it's not ok,choose Clear Edits and try again:  check you are putting the code in the right place.

6  Once you're happy, Save the changes.


Related Articles: 


Adding HTML into your blog,

Installing extra CSS rules into your blog.

Planning changes to your blog - in private

Showing Presentations in your blog

Is code from a 3rd party safe to install on my blog?   (coming soon)

Giving your blog an attribution (ie credits) gadget

This article is about giving your blog an attribution gadget, either one of Blogger's standard ones, or one that you make yourself.

Blogger's standard attribution gadget


If your blog has a Designer template (ref What sort of template do I have?) then by default it will have an attribution gadget at the bottom of the footer.

Previously, I've described the concerns that many people have with the attribution, and how to delete it.

However some people may want to add a standard gadget back in again, and others would like to make a customised version of the gadget that gives credit where it's due.


Adding a standard Attribution Gadget


The attribution gadget is not available through the usual Add a Gadget option.

The only way to get it onto your blog is to apply one of the Designer templates.

To do with with the old (ie pre-Sept-2011) Blogger:
  • If you have a Layout template, use Design > Template Designer and pick one of the new options
  • If you have a Custom template, use Template > Customize Design > Upgrade your template
  • If you already have a Designer template, use Design > Template Designer and choose another one.   (And maybe use the same command again to change back to the template you had previously, if that's what you want to do.)


To do with with the new (ie post-Sept-2011) Blogger:
  • If you have a Layout or Designer template, use the Template tab , hover over one of  the new options and click either Appy to blog or Customize 
  • If you have a Custom template, use Template > Customize Design > Upgrade your template



Remember:  changing templates undoes all the customisations you have previously applied through the Edit HTML tab.  Plan your template change carefully.



Building an alternative Attribution Gadget

The only way to customize the standard attribution gadget is to add some text to the Copyright field.  This text is show an the beginning of the standard statement.

But many people want to change the other items too, for example to credit Tina Chen for the underlying template AND themselves for the colour scheme and layout.  This can be done by changing the template-name in your template.  If you want to more than just change the existing names, your options include:


1  a Blogger icon
Add a Blogger icon gadget to your template:  and choose one which you like.


2  A picture
Design a graphic that gives the appropriate credits, and add it to your blog  as a picture gadget


3  A Text Gadget
Add a text gadget, and put phrase(s) like these in it.
"Template created by WHOEVER, modified by YOUR NAME." 
"Photos by YOU (OR WHOEVER).   Page background image by WHOEVER"
"Powered by Google: site design by Blogger, file-hosting by Google-Sites"
"© YOU. You may copy and adapt this document for non-commercial use provided this notice is not reblog moved.
This work is licensed under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA."

Think carefully about where to put the attribution, and how to format it:  not many web-design or hosting companies expect their clients to devote prime screen-space to acknowledgements for the web-host - but you may want to advertise your own services ("customised by YOU").


Note:   at the moment, these methods only work on non-mobile template blog views.



Related Articles: 



Changing the template-name in your template

Deleting the attribution gadget

Removing the attribution gadget from your mobile-template.

Planning your template change - seven simple steps to a snazzy new look blog

Adding a gadget to your blog

Wednesday, 4 May 2011

Adding a separator line between your posts

This article shows how to put a horizontal separator line between posts in your blog, using either HTML's line command, or CSS rules.  It also has suggestions about ways of formatting these lines using different colours and line-styles.



There are at least four approaches to choose from if you want to put a divider between your posts in Blogger.  These days, I prefer the CSS-rule approach, because it's so easy and flexible.  But I've shown details of a few other methods too:
  • Manually add a horizontal line command to each post
  • Use the post-footer colour block as a line (in Designer templates only)
  • Add the HTML command for a line to the main section of your template, in one of the post-footers
  • Add a top or bottom-border to the CSS rule that formats the body of your posts.
The following sections give more detail about each option, including how to apply them to your blog, and their advantages and disadvantages.


Manually add a line to each post

When you are editing a post, you can put a horizontal line anywhere in the contents.

If Compose Settings (under Post Options) is set to  Interpret typed HTML, then you can just type <hr />, and Blogger will place a line like this in your post.


If your Compose Settings (under Post Options) is set to  Show HTML literally, then you need to switch to the Edit HTML tab before you type <hr />.

Disadvantage: If your post is set to display comments, or the blog is set to show the author, labels etc under the post, these items will be underneath any line that you add manually to a post.


Designer Template - post footer colour

If your blog has a designer template (ref, What sort of template have I got), then the Template Designer > Advanced tab may have an option for setting the background colour of the post-footer (depending on which template you are using).



If you use a dark colour (or have a dark background and use a light color), this makes the post-footer look like a line.

Disadvantage:  The "line" might be a bit thicker than you like.   And if your post is set to display comments, or the blog is set to show the author, labels etc under the post, these items are shown right inside the footer line.





Add a line-command to your template

If you don't like the other two approaches, you can change your template to add a horizontal line.  To do this:

1  Edit your template:

In Sept-2011-Blogger (ie the new interface) go to Template > Edit HTML > Proceed
In pre-Sept-2011-Blogger (ie the old interface) go to Design > Edit HTML.

Download a full copy of your template, and put it somewhere safe (in case things go wrong, and you need to go back to where you were).

3  Click on Expand Widget Templates.

4  Most templates have three footer lines:  what is in each one depends on the template, and how you have arranged the items in the Layout > Blog Posts editor.

Look at the template for code like the following,
       <div class='post-footer-line post-footer-line-2'><span class='post-labels'>
        <b:if cond='data:post.labels'>
          <data:postLabelsLabel/>
          <b:loop values='data:post.labels' var='label'>
            <a expr:href='data:label.url' rel='tag'><data:label.name/></a><b:if cond='data:label.isLast != &quot;true&quot;'>,</b:if>
          </b:loop>
        </b:if>
      </span> </div>
OR
 <div class='post-footer-line post-footer-line-3'/>
    </div>

and add the <hr /> command to which ever one you want, for example
 <div class='post-footer-line post-footer-line-3'/>
<hr />

    </div>

Advantage:  you can easily place the divider line anywhere you want it, relative to the other items in your post-footer.


Disadvantage:  you need to modify your template, and this does have some risks.  And it does use the <hr /> tag which some people (CSS purists) suggest is not a good idea.



Enhancements to the basic <hr /> command:


There are lots of ways you can modify the <hr / > code.   For example

<hr style="text-align: left;" /> -  to left-align it

<hr style="color: red;" /> -  to change the colour
<hr style="width: 50%;" /> -  to make it narrower

See w3c.schools <hr /> tag for more information. 



Add a border to the CSS rule that formats your posts

The cascading-style-sheet rules in your template control most aspects of how your blog looks.   They can be a very powerful way to control how your blog looks.

Quick option:

If you have a designer template, then the quick way to make this change is to add a CSS rule to your template.  The rule code to add is:
.post-body
{
border-bottom:1px dotted #666666;
}

or this one if you want the border at the top of each post:
.post-body
{
border-top:1px dotted #666666;
}

In-depth

The specific CSS rule that controls how the "body" of your posts look is .post-body.   To make changes to it:

1 Go to Design > Edit HTML

2 Download a full copy of your template, and put it somewhere safe (in case things go wrong, and you need to go back to where you were).

3 Look for .post-body in the rules section of your template. It will look something like this, but  the exact lines and values may be different:
.post-body {
margin-top: 0;
margin-$endSide: 2px;
margin-bottom: 0;
margin-$startSide: 3px;
}
 4  If you can find a .post-body rule, then add this line, just before the } character.
border-bottom:1px dotted #666666;
5    If you cannot find a  .post-body statement in the rules section of your template, then you need to add it.

Put it somewhere:
After    <b:skin><![CDATA[/*

Before  ]]></b:skin>

But not in the middle of any other rules: look at how the rest of that section of your template is laid out for clues.

The statement to add is something like the following, though you may want to try out different values for parts of it.:
.post-body {
border-bottom:1px dotted #666666;
margin-top: 0;
margin-$endSide: 2px;
margin-bottom: 0;
margin-$startSide: 3px;
padding-top:10px;
margin-top:20px;
}


Alternative formats:

The #666666 means draw the line in black - you may like to use a different colour, or use the word "solid" instead of "dotted" to make a firmer looking line.

As an alternative, you can say border-top:1px dotted #666666; - this puts a line at the top of the body of each post, just underneath the title.



Related Articles:


What sort of template have I got

Disadvantages of editing your blog's template.

Adding a new CSS rules to your template

Centering the Post-title or Page-title

Putting HTML from elsewhere into your blog.