Can someone please provide more detail or point to docs for info with php rendering in RW8 and what it’s limitations are. I use php includes on my site and, of course, these includes have never rendered (I didn’t expect them to) but I’m unsure of what the “local” php rendering feature is all about in RW8. Bottom of RapidWeaver home page says:
No fiddly MAMP setup required, add PHP into any page and it works just like magic!
Like previous versions, my includes don’t render in RW8. But then, the include code itself only resides on my server. Only the include “call” is in the project file.
That’s a fine way to go about it too. That will load a file that’s stored in /includes/sidebar.html – but you’ll need to make sure you have something there to include.
In preview-mode (and the new Simulation-mode) only a single page is exported along with resources and any extra files required by that one page (for instance Stacks often adds JS files, and image files, etc.).
I guess the next question is: where is this sidebar.html file coming from? Is that another RapidWeaver page? Or something that you upload to your server manually? Or maybe a folder of things you add to the RW project as a “resource”?
In each case there are probably some things you can do to make your Preview work a bit better by adjusting the path or having a locally exported copy of your includes folder.
Actually Isaiah, I’ve been successfully using that code for years. Back when I used Dreamweaver I learned how to do php includes. (Some I hand code, some I create in RW then I fix paths by hand and upload the appropriate snippet of code.)
But the php doesn’t render in RW8 preview either. Works fine live, always has. The actual includes (files) are manually uploaded to my server to an “includes” folder. Believe it or not, I’ve used RW 5, 6, 7 and now 8 and never used the RW “Resources.” Any “resources” I use I just upload manually and link to it.
I guess I don’t understand how RW renders php. Seems, I would have to have the includes available locally for RW to render them in preview but I would have no idea how to “replicate” the server path as a local path and then have both server and local includes work. So I question whether any kind of php code that contains a “path” would render in RW. Or am I totally missing something?
But if I remember correctly my includes worked fine in MAMP when I was using it… but that’s been some time ago… My memory may be unclear. But of course, with MAMP I had exported my RW pages to MAMP, and that included the includes.
That’s helps Jannis, thanks! Perhaps I’ll play around with that concept. I understand your point. I would need to learn some things in order to grab the state. That would be a good project for me. Thanks.