01 - Preheat the oven to 400°F.
02 - Place cherry tomatoes, sun-dried tomatoes, garlic, and 2 tablespoons olive oil into a large ovenproof baking dish. Season generously with salt, black pepper, dried oregano, and crushed red pepper flakes if desired, then toss to combine.
03 - Nestle the block of feta cheese in the center of the baking dish amongst the vegetables. Drizzle 1 tablespoon olive oil over the feta and lightly season with pepper.
04 - Transfer the dish to the oven and bake for 25 to 30 minutes, until tomatoes have burst and feta is soft and golden at the edges.
05 - Meanwhile, heat a large skillet over medium heat. Add 1 tablespoon olive oil and the sliced onions. Cook, stirring occasionally, for 15 to 20 minutes until deeply caramelized and golden brown, then set aside.
06 - While onions are caramelizing, cook the pasta in a large pot of salted boiling water according to package instructions until al dente. Reserve 1/2 cup pasta cooking water, then drain.
07 - Remove baking dish from oven. Add caramelized onions and chopped basil to the dish. Stir well, breaking up the feta to form a creamy sauce.
08 - Add cooked pasta to the dish and toss gently until coated. Add reserved pasta water gradually for a smoother sauce if desired.
09 - Serve immediately, garnished with additional basil and a drizzle of olive oil as desired.