20 April 2011

Demistifying Search Engine Experts

I have little respect for Search Engine “Experts”. I consider them to be Snake Oil Sales People, at best.  Let’ talk about how search engines work and why I advocate not using SEO “experts” until a site is live for 6-12 months minimum.

Assumption : You have a web programmer and coder like me who will write solid code, coach the staff, and encourage good work.

Meta Tags & Description :

Truth : Not too valuable. Estimated at 5% of overall ranking calculation

Reality : Do well, don’t focus on them too much. This data should reflect the content of the page. This is not worth discussing as you should reflect your content and move on.

References : http://seotradenews.com/google-meta-keyword-tag/ :

“Google’s Matt Cutts confirmed what many in the SEO community have known for quite some time:  Google doesn’t use the meta keywords tag in their rankings” source : http://www.youtube.com/watch?v=jK7IPbnmvVU also http://googlewebmastercentral.blogspot.com/2009/09/google-does-not-use-keywords-meta-tag.html

The DOM – Document Object Model (wiki) :

This is the framework of the site data and the organization underneath to support parsing by search engines as well as readability by humans. In short, this is the “Letter” and “Magazine” format. Generally you write content (most format) like this:

  • Title
  • Introduction
  • Image(s), media
  • Supporting items
  • Possible additional information and references
  • Conclusion
  • Closing information

With the DOM Validating and the content pure the search engines will be happy just as the humans will be able to read and enjoy!

The DOM part 2 :

Search Engine success has a lot to do with honesty. So here are a number of things available to increase correlation in the search engine rankings:

  • Title : This shows up in the “blue bar” or tab of the browser. Should be short and reflect the content.
  • URI/URL : The location on the web of content should also be coordinated with the written work.  So your article called “How I love horses and caring for them in the heat of the summer” should have a web location like this yoursite.com/content/how-i-love-horses-and-care-instructions-for-them-in-the-heat.html
  • Cross Linking : Use of category listings, tags and taxonomic functions should reflect the content. (Tags vs Categories via WordPress). Regarding your horse article the tags should include care, horse, heat, summer, and instruction. Consider categories such as horse care and maintenance. These methods allow for crossover of content and create more legitimate “unique” instances in the Search Engine parse.

Back Linking :

This is critical, but don’t go overboard. Back linking is generally the practice of creating an external link back to your site.  I consider the origins to be in the “forum” era where you would put a link to your site or project in your signature in the forum. This in turn contributes to traffic as you are once removed (via that link) from a higher traffic page (the forum).

This has evolved in the blog era with comments where most every major blogging platform allows for the site reference in the comment or input you provide.

Additionally, many social networks allow for this as well, such as YouTube where comments, and more specifically, descriptions allow links to your site.

There are other means of back linking, but here is the caution. Use this wisely! If you back link in a “spammy” way you will loose SEO ranking. If you are writing about horses (as the example goes) be sure and comment or post in other sites and areas that pertain to your content, like a horse care forum.

Finding high traffic blogs and putting in a back link (for marketing purposes) is a bad idea.  Google, and other search engines can see what you are doing and have complicated mathematical formulas to weed out these crap attempts.

You will not only get  down-ranked in the end.

Internal Linkage :

This is often abused and should be discouraged as an active front line tactic. Modern web publishing software will allow for category, tag, taxonomy, and other inherent and valid systems to create positive internal references. Use these tools.

Do reference other articles and posts on your site to keep the reader engaged and on your site. This is good and appropriate.

Correlation :

Things need to correlate, and this feeds into the “honest game” I preach.  Let’s talk about a typical post or entry and the parts humans generally think about.

The elements we worry about and how they fit into the picture:

  • Title, an HTML element : Horse Care in the Heat
  • Introduction aka content : I talk about horse care in the heat in a technical sense littered with key words and repeated ideas and topics
  • Meta Tags  should include horse, heat, care, maintenance, instruction, and other key words from a technical sense (equine health, medication names, etc)
  • URL/URI : site.com/content/horse-care-in-high-heat.html
  • Outbound links and references  should be placed in page and be valid. This contributes little in the beginning, but with good traffic you stand a chance to get associated with the topic in the long run
  • Tags and category listings will create internal linkage and thus multiple methods for the search engines to pick up on your content
  • Think like your target traffic. What terms might they be using to find your content? Use those words in your content and in the categories, tags, and taxonomy as well as the URI/URL, title tag, and meta content

