How to create a Site Map

by chris at itsallbeta,Tue 17th Jun, 2008, in categories: Using Blogsome

If you are having difficulty creating a Site Map in Blogsome, these tips should help.

1. On your Dashboard, go to Manage > Pages and click the button that says ‘Create new page’. (If you have already created a Site Map but it is not working, select ‘Edit’.)

2. In the box marked ‘Page Title’, type ‘Site Map’.

3. Leave the box marked ‘Page Content’ blank. This is important.

4. If you already had something written in the ‘Page Content’ area, erase it. Then go to Manage > Hacks and click ‘Clear cache’.

5. Return to Dashboard and go to Manage > Files. Select the file called ‘index.html’.

6. In your ‘index.html’ file, find the main content div.

7. Find the bit that says {$content) and put the following piece of code immediately after it.


{if $smarty.server.REQUEST_URI == '/sitemap/'}
<h2>Site map</h2
<ul>{wp_list_pages}</ul>
<h2>Categories</h2>
<ul>{list_cats optionall='1' all='All' sort_column='name' optioncount='0' children='0'}</ul>
<h2>Posts</h2>
<ul>{get_archives type='postbypost' limit='' format='html'}</ul>
{/if}

8. Click ‘update template’.

9. View your Site Map, which should now be working fine.

Turn your blog into a static web site

by Chris,Tue 10th Jun, 2008, in categories: Using Blogsome

Go to your ‘index.html’ template and find the bit that says {$content}. Make a backup or keep a copy of ‘index.html’ in case you make a mistake. Then replace {$content} with this:

{if $smarty.server.REQUEST_URI == '/'}
Front Page Content
{else}
{$content}
{/if}

Where it says ‘Front Page Content’, place whatever you want to have as your static front page. (This could be a summary of what your site or blog is about.) Use regular HTML code for this part.

You will also need to put a link to your archives, so that your readers can find all your other posts.

Show us your Categories

by Chris,Fri 30th May, 2008, in categories: Using Blogsome

We last wrote about template tags back in February 2007. Here’s some more stuff you might like to know.

Display your categories

Go to Manage > Files and look in your index.html file. Somewhere, usually in your menu or navigation section, you will see a little piece of code that tells Blogsome to display a list of your blog’s categories. For a basic list, use this:

<ul>{list_cats optionall='1' all='All'}</ul>

For something a bit more interesting, though, take a look at this:

<ul>{list_cats sort_column='name' optioncount='1'}</ul>

In the above example, optioncount=’1′ will show the number of posts for each category after the category’s name. The number is usually shown in brackets.

Use sort_column=’name’ to display categories by name, which is what we do on this blog. If you want to display your categories by their number (go to Manage > Categories, and you will see that each category has a number as well as a name), then you would use sort_column=’ID’ instead.

Here are some more options that you can use in that categories code:

  • optiondates=’1′ displays the date of the last post in each Category. Dates take the form YYYY-MM-DD.
  • children=’1′ will show children (subCategories).
  • children=’0′ will not show subCategories.
  • hierarchical=’1′ will display children (subCategories) in a hierarchical (after parent) list.
  • hierarchical=’0′ will not display subCategories in a hierarchical list.
  • child_of=’4′will display only the Categories that are children of the Category that has the ID number ‘4′.
  • exclude=’3 , 7 ‘will exclude the Categories that have the ID numbers ‘3′ and ‘7′ from the list. Obviously, if you want to exclude one or more categories, just change the ID numbers to suit.
  • feed=’rss’ will display a link after each Category to the Category’s RSS feed.
  • feed_image=’PATH/FILENAME’ will display an image link to the Category feed. Substitute the location of an image (usually a small RSS icon) where it says PATH/FILENAME.

Find your RSS feed link

by Chris,Sat 10th May, 2008, in categories: Using Blogsome

Sometimes, it’s just simple stuff that we want to know. For example, you could be new to the art of blogging (after all, we all have to start somewhere, don’t we?). And one thing that can seem mysterious to novice bloggers is all this stuff about something called ‘RSS’.

First things first. Go to your Dashboard and choose Manage»Files, then look in ‘index.html’. There are loads of things near the top of that file between the <head> and </head> tags. Look for something like this:

<link rel="alternate" type="text/xml" title="RSS" href="{bloginfo show='rss2_url'}" />

Important: Make sure that feed link is in your blog’s code. Otherwise, Google Reader or Bloglines (or whichever RSS reader you use) might not be able to use autodiscovery to find the feed at all. If that code is not in your ‘index.html’ file, put it in.

If you just need to give your RSS feed link to other people, it is exactly the same URL as your blog, but with the word ‘feed’ after it, like this:

http://YOUR_BLOG_NAME.blogsome.com/feed/

Your comments feed (yes, people do sometimes subscribe to a comments feed too) will look like this:

http://YOUR_BLOG_NAME.blogsome.com/comments/feed/

Protect your posts. No Javascript required.

by Chris,Sat 26th Apr, 2008, in categories: Using Blogsome

Caleb left a comment last month. He was having problems creating protected blog posts (posts that can be read only by certain people who have the right password to access the posts). He had tried some Javascript but it hadn’t worked. So I decided to look into the problem.

As far as Blogsome is concerned, it’s easy to protect your posts. There’s no need to use any Javascript at all. When you write a post, there is a password box on the right hand side of the dashboard. Here’s one I filled in earlier over on a test blog. Notice the password field has been completed with the password ‘roger_rabbit’. If you decided to protect a post, do try to pick a better password than that.

