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.
Incidentally, the lighting of the menorah outside must have caused the miracle of Chanukah to be greatly publicized in front of all of the Jews, not just the kohanim. It is in this vein that Chanukah candles were instituted to be placed “al pesach beiso mi’ba’chutz” – “by the entrance of the house, outside” (Shabbos 21b) in order to have more pirsumei nissa.
In a similar approach, Rav Tzvi Hirsh Charif (quoted in Parparos Le-torah, pg. 334) posits that because the Chashmonaim were tamei meis from fighting the war, they stood in the courtyard and used long wooden sticks to light the menorah that was inside heichal to avoid entering in a state of impurity. This is the “lighting in the chatzer” that Al Ha-Nissim refers to.
Rav Chaim Kanievsky (Ta’ama Di-kra, pg. 29) answers by noting that the term ‘chatzer’ can also be used to refer to the heichal (see Rashi on Yechezkel 44:19), in which case the question has no basis whatsoever. However, one might question this answer due to the fact that the word heichal is used earlier in “Al ha-nissim” (“u-finu es heichalecha”), implying that that the word chatzer is indeed something else.
One final theory is found in the commentary of Rav Baruch Epstein (author of the Torah Temimah) on the siddur called “Baruch She-amar”. There he writes (pg. 147) that the phrase “ve-hidliku neiros be-chatzros kodshecha” in Al Ha-nissim does not refer to the lighting of the menorah at all. Rather, it refers to general, festive lights that were lit in the courtyard of the mikdash as part of the triumphant celebration of the Jews’ victory. These lights were the same ones used in the simchas beis ha-shoeva on Sukkos (mentioned in the 5th perek of Meseches Sukkah). Thus, the menorah was lit inside the heichal as usual.
Support for this idea can be drawn from the fact that the main theme of “Al ha-nissim” is the Chashmonaim winning the war, not the miracle of the pach ha-shemen. Also, this approach might help strengthen the connection between Chanukah and Sukkos, since both used the festive lights to enhance and publicize the event that was being celebrated. This would perhaps shed light on the opinion of Beis Shammai that says that one should decrease the amount of candles each night of Chanukah the same way the parei ha-chag, the bull offerings of Sukkos, decreased in number each day of Sukkos.