There’s more, but that is a good start. So this is all put in to effect repeating the key words of

  • horse
  • care
  • equine
  • heat

into your post.

Check this search out: http://www.google.com/search?q=horse+care+high+heat (“horse care high heat” was the search string) notice all the bold in the results including the URI/URL and the title. Here’s a screen shot:

This is how Google operates. Remember, Google and all of the other search engines are supposed to deliver you to content as easily as possible!

A few tips, and tings that the SEO “expert” don’t like.

Registrar : We don’t know how deep this goes, but the registrar information matters.  Don’t worry about it, but at the same time don’t use anything”funky” for your registrar information, such as your SEO “expert” as a contact. This is a highly debatable topic and it leads to only one conclusion – own your web presence. If you are administering the site, or your company, that should be the owner. Period!

IP address is so important and generally over looked. Get a dedicated IP address for your site PERIOD! You should disassociate with others on your server (as many of us use shared servers). I can not stress the importance of this enough!!! A dedicated IP address should cost about $5/month or $60/year and is a MUST! (If you are using Rackspace you will need to shell out a lot more, I advocate not using Rackspace professionally)

Eliminate errors! Your typical SEO “expert” will have little knowledge of errors, and all the other things we, as web professionals and programmers, perform to make the site run. Any 404 error is bad. They must be fixed, and this is only the beginning. Only a real web professional can address and understand these errors.

Do not redirect front line and mission critical information. A redirect is any number of methods such as 302, 301, items like PHP’s header(), meta redirect, javascript, etc. Error code reference from w3.org. The simple reason is because these tactics are relegated to the realm of scam and entrapment methods. Use of them will raise flags and generally there is no reason to use them in front line marketing. (if you need to redirect for logistical reasons do it at the DNS level)

Webrings are dangerous. They are generally a reason to get  down ranked. But then again some of them are honest and help rankings.  This should never be a front line method. Do your content in an error free and valid site first!

The Smell Test!

If it smells dirty, deceitful or dishonest it probably is! Some examples:

  • Tiny text : Hiding tiny text in the page to fill content. BAD, the search engines know about this!
  • Invisible text : Making lots of text on the page the same color as the background just to get parsed. BAD, search engines know about this!
  • Title spamming : Putting a ton of keywords in the title tag. BAD, search engines know this!
  • Dynamic Content swapping : Randomly swapping content in the context of a program. BAD – will raise flags for being unstable to humans.
  • Meta tag and description spamming : Putting a ton of tags in the html for the search engines. BAD! This will not mathematically work out in relation to the valid humanly visible content. Do an honest job!
  • Creating massive forwarding sites is BAD!
  • Forwarding and entrapment schemes : Bad – this pisses people off and the search engines know that you are actively blocking bounces (explained in a minute).
  • The list goes on, these are some generally approachable ideas for the general public…

Google’s Goal : Deliver humans to valid content as easily and quickly as possible.

Not that complicated huh?

Google detects fails via various means. One is bounce rates.  A bounce is when you get to a site from a search engine result and then use the back button or re-search (conduct another search). This indicates the site was weak and the browser wants another option.

If there are a lot of bounces, you drop in ranking as the content correlation to the search results is proving to be less valid.

Bounce is one of many metrics and methods that contribute to ranking.  Google (in particular) owns the web, sees all, knows all, and takes action on all!

The Google Analytics protocol and service is an industry standard and allows Google to see trends and have scope unlike any other service or company. DO NOT DISCOUNT THIS EVER! you must play a fair game PERIOD!

Closing – Pay Per Click.

Pay per Click (PPC) is any variant of bidding on potential traffic.  I have done considerable work in this realm.  This is usually equivalent to flushing money down the toilet. Stay away from PPC with a new site, you should build organic traffic, have metrics, and make a very well educated decision on how to enter this market.