Password box.

Next time someone comes to your blog, this is what they will see.

Protected post.

I tried putting the wrong password in, as if I was a nosy visitor who was trying to guess it, but I was only allowed to read the post when I put the correct password in the box.

I tested this in Firefox 2.0 and Internet Explorer 6 and it worked ok in both browsers.

Updates: Password protection does seem to stop anyone from reading your protected post in an RSS feed reader. Have checked this in Google Reader and Bloglines. All you see for the protected entry is the line “There is no excerpt because this is a protected post”.

There is also a way to make your entire Blogsome blog private. No Javascript required. Matt Schinckel has the solution.

Custom fields and how to use them

by Chris,Thu 17th Apr, 2008, in categories: Using Blogsome

Next time you’re writing a post, scroll down toward the bottom of the ‘Write post’ page before you hit ‘publish’, and you will find the ‘Custom fields’ section.

Using the custom fields is easy. But what are they for? Well, let’s say I’ve just done my main post but I also want to mention what I’m reading at the moment or what television programmes I’m watching. That’s exactly the sort of thing that the Custom Fields section is for. Here’s an example of how to fill in the boxes:

Custom fields.

As you can see, the ‘Key’ box is where you put what you’re doing (reading, listening to or watching something, or whatever). And the ‘Value’ box is where you give a little bit more information. It looks as if my secret is out, doesn’t it? According to the custom fields in the picture, I’m listening to Greenday.

After you have used the custom fields once or twice, the things that you enter in the ‘Key’ box will appear in a handy drop-down select box. Just choose the option you want. It’s as easy as that!

Custom fields select box.

the_meta

There’s just one more thing you have to do though, before your custom field information will show up on the page.

Go to Manage>Files on your dashboard, and choose Posts. This will take you to where you can edit your post.html template.

Choose where you want your custom fields to show, and write {the_meta} in the file, as shown below. A good place to put custom fields is at the end of a post.

Custom fields select box.

Styling custom fields

A quick look at the source code will show that custom fields are generated as an unordered list with the class of ‘post-meta’. Information entered in the ‘Key’ box is a span with the class of ‘post-meta-key’. If you are confident with CSS, custom fields can be styled just like any other element.

Use Smarty to protect your email address

by Chris,Tue 15th Apr, 2008, in categories: Using Blogsome

There are lots of different ways to protect your email address from spammers and email harvesters. The safest way of all is not to put your email details on your website at all. Turning your email address into an image is another way, although that also means that your visitors can’t click on the image to send you a message: they have to copy the address from the image instead.

You can also use Javascript or hex values to encode your address, but it can take a while to find a suitable code snippet to use.

Blogsome users have another option: Smarty code. It’s easy, and here’s how to do it. Let’s suppose your real email address is **me@example.com**. Choose from one of the following:

Firstly, there’s this:

{mailto address="me@example.com" encode="javascript"}

Anyone looking at your blog source code will see this:

<script type="text/javascript">eval(unescape('%64%6f%63%75%6d%65%6e%74%2e%77%72%69%74%65%28%27%3c%61%20%68%72%65%66%3d%22%6d%61%69%6c%74%6f%3a%6d%65%40%65%78%61%6d%70%6c%65%2e%63%6f%6d%22%20%3e%6d%65%40%65%78%61%6d%70%6c%65%2e%63%6f%6d%3c%2f%61%3e%27%29%3b'))</script>

Or you could try doing this:

{mailto address="me@example.com" encode="hex"}

which looks like this:

<a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;%6d%65@%65%78%61%6d%70%6c%65.%63%6f%6d" >&#x6d;&#x65;&#x40;&#x65;&#x78;&#x61;&#x6d;&#x70;&#x6c;&#x65;&#x2e;&#x63;&#x6f;&#x6d;</a>

And finally there’s this:

{mailto address="me@example.com" encode="javascript_charcode"}

which returns this in the source code:

<script type="text/javascript" language="javascript">
<!--
{document.write(String.fromCharCode(60,97,32,104,114,101,102,61,34,109,97,105,108,116,111,58,109,101,64,101,120,97,109,112,108,101,46,99,111,109,34,32,62,109,101,64,101,120,97,109,112,108,101,46,99,111,109,60,47,97,62))}
//-->
</script>

Turn off ‘nofollow’ in comments

by Chris,Sat 12th Apr, 2008, in categories: Using Blogsome

Whenever someone leaves a comment on your Blogsome blog, the link usually includes the ‘nofollow’ attribute. This means that Google and other search engines don’t count it as a proper link. If you wish to reward your regular commenters with backlinks that Google does count, then go to your comments.html file and follow these simple steps:

1. Find the bit that says something like this: <cite>{comment_author_link}{_e text=" said"}:<br /></cite>.
2. Change it to: <cite><a href="{comment_author_url}">{comment_author}</a>
{_e text=" said"}:<br /></cite>.

3. Then find this: {comment_text},
4. And change it to this: {capture name='text_comment'}{comment_text}{/capture}
{$smarty.capture.text_comment|replace:'rel="nofollow"':''|replace:"rel='nofollow'":""}.

Have a look at the source code for any comments that have been left on your blog. If the changes have worked, you will not see ‘nofollow’ on any of the comments.

As always when making changes, remember to save a copy of your original comments.html file so that you can put it back in your template if, for any reason, the alterations don’t work for you.

source: http://standalone.blogsome.com/