How to replace part of the autonav link with an image?

Permalink
I use autonav hadrcoded into the theme to display sidebar navigation.
I have multiple product pages that have names like "ProductName SOMETHING TECHNOLOGY Gadget".

How could I replace the "SOMETHING TECH" with a logo image?

It has to be autonav so that new links automatically appear if new product pages are created.

I'm using jordan's clean autonav template with minimal modifications.

I'm thinking about adding a loop somewhere that checks if the Page Name contains SOMETHING TECH, and if so, it outputs the Page Name with an image in place of S.T. instead of the page name, but I'm not sure how would I do this.

I'm open to any other suggestions, maybe there is an easier way to achieve this goal.

Thanks in advance.

 
gd42 replied on at Permalink Best Answer Reply
I think I found a solution:

I inserted the following:

//Logo image replacer
$logocheck = $ni->getName();
   if (strpos($logocheck,"ACME") !== false) {
      $linkname = str_ireplace("ACME","<span class=\"ACME-small\">ACME</span>", $logocheck);
      }
   else {
      $linkname = $logocheck;
      };


Then changed
$navItem->name = $ni->getName();

to
$navItem->name = $linkname;


So it adds a class to the word, that can be easily replaced with an image via CSS.