During Chanukah the paragraph of “Al ha-nissim” is inserted into shemonah esrei and birchas ha-mazon. Towards the end of “Al ha-nissim” it says: “ve-hidliku neiros be-chatzros kodshecha,”- “and they lit the candles [of the menorah] in Your holy chatzer.” The word ‘chatzer’ in context of the mikdash generally refers to the courtyard area outside of the heichal. But, the menorah, as we know from the Gemara Menachos (28b), was situated inside the heichal, directly opposite the shulchan. Why, then, does this line imply it was lit in the chatzer?
The Chasam Sofer in his derashos on Chanukah (Vol.1, pg. 67) suggests that the Chashmonaim moved the menorah from inside the heichal out to the chatzer due to the fact that the Greeks had placed idols in the heichal, making it unusable for the avodah. The Chasam Sofer bases himself on the Rambam in Hilchos Bias Mikdash (9:7) who says that a non-kohen may light the menorah, and since a non-kohen may not enter the heichal, the menorah may be taken out into the chatzer in order to be lit. Thus, the idea of lighting of the menorah outside the heichal does have a halachic support.