You could put Weblinks to both Google and Yahoo up in your site (where-ever you want them).
Then you can use the exact same template, but change your call to the Wayfinder snippet... this is the snippet that can auto-generate a menu. It can build links to all pages in a certain folder, for example. It has a parameter named "&excludeDocs"
Pretend Google is a Weblink in your system with ID 12, Yahoo is a weblink in your system with ID 13.
So on PageA, you might have a call to wayfinder like this:
[[Wayfinder? &startId=`0` &excludeDocs=`12` ]]
PageB might have something like this:
[[Wayfinder? &startId=`0` &excludeDocs=`13` ]]
You can put your Wayfinder call in your document content somewhere... then you wouldn’t have to use 2 different templates to accomplish what you want.
Full Wayfinder documentation is here:
http://www.muddydogpaws.com/development/wayfinder/parameters.html