Use A Canonical Url, Amongst Page Url Conditionals

Not all weblog owners tin successfully add together a conditional display of a template object, to their blog.

Some owners carefully re-create the conditional code that I provide, add together it to their blogs - in addition to it does non function (for them). In about cases, it may work, for me, when I banking firm stand upward for their work.

Conditional code, that involves people inwards countries dependent champaign to the province specific domain redirect, won't ever last comparing against "blogspot.com". People inwards the Great Britain may run across their weblog every bit "blogspot.co.uk", for instance.

People inwards the USA, correct now, volition ever run across BlogSpot blogs, every bit "blogspot.com".

This blog, in addition to other blogs published to custom domains, volition ever last viewed nether their domain URLs - in addition to therefore at that topographic point is no worry nearly province specific domain redirect.

How produce y'all compare a weblog URL, amongst province specific domain redirects inwards use?

But what of blogs published to "blogspot.com", exterior the USA? How produce they conditionally display objects, amongst the conditional URL varying according to the province specific code of each reader?

When y'all produce a URL comparison, to conditionally display a template object - in addition to the weblog is published to "blogspot.com" - banking firm stand upward for against the canonical URL.

Use the canonical URL, for conditional comparisons inwards BlogSpot blogs.

Since your weblog could last read past times readers inwards whatever country, if your weblog is published to "blogspot.com", y'all volition desire to base of operations whatever URL comparing against the Canonical URL.
  • Compare "data:blog.canonicalUrl" - non "data:blog.url".
  • Compare against the URL, ending inwards "blogspot.com".

Your readers could last inwards whatever province - either the same every bit you, in addition to dependent champaign to your province local domain - if 1 applies. Or, they could last dissimilar from you, in addition to dependent champaign to a dissimilar province local domain - again, if 1 applies.

<b:if cond='data:blog.canonicalUrl != "http://mypersonalblog.blogspot.com"'> <style> #Text1 {display: none !important;} </style> </b:if>

or possibly

<b:if cond='data:blog.canonicalUrl != data:blog.homepageUrl'> <style> #Text1 {display: none !important;} </style> </b:if>




Just avoid using

<b:if cond='data:blog.url != "http://mypersonalblog.blogspot.com"'> <style> #Text1 {display: none !important;} </style> </b:if>

and

<b:if cond='data:blog.url != data:blog.homepageUrl'> <style> #Text1 {display: none !important;} </style> </b:if>

This way, everybody inwards every dissimilar province tin run across the gadgets solely when necessary, every bit y'all design. And maybe, y'all tin banking firm stand upward for your weblog using a service similar GeoPeeker.

---

Blogger weblog owners, inwards about countries exterior the USA, occasionally detect that they cannot conditionally display template objects, inwards BlogSpot published blogs, every bit people inwards the USA tin do.

Owners who alive inwards the USA may non realise that people exterior the USA may non run across their blogs properly, amongst conditionals added. If y'all desire your weblog gadgets to display properly, inwards BlogSpot published blogs, role a canonical URL inwards the comparisons.

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel