Jump to content



Latest News: (loading..)

WebSource 5

Member Since 14 Mar 2005
OFFLINE Last Active Today, 03:39 AM
***--

Posts I've Made

In Topic: Open discussion on SEO

Yesterday, 05:42 PM

@burt

Heres an example markup with microformatting from the DVD Movies - Comedy category.

My product listing code is way different, but you'll see the general idea with markup that pulls everything posible.

Notice that the first line opens with itemList, and then each product listed is marked as itemtype = product.

I used the new osc_get_mini_description to pull the itemprop description, when used across all pages, it will keep things consistant.

I also used a metatag to the image path, as it is possible if using thumbnail contributions the path could change and thus we loose consistancy from product listing to product_info

I chose this category so it also shows the review markup, which I feel could easily be grabbed with a new fuction as well, and thus reused anywhere needed.

itemprop="availability"  is a bit trickier, as it depends if the shop owner allows checkout with 0 stock, and the ammount of stock in combination with products date available. There are 3 options, InStock, OutofStock, PreOrder.

you can see what data is pulled here: http://www.google.com/webmasters/tools/richsnippets?q=http%3A%2F%2Fwsfive.com%2Fprodlist-examle.html&html=


<div id="products-list-module" class="row-fluid" itemscope="" itemtype="http://schema.org/ItemList">
 
  <div id="theres-something-about-mary" class="media prod-row" itemscope="" itemtype="http://schema.org/Product">
   <figure class="pull-left thumbnails"><a class="thumbnail" href="http://website.web/theres-something-about-mary-p-19.html"><img src="images/thumbs/200x200_theres_something_about_mary.gif" title="There's Something About Mary" alt="There's Something About Mary" height="200" width="200"></a>
	<figcaption><i class="icon-star rating"></i>&nbsp;<i class="icon-star rating"></i>&nbsp;<i class="icon-star rating"></i>&nbsp;<i class="icon-star rating"></i>&nbsp;<i class="icon-star rating"></i>&nbsp;</figcaption>
   </figure>
   <meta itemprop="url" content="http://website.web/theres-something-about-mary-p-19.html">
   <meta itemprop="image" content="http://website.web/images/dvd/theres_something_about_mary.gif">
   <meta itemprop="description" content="Regional Code: 2 (Japan, Europe, Middle East, South Africa). Languages: English, Deutsch. Subtitles: English, Deutsch, Spanish. Audio: Dolby Surround 5.1. Picture">
   <div class="media-body">
	<h3 class="media-heading"><a href="http://website.web/theres-something-about-mary-p-19.html"><span itemprop="name">There's Something About Mary</span></a></h3>
   
	<div class="row-fluid price-wrap" itemprop="offers" itemscope="" itemtype="http://schema.org/Offer">
	 <span class="price-text">Our Price: </span>&nbsp;<span class="productPrice" itemprop="price">$49.99</span>
	 <meta itemprop="priceCurrency" content="USD">
	 <link itemprop="availability" href="http://schema.org/InStock">
	</div>
	<div class="row-fluid desc-wrap">
	 <p class="description">Regional Code: 2 (Japan, Europe, Middle East, South Africa). Languages: English, Deutsch. Subtitles: English, Deutsch, Spanish. Audio: Dolby Surround 5.1. Picture</p>
	
	 <span class="span9" itemprop="aggregateRating" itemscope="" itemtype="http://schema.org/AggregateRating">Average <span itemprop="ratingValue">5</span> of <span itemprop="bestRating">5</span> Stars out of <span itemprop="reviewCount"> 1</span>  reviews.</span>&nbsp;
   
	 <span class="btn-wrap span3"><a id="bs-btn11" href="http://website.web/theres-something-about-mary-p-19.html" class="btn btn-mini btn-info btn-block">View More</a></span>
	</div>
   
   </div>
   <div class="row-fluid additional-wrap hidden-phone">
	<span class="grid3"><i class="icon-cogs"></i> by <span class="manuName" itemprop="manufacturer"><a href="http://website.web/fox-m-4.html">Fox</a></span>&nbsp;</span>
	<span class="grid3"><i class="icon-barcode"></i>&nbsp;<span class="model-text">Model: </span>&nbsp;<span class="modelNumber" itemprop="mpn">DVD-TSAB</span>&nbsp;</span>
	<span class="grid3"><i class="icon-reorder"></i>&nbsp;<span class="qty-text">Quantity: </span>&nbsp;<span class="productQty">9</span>&nbsp;</span>
	<span class="grid3"><i class="icon-asterisk"></i>&nbsp;<span class="weight-text">Weight: </span>&nbsp;<span class="productWeight">7.00</span>&nbsp;</span>
   </div>
   <div class="clearfix"></div>
  </div>

  <div id="youve-got-mail" class="media prod-row" itemscope="" itemtype="http://schema.org/Product">
   <figure class="pull-left thumbnails"><a class="thumbnail" href="http://website.web/youve-mail-p-7.html">
	<img src="images/thumbs/200x200_youve_got_mail.gif" title="You've Got Mail" alt="You've Got Mail" height="200" width="200"></a>
   </figure>
   <meta itemprop="url" content="http://website.web/youve-mail-p-7.html">
   <meta itemprop="image" content="http://website.web/images/dvd/youve_got_mail.gif">
   <meta itemprop="description" content="Regional Code: 2 (Japan, Europe, Middle East, South Africa). Languages: English, Deutsch, Spanish. Subtitles: English, Deutsch, Spanish, French, Nordic, Polish. Audio:">
  
   <div class="media-body">
	<h3 class="media-heading"><a href="http://website.web/youve-mail-p-7.html"><span itemprop="name">You've Got Mail</span></a></h3>
   
	<div class="row-fluid price-wrap" itemprop="offers" itemscope="" itemtype="http://schema.org/Offer">
	 <span class="price-text">Our Price: </span>&nbsp;<span class="productPrice" itemprop="price">$34.99</span>
	 <meta itemprop="priceCurrency" content="USD">
	 <link itemprop="availability" href="http://schema.org/InStock">
	</div>
	<div class="row-fluid desc-wrap">
	 <p class="description">Regional Code: 2 (Japan, Europe, Middle East, South Africa). Languages: English, Deutsch, Spanish. Subtitles: English, Deutsch, Spanish, French, Nordic, Polish. Audio:</p>
   
	<span class="btn-wrap span3"><a id="bs-btn12" href="http://website.web/youve-mail-p-7.html" class="btn btn-mini btn-info btn-block">View More</a></span>
	</div>
   </div>
   <div class="row-fluid additional-wrap hidden-phone">
	<span class="grid3"><i class="icon-cogs"></i> by <span class="manuName" itemprop="manufacturer"><a href="http://website.web/warner-m-3.html">Warner</a></span>&nbsp;</span>
	<span class="grid3"><i class="icon-barcode"></i>&nbsp;<span class="model-text">Model: </span>&nbsp;<span class="modelNumber" itemprop="mpn">DVD-YGEM</span>&nbsp;</span>
	<span class="grid3"><i class="icon-reorder"></i>&nbsp;<span class="qty-text">Quantity: </span>&nbsp;<span class="productQty">10</span>&nbsp;</span>
	<span class="grid3"><i class="icon-asterisk"></i>&nbsp;<span class="weight-text">Weight: </span>&nbsp;<span class="productWeight">7.00</span>&nbsp;</span>
   </div>
   <div class="clearfix"></div>
  </div>
