Archive for January 8th, 2008
I am assuming you already use a robots.txt file if not go to robotstxt.org because you need to know this stuff.
Anyway, to add your sitemap to your robots.txt file just add the sitemap line to the end of the file after all your disallow commands like so:
User-agent: *
Disallow: /somefolder/
Disallow: /somethingelse/
Sitemap: http://www.mysite.com/sitemap.php
Now next time the search engines crawl your site they will automatically find your sitemap.
If you have a new site you will should probably still submit the sitemap URL to the search engines through their webmaster interfaces or use a ping.
Submit Sitemap to Google or Ping Google with your Sitemap
Submit Sitemap to Yahoo or Ping Yahoo with your Sitemap
Submit Sitemap to MSN Live.com
Submit Sitemap to Ask.com or Ping Ask.com by hitting this address:
http://submissions.ask.com/ping?sitemap=http://www.yourdomain.com/sitemap.xml
1 Comment »
Adding some If…Then logic to our Excel formulas can really make creating dynamic spreadsheet easier.
Basically the IF logic statement in excel works just like it does in any web coding program, it check to see if a condition is met and then executes something based on the results.
It looks like this:
=IF(logical_test, value_if_true, value_if_false)
So for instance the formula:
=IF(A2>B2,”yes”,”no”)
Checks to see if Cell A2 is bigger than B2 and returns “Yes”if it is or “No” if it is not.
You can do an endless number of things with the true and false values, such as return text, return numbers, return a cell value or even execute a formula.
Lets look at some various options:
=IF(A2>B2,”yes”,”no”) — returns text answers
=IF(A2>B2,”why yes it is larger”,”no of course its not larger”) — returns longer text answers
=IF(A2>B2,1,2) — returns numeric answers
=IF(A2>B2,A2,B2) — returns cell values
=IF(A2>B2,(A2-B2),(B2-A2)) — returns nested formulas
=IF(A2>B2,”Sorry, you are at your limit”,(D2*4)) — returns combination of options
Ok, so lets take it up a notch. If you want to check more than one condition you can use an AND or an OR operator:
=IF((AND(D2>5,C2<100)),2,1)
=IF((OR(D2>5,C2<100)),2,1)
Now – you can even nest multiple AND/OR statement into the same IF formula, the difference here is that while each logic test can have its own value if True, you can only have one value if all are false. You can nest up to 7 IFs in one formula, so that means you can return up to 8 different results (7 different values if true and one value if false).:
=IF((AND(D2>5,C2<100)),3,(IF((OR(D2>5,C2<100)),2,1)))
=IF((B2=”Michigan”),4,IF((B2=”Indiana”),3,IF((B2=”Ohio”),2,IF((B2=”Illinois”),1,””))))
Notice the second example the false value is left blank “” meaning the cell will be left blank if the item is not from any of the four states listed.
Ok – go forth and be logical.
Comments Off on Using IF statements in Excel formulas
A handy trick I have been using since IE 7 came out and all of sudden my css was being read a tad differently across each of these browsers: IE6, IE7 and Firefox.
Typically I first design a stylesheet for Internet Explorer, then use a conditional statement to add a second stylesheet where I only include those css items that need to be modified for non-IE browsers – namely Firefox, then I place the two stylesheet calls in the <head> like this:
<link href=”style.css” rel=”stylesheet” type=”text/css” />
<![if !IE]>
<link href=”not-ie.css” rel=”stylesheet” type=”text/css” />
<![endif]>
I list them in that order because only IE reads these codes so in IE it only reads the “style.css”, but in Firefox it reads the “style.css” first then writes over what ever styles are renamed in “non-ie.css”
Here are other conditional comments you can use and what they stand for if you need to get more exact on which browser you are targeting:
<!–[if IE]>
If browser is Internet Explorer<br />
<![endif]–>
<!–[if IE 5]>
If browser is Internet Explorer 5<br />
<![endif]–>
<!–[if IE 5.0]>
If browser is Internet Explorer 5.0<br />
<![endif]–>
<!–[if IE 5.5]>
If browser is Internet Explorer 5.5<br />
<![endif]–>
<!–[if IE 6]>
If browser is Internet Explorer 6<br />
<![endif]–>
<!–[if IE 7]>
If browser is Internet Explorer 7<br />
<![endif]–>
<!–[if gte IE 5]>
If browser is Internet Explorer 5 and up<br />
<![endif]–>
<!–[if lt IE 6]>
If browser is Internet Explorer lower than 6<br />
<![endif]–>
<!–[if lte IE 5.5]>
If browser is Internet Explorer lower or equal to 5.5<br />
<![endif]–>
<!–[if gt IE 6]>
If browser is Internet Explorer greater than 6<br />
<![endif]–>
<![if (IE 6)|(IE 7)]>
If browser is Internet Explorer 6 OR 7 ( | is the OR operator )
<![endif]–>
<![if (gt IE 5)&(lt IE 7)]>
If browser is Internet Explorer 5, 5.5 OR 7 ( & is an AND operator but with the gte and lt it is used as a BETWEEN method )
<![endif]–>
Conditional comments are preferable to weightier browser detection scripts and are cross-browser friendly, so don’t forget that you can use these conditional comments to also include or exclude whatever code you want – not just stylesheets.
1 Comment »
We have all run into the issue of having a background image as our site header but then you want to link the header to hoe page – so what do you do? You could bring the image out from the background or make an empty space into a link or you can use this handy code to make the entire <DIV> a link:
<div onclick=”location.href=’http://www.yourdomain.com’;” style=”cursor: pointer;”>
The Javascript Onclick Event can be used on all of these html tags:
<a>, <address>, <area>, <b>, <bdo>, <big>, <blockquote>, <body>, <button>, <caption>, <cite>, <code>, <dd>, <dfn>, <div>, <dl>, <dt>, <em>, <fieldset>, <form>, <h1> to <h6>, <hr>, <i>, <img>, <input>, <kbd>, <label>, <legend>, <li>, <map>, <object>, <ol>, <p>, <pre>, <samp>, <select>, <small>, <span>, <strong>, <sub>, <sup>, <table>, <tbody>, <td>, <textarea>, <tfoot>, <th>, <thead>, <tr>, <tt>, <ul>, <var>
It can also be used in conjunction with any of these Javascript objects:
button, document, checkbox, link, radio, reset, submit
1 Comment »
|