The educated decision is all about the understanding of the search and browsing habits of your target audience. This comes in time.

Once you have content, some traffic, a good idea on your traffic’s habits, and other 6 month and beyond ideas, yeah, do it! PPC pays off, but you need to manage it every day! This is not a “throw money at the problem type of solution”.

Off the record, through a few different and not so honest means I know and believe, beyond any reasonable doubt, that PPC will raise your ranking. A heavy campaign ($5000 US or more per month) will bump you up directly through the Google ranks. Up to 30% according to my resources (oh the stories behind this data). Yes, this is illegal, unethical, and so on. Like you are going to prove this and battle a giant?

Massive campaigns work mixing PPC with content and other methods. Massive campaigns are $5000+ (US) per month in PPC investment plus another $5000-15000 in staff and content generation.  In the height of the Real Estate boom (ending in 2008) mortgage leads were selling for $20 and more PER CLICK! These banks and bankers walked away with so much dirty money (sub-prime money) because of all these dirty tactics. Funny how you can burn money to make money huh?

Don’t go there.

Hire a web professional you trust, do honest content, and work in segments of 6 months to a year with a 3, 5, and 10 year plan.

So….don’t hire a SEO “expert” EVER! Use a real web professional to filter out the 99% scum in the dedicated SEO marketplace.

The best SEO performance I have ever seen comes from programmers taking over the SEO for a site from a SEO “expert”. My experience and the first hand accounts of the scum bag techniques failing and the success of smart non-SEO “Experts” is why I wrote this article. I am sick of going through this diatribe over and over with all my clients as they meet some moron SEO “Expert” at the bar waiting to cash a check for a short term bump in the search engines only to be down-ranked later due to the dirty methods used by SEO professionals for short term results.

25 November 2010

Apple OSX

I use a Mac.

The OS(X) is just a nightmare with only a few exceptions.

This is not one of the exceptions.

The Problem: I am learning C++ (C Plus Plus) and want to compile and execute some simple programs – math and text manipulation mostly.

Looking for help on anything “tech” for a Mac is like trying to kill someone with a crayon or a piece of felt.

Here is the problem I finally tracked down (6 hours of reading forums).

It turns out that the sym link for the C++ (G++) compiler is linked to 3.3 – here are a few C&P’s form the command line:

lrwxr-xr-x     1 root   wheel            7 Nov 24 22:09 g++ -> g++-3.3
-r-xr-xr-x     1 root   wheel       268808 Dec 24  2005 g++-3.3
-rwxr-xr-x     1 root   wheel        80484 Dec 24  2005 g++-4.0

also

lrwxr-xr-x     1 root   wheel            7 Nov 24 22:09 gcc -> gcc-3.3
-r-xr-xr-x     1 root   wheel       264712 Dec 24  2005 gcc-3.3
-rwxr-xr-x     1 root   wheel        80484 Dec 24  2005 gcc-4.0

Simple enough – symlinks are easy to manage.

See how this works over the ling haul – I put this post up in the hope that someone will hit this and not have to deal with Apple or any of the “experts” on the forums.

Why no XCode?

  1. All the programmers I respect clearly state how much it sucks compared to other dev environments (I use KoMoDo and love Active State products)
  2. $99/year – no
  3. I am not interested in writing for Apple or IOS
  4. My goal is embedded devices

XCode and the whole “Apple” thing is just a joke to me and I already have better tools and other goals.

13 October 2010

Remote Access via SOAP in Magento – the short version

Keeping it short. After I got Crackspace to turn on SOAP (yeah I know how, but we pay for these peep to do this for us!) we got some serious NO WORKY.

Mostly 500 errors, occasional 404 (mod_rewrite was dropping page not found error).

Hit the forums, over and over. Some seriously WACKED solutions and things going on. Nothing was working. Until I hit this post:

http://www.magentocommerce.com/boards/viewthread/42062/

