Use the Wordpress Codex in Symfony2 Twig templates

704 Views Asked by At

The last couple of months we have been busy developing a Symfony application. Aside of that we developed a Wordpress website. Now I'm busy integrating the Wordpress website into the Symfony application, which I've separated in two steps.

Step 1: Handling the request. Symfony2 or Wordpress should handle the incoming request. This step is important for the deployment structure of the entire application.

Step 2: Including Wordpress into the Symfony2 Twig templates. Because Symfony2 hasn't a CMS out-of-the-box.

The first step went great, I've found a quite good snippet on https://gist.github.com/1170134 and implemented this into the Symfony app.php file. The wordpress installation now lives into the /web directory of the Symfony installation

The second step is a bit harder, and is the part I can't get fixed. The problem isn't solved by installing a WordpressBundle like https://github.com/kayue/WordpressBundle . I tried starting with integrating the Wordpress footer (footer.php of the template dir). My questions:

When above problems are solved, what is lasting for the future is:

Step 3: Using Twig in the Wordpress template

Step 4: Using Symfony2 variables in the Wordpress template

To solve step 3 I've found https://github.com/cordoval/Twig-for-WordPress. What I don't know is or this package is maintained enough to follow the Symfony release pace.

For step 4 I have not found anything yet. That actually doesn't matter for now, but I could imagine that there are many more people that are strugling with all those 4 steps as mentioned above.

0

There are 0 best solutions below