In a large frying pan, melt 50g of the butter. Add the sliced onions, season well, then cook gently for about 20 minutes until soft and lightly browned.
Preheat the oven to 200°C/fan 180°C/gas 6. Bring a large pan of salted water to the boil. Add the potatoes, then return to the boil and cook for 4-5 minutes until just tender when pierced with a sharp knife. Drain well, then set aside.
Heat the remaining butter in a large non-stick, ovenproof frying pan. Arrange a third of the potatoes in the pan and fry gently for about 5 minutes until crisp and golden underneath
Remove from the heat, then cover with half the cooked onions, a little seasoning and a third of the cheese. Add a second layer of potatoes and the remaining onions. Season, then scatter over half the remaining cheese. Add a final layer of potatoes, then scatter with the remaining grated cheese.
Transfer the pan to the oven and bake for 25-30 minutes until golden.