How about adding one last "else" here to explicitly assign the partial as an empty string (when there's neither content nor a "href" attribute)?

This would be different from not setting the partial at all, which the template would react with a default value (that's not necessarily an empty string).