In short Magento programmers FAILED hard core. Besides not testing, they are not even using intelligent IDE’s? (meaning my KoMoDo IDE picked up on the error instantly.

About the change, in the file /app/code/core/Mage/Api/Model/Server/Adapter/Soap.php at line 144 (approx) is this original code:

}else {
 $this->fault('0', 'Unable to load Soap extension on the server');
 return $this;
 }

Where a “}” was missing:

else {
$this->fault('0', 'Unable to load Soap extension on the server');
} // <--- This one is missing, line 135
return $this;
}

Ouch.

So, on to getting this stuff working – fast version:

$proxy = new SoapClient('http://YourSite/api/soap/?wsdl');
$sessionId = $proxy->login('apiuser', 'apipassword');

// ****** Gets core info based on Sku
$products = $proxy->call($sessionId, 'catalog_product.info', 'productsku');
var_dump($products);

The above code will return an array / dump of the product info based on sku via a SOAP call.

You will need to get the api user and password as well as the role dialed in on the admin.

Good Luck.

Addendum : Need images, this will dump and array for the sku with image information:

var_dump($proxy->call($sessionId, 'product_media.list', 'productsku'));
10 September 2010

Get Tracking Information from Magento via Order Number

Pretty straight forward query to get the core shipping information out of  in magento for  v 1.4.1 (will not work pre 1.4x tables changed)

select  shp.number, shp.title, shp.carrier_code, shp.updated_at, flt.shipping_description
 from `magento_store`.`sales_flat_order` as flt
 left join `magento_store`.`sales_flat_shipment_track` as shp
 on (flt.entity_id = shp.order_id)
 where flt.increment_id = '$order_id';

I use a WordPress install to interface with the Magento DB to stress server less.

Don’t forget that the 1.4x shipping API for Magento is B-U-S-T-E-D as of this writing. Here is the link I found:

http://magebase.com/magento-tutorials/shipment-api-in-magento-1-4-1-broken/

28 May 2010

Advanced application of Options in Simple Products

I wanted to drop some notes in there to helpfully assist someone who might be doing weird stuff in Magento like I am.

As short as possible – a current project uses a custom design interface for our products (in Flash) for the final sell-able item.  Every item is a unique design on a “stock” product.

In the end of the design process the design is serialized (in the sense of being unique).  The problem was simple – how do you get the serial # in the cart with the item and pass through the product option phase (not directly to cart).

At first you say – No Problem! Use the