</div><!-- End ItemList -->

I'll put more into it later, I just am low on time right now and this should be good for wrapping everyones head around things.

In Topic: Open discussion on SEO

15 June 2013 - 02:00 PM

View Postburt, on 15 June 2013 - 07:23 AM, said:

If the columns are set to be null (or have content), we shouldn't need the nullif...

That was my understanding of it as well, but no matter how I tried without NULLIF it would only load if I had a mini description set, otherwise it just died. My columns are set to null, so my only conclusion was it must b the over all server set up?

No real need for a throw bak, oter than its nice to be able to do it. If the query runs that far and does not find content, theres really no point anyhow.

I can help set up some microformats, I'm currently wrapping some up on a test 2.3 site. They are everywhere, my code had changed a lot, but the general idea is there. I'll update when I get wrappedup, I have some ideas for writing a few new functions now :)

In Topic: Open discussion on SEO

15 June 2013 - 04:14 AM

Query should have read "products_seo_description" above, I had different field names already existing

In Topic: Open discussion on SEO

15 June 2013 - 03:24 AM

View Postburt, on 14 June 2013 - 10:20 AM, said:

HOw does this grab you, can you optimise?

Awesome, I like how coalesce does all the work without the need to create a mile long function.

I set this up on a test site, and got it to work as needed, but had to add NULLIF or it would not retrieve further than the first requested column. I double checked to make sure my columns were NULL as default, as from what I found on coalesce shows it is made to work on columns set to null, not empty. They were, but anyhow, check this out:
  function osc_split_mini_description($products_precis) {
	$content= strip_tags($products_precis);   
	  if (strlen($content) > 156 ) {
		$content = substr($content, 0, strpos($content, ' ', 156));
	  }
	  return $content;
  }
  
  function osc_get_mini_description($products_id) {
	global $languages_id;
	$product_query = tep_db_query(" select coalesce(NULLIF(products_mini_description,'') , NULLIF(products_seo_text,'') , NULLIF(LEFT(products_description, 300),'') ,'". TAG_LINE ."') as products_precis from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$products_id . "' and language_id = '" . (int)$languages_id . "'");
	$product = tep_db_fetch_array($product_query);
	$products_precis = $product['products_precis'];
	return osc_split_mini_description($products_precis);
  }

I added TAG_LINE to be the default throw back. If it is set in the stores configurations options then it can be used in the rare case that none of the 3 exist.

I noticed earlier in this thread you had microformats in mind. I have been studying these a while now, and I feel that this exact function should also be used for microformating the description itemscope. It would keep the description consistant anywhere that the product id presented, IE: a product infoBox or the product listing or product info page. The character length is just fine and there would be no chance for one product display presenting different content than the same product being presented elsewhere.

Another good thing, this function could be duplicated, osc_get_meta_description and just switch the first 2 column lookups around for a failsafe meta description output.

In Topic: Open discussion on SEO

13 June 2013 - 11:17 PM

View Postburt, on 13 June 2013 - 09:52 PM, said:

does the "mini" description exist?
Yes -> show it
No ->  
Does the "meta" description exist?
Yes -> show it
No ->
Show the first 150 characters - reduced to full words - of the stripped( "main" description ).

My thoughts exactly, ~ just reversed :)