01 -  Set the oven to 400°F to ensure even baking. 
 02 -  In a large ovenproof baking dish, combine the cherry tomatoes, sun-dried tomatoes, sliced garlic, and 2 tablespoons olive oil. Season generously with salt, freshly ground black pepper, dried oregano, and crushed red pepper flakes if using. Toss thoroughly to coat. 
 03 -  Nestle the block of feta cheese into the center of the baking dish among the vegetables. Drizzle 1 tablespoon olive oil over the cheese and season lightly with black pepper. 
 04 -  Bake in the preheated oven for 25 to 30 minutes, or until the tomatoes have burst and the feta is softened with golden edges. 
 05 -  While the feta bakes, heat a large skillet over medium heat. Add 1 tablespoon olive oil and add the sliced onions. Cook, stirring occasionally, for 15 to 20 minutes until the onions are deeply caramelised and golden brown. Set aside. 
 06 -  Simultaneously, cook the pasta according to the package instructions in a large pot of boiling, salted water until al dente. Reserve 1/2 cup of pasta water, then drain the pasta. 
 07 -  Remove the baking dish from the oven. Add caramelised onions and chopped basil to the dish. Stir well, breaking up the feta to create a creamy sauce. 
 08 -  Add the drained pasta to the dish and toss to coat evenly. If needed, gradually stir in reserved pasta water to reach the desired consistency. 
 09 -  Transfer to serving plates, garnishing with additional fresh basil and a drizzle of olive oil if desired. Serve immediately.