?option[##]=stuff

- not so simple.

After the design options need to be selected like material type or what ever.  So here is some of  my solution…

You can AJAX in your results if you want, but this jumps over the “options” phase of the product page.  Your ajax string looks like this (we can’t use .htaccess rewrites because of Flash – BOO!)

AJAX CALL PROTOTYPE : [code]/index.php/checkout/cart/add/product/113/?options[27]=17067[/code]

27 = option ID and 17067 is our generated serial#

Wrap and trigger that JS how you want.

Ultimately I had to inject a hidden input (dynamically) – the input looks like this:

$inputStr = '<input type="hidden" value="'.$_GET['serial'].'" name="options['.$ret.']">';

This input is printed inside the form here:

…./template/catalog/product/view.phtml

Where the $_GET['serial'] is the unique design instance appended to the product page (generated by a call to the PHP header() function using variables returned form our designer – buncha sick tight queries and code to do this!)

The $ret is the option # for the product. This is returned form a backwards query on the item/sku in Magento.

The basic function is:

// this is actually encapsulated in a class and I leave it as a public static function....
function get_option($product_id){
 $product_id = mysqlEscapeString($product_id);
 $write = Mage::getSingleton('core/resource')->getConnection('core_write');
 $readresult=$write->query("SELECT option_id FROM catalog_product_option WHERE product_id = $product_id AND sku = 'serial';");
 $row = $readresult->fetch();
 if (intval($row['option_id'])>1) {
 return mysqlEscapeString($row['option_id']);
 }else{
 return false;
 }
// there is a lot of room in this  do what you want!

mysqlEscapeString is a local function that preps data for use in MySQL – replace with your favorite one…

This function is fed the Magento product ID (easy to get that info) “serial” is the sku of the option in Magento (we use one sku for all of these product options making things simple)

One of the reasons why I am putting this post up is to warn people on some odd stuff and failures.  I am not about to worry too much on the how and why, instead let me tell you that they fail-xor.

The fail:

The AJAX call above works well BUT if you apply a “?option[##]=#### to the form action by appending to the

this->getAddToCartUrl($_product);

on the file

…./template/catalog/product/view.phtml

The /uenc/STUFF-HERE in the form action”THATLINK”will see extra garbage.

That garbage will cause failure when the form is submitted.  The “garbage”is totally weird and I stopped caring how/why. In short I was getting the standard UENC/STUFF with an underscore and other alpha-numeric info added. This would break the form submission.

So don”mess with the action URL!

I hope this helps, drop a note if you need more or clarification.  This was a long battle in creating a hybrid between a legacy system and Magento.

Closing note – you can not do this in Magento with the Wishlist.  Your expectation of the wishlist operating like a “holding area” that is a parallel dimension to the cart is wrong.  This “stamping” of the product instance with my required serial # is not possible in the wishlist. (**cough Hint Magento team**)

Until this is dialed in (if ever), I wired in our own custom design manager.  Now back to that work…

17 May 2010

Ableton and the Launchpad

Got another Launchpad (actually 2 – long story).  Fun unit.  Clunky, does not have a long life in my world- getting the 2 year Guitar Center serious abuse plan.

Did you know that many manufacturers warranties do not cover professional abuse?

Way to take care of the pros right…?

So when you swap that item you broke at the gig do wipe off the beer and tell them you were working in your basement alone.

As for automap – still a piece of shit, but I am adapting.  Bottom line – when I drop Automap inline I can feel the added lag.  Not a joke, just a low performance item.

12 April 2010

GoDaddy 554 Error gone horribly wrong

Short and sweet, if and when I am found to be in error let me know so I can update.

Define the players:

  • Email thread between me and 2 other people me@somegodaddyhostedemail.com and person1@gmail.com and person2@hotmail.com
  • Also, there is a site referred to as referencedsite-inmessagebody.com – copied and pasted in the discussion.

Timeline, crude but true:

  1. Email string gets big, 10+ responses
  2. Suddenly email only yeilds massive 554 errors from GoDaddy – no option to avoid fail
  3. Email programs and (my) IP address changes with no effect on the final outcome.
  4. Call GoDaddy, they scan the issue email.
  5. Answer: referencedsite-inmessagebody.com has an associated PBL entry (http://www.spamhaus.org/pbl/) via the IP address associated with the domain.

We now stop and look at the problem.

The site referencedsite-inmessagebody.com is associated with an ip address that has a PBL listing.  In short it could be said that referencedsite-inmessagebody.com sent spam or had mail flagged as spam and made it on the naughty list.

Moving forward with the assumption that referencedsite-inmessagebody.com is not one of the real offenders of spam on the net. We have to ask WTF?

Well, the WTF turns out to be just plain evil wrapped in evil.

I drop a WhoIs on referencedsite-inmessagebody.com and find out they are on a large shared (virtual) host. We all use similar services.

I happen to know this host, I use them.  Generally I think the company runs 200+ clients per server.

What follows is a wild summary of the conversation I had with the tech at GoDaddy (he was cool and honest).

Any idiot on a virtual host can start spamming, get busted, loose account and flag the (shared) IP . That means  referencedsite-inmessagebody.com is  pretty much doomed along with any emails associated to that domain name, regardless of the location of the email server (as far as IP address goes).

Doomed to the point where (the actually broken GoDaddy protocol) is blocking my email because my message body has a “flagged” http address (with associated PBL flagged IP address).

Is there anything to be done – Nope. I asked they guy straight up, should I just move my emails off or is there something we can  do such as petitions.

His response was “don’t even try”.

My Solution is to move all these email accounts onto a leased server with dedicated IP address I can get unflagged if ever necessary and run no risk of colliding with “some idiot”.

Ever wonder why certain stuff will NEVER EVER make it from one email to another, this is a clear outline of a protocol that will (often silently) kill your communication.

Emergency Workarounds are available and cumbersome for the low-tech.  I suggest instant messaging and file sharing sites.  You can create a real time one-to-one connection with your target and provide information to get the data.

File sharing services (of the professional type) are also a good alternative for moving files, but this is not a solution for general text communication over email.

Let’s close out with a list of things you should not do:

  • Do not use shared hosting with out a dedicated IP
  • Do not use any service like GoDaddy who utilizes services like SpamHaus
  • Do not reference any website in your email or only write them as “domain[dot]com”

And one more important “beware“:

  • Beware the dynamic IP address. (Who knows how many IP’s we all share are flagged and/or associated with strange shit)

With that in mind email becomes a rather difficult form of communication.

I was taking no responses personally when they were dying or errored out. Going to have to meet people face to face  to talk.

OMG.

16 February 2010

CSS Compression with nothing more than your brain

Right now I am compressing some CSS into a slimmer package. This is only one of a few steps, but this little bit of planning and thought will save a lot of time in the end.  Especially when your CSS file is 2000+ lines and already formatted in line to decrease line count.

The original:

#iz_catnav {
    background: url(/add/images/left_nav_rpt.png) repeat;
    width:185px;
    padding:4px 0px 4px 0px;
    overflow:hidden;
}
#catNavCap {
    height:30px;
    width:185px;
    background: url(/add/images/left_nav_cap.png) no-repeat;
    margin:0px;
    padding:0px;
}
#catNavBase {
    height:30px;
    width:185px;
    background: url(/add/images/left_nav_base.png) no-repeat;
}

compacted:

#iz_catnav, #catNavCap, #catNavBase  {
    background: url(/add/images/left_nav_rpt.png) repeat;
    width:185px;
    padding:4px 0px;
}
#catNavCap, #catNavBase {
    height:30px;
    margin:0px;
    padding:0px;
}
#catNavCap, #catNavBase {
    background: url(/add/images/left_nav_cap.png) no-repeat;
}
#catNavBase {
    background: url(/add/images/left_nav_base.png) no-repeat;
}

