Not sure if I agree with the above answer.
I agree that "template" and "boilerplate" are different names for the same thing. But frameworks?!
I keep using analogies to help me think. And if I think about the working environment of Monty Python's Terry Gilliam (), I must come to the conclusion that there are in fact differences.
Template/boilerplate: desk with ruler, margins, etc.
Library: cuttings.
Framework: template + library + lights + shooting camera + tape + glass + ....
So, by framework is meant basically ALL the working environment, where we can find templates, libraries, others tools like debuggers, tools for auto-complete, compilers, etc etc.
Does this make any sense?