So, minor gain, a 2 line reduction. From 18 lines to 16 lines. Just over 10% reduction.  Think about that on the scale of thousands of lines of CSS. Then compound that with “smart” design and setting up better patterns in your CSS including Object-Orientated CSS where standard attributes are wrapped up in a well defined document.

How many times are you Floating?  What if there was compressed style sheet with all your common needs defined in classes.  Nice huh? That is the idea behind OO-CSS – more reusable objects (classes).

15 February 2010

Comcast + NBC = World Destruction

Now that I got your attention, think about this -

Comcast’s purchase of NBC must be stopped!  The information Comcast has relating to delivery of content creates a destructive and unethical loophole for them to control content and media.

Just like priming search results.

Remember, Comcast delivers “cable tv” to much of America. The trends, habits, and other KEY demographic and statistical information is the sole property of Comcast.  This gives Comcast an unethical and (should be) illegal advantage in competition.

This is not illegal as far as I know. Only because our weak government is too tied up in abortion and killing Arabs to deal with domestic issues.

We really need to get the word out that this behavior is wrong, unethical, and should be stopped.  Let’s focus some energy on getting the current batch of old fart worthless dirty politicians out of office and get some intelligent people in there.

This is serious business, am I the only one who sees this stuff?

8 February 2010

Magento E-Commerce bare as all hell navigation

Need to get the Product categories output for custom scripts (like I am doing).  Here is a basic prototype to begin:

// Nevermind - this will not make subcats, the children are all from the main
$obj = new Mage_Catalog_Block_Navigation();
$store_cats    = $obj->getStoreCategories();
$current_cat     = $obj->getCurrentCategory();
$current_cat    = (is_object($current_cat) ? $current_cat->getName() : '');

foreach ($store_cats as $cat) {
  echo '1- '.$obj->getCategoryUrl($cat).' 2- '.$cat->getName().' - -';
  foreach ($obj->getCurrentChildCategories() as $subcat) {
    echo 'A- '.$this->getCategoryUrl($subcat).' B- '.$subcat->getName();
  }
}

// author : @marwei / datamafia.com / interzonemultimedia.com
// Check this out! for one level deep cat menu that you can place anywhere

// get your object
$navobj = new Mage_Catalog_Block_Navigation();
$store_cats    = $navobj->getStoreCategories();

// open the list
$ret = '<ul id="corpDesMageNav">';
// parent cat loop
foreach ($store_cats as $cat) {
 $ret .= '<li>'.$cat->getRequestPath().' - '.$cat->getName().'</li>';
 $subcats = $cat->getChildren();
 // one deep subcategory
 $subCtr = 0; // for counting in the next foreach
 $closeUL = false;
 // reset the trigger // Child cat / one deep loop
 foreach($subcats as $kid){
 if ($subCtr==0) { // first itteration opens the (nested) <ul>
 $ret .= '<ul style="margin-left:20px;"><!-- Only a helper for the subcat -->';
 $closeUL = true;
 }
 $subCtr++;
 $ret .= '<li> [sub cat] '.$kid->getRequestPath().' + '.$kid->getName().'</li>';
 }
 if ($closeUL == true) { // close the ul based on event trigger
 $ret .= '</ul>';
 }
}
$ret .= '</ul>';
echo $ret;

Notes on the (revised) above content. Most (but not all???) of the methods from the Class work (Magento reference).  The above example provides you with the big pieces of information. The Cat Name and the Cat Link.

More importantly – this method allows you to use the menu system ANYWHERE! You are not working with $this->stuff, instead you are dropping isolated instances. My need arised because we are switching in important legacy information and programs in the middle of Magento.   Trust me when I say No ecommerce software was ready for what we are doing.

So I can drop in custom scripting in the content pane using a simple content controller and variable sniffer inside the Magento system and then drop menus and such with out head ache.

The example is FAR from your final output, but this is enough for a programmer with medium skill to get a custom navigation going.  My output has some “garbage” in there to help look at the category information. It should only take a minute to clean it up and check Strict.

And, as a friendly reminder, watch your “default category”.  Magento (at the time of this post) reads from the top level category, no exceptions.  There is plenty of documentation on this topic in the forums.

I hope this helps, let me know if you need more!

/*
 ONE FINAL EXAMPLE - 3 levels deep!!!!
 If anyone wants to write this into a fully recursive function/class let me know. I only need 3 deep
Adding another nested foreach is easier than a unit test on recursion.
*/

// get your object
$navobj = new Mage_Catalog_Block_Navigation();
$store_cats    = $navobj->getStoreCategories();

// open the list
$ret = '<ul id="corpDesMageNav">';
foreach ($store_cats as $cat) {
 $ret .= '<li>'.$cat->getRequestPath().' - '.$cat->getName().'</li>';
 $subcats = $cat->getChildren();
 // one deep subcategory
 $subCtr = 0; // for counting in the next foreach
 $closeUL = false;
 foreach($subcats as $kid){
 if ($subCtr==0) { // first itteration opens the (nested) <ul>
  $ret .= '<ul>';
  $closeUL = true;
 }
 $subCtr++;
 $ret .= '<li style="margin-left:10px;"> [sub cat] '.$kid->getRequestPath().' + '.$kid->getName().'</li>';
 // ome more deep - we got children?
 $subSubCtr = 0;
 $closeSubUL = false;
 if($kid->hasChildren()==1){
  $subSubCat = $kid->getChildren();
  foreach($subSubCat as $grandKid){
   if ($subSubCtr==0) { // itteration opens the (nested) <ul>
   $ret .= '<ul>';
   $closeSubUL = true;
  }         
  $ret .= '<li style="margin-left:20px;"> [sub sub cat] '.$grandKid->getRequestPath().' + '.$grandKid->getName().'</li>';
 }
 if ($closeSubUL == true) { // close the ul based on event trigger
  $ret .= '</ul>';
 }
}
}
 if ($closeUL == true) { // close the ul based on event trigger
 $ret .= '</ul>';
 }
}
$ret .= '</ul>';
echo $ret;