Hi. I use Sitelok for my website. It requires the addition of PHP snippets in the prefix area of a page. This has in the past been an issue with previewing pages in Rapidweaver but the issue was solved in earlier builds of RW8.
In the most recent builds of RW8 the problem has returned. I cannot preview a page if there is php code in the prefix section of the page - instead I receive a fatal error. The preview is fine if the code is removed.
As Jannis (@instacks) said, post the code snippet here, make sure you mark it as code by selecting the code after pasting and choosing the </> in the toolbar.
Also a screenshot of the fatal error message that you’re getting would be helpful.
**Fatal error** : require_once(): Failed opening required '/xxxx/slpw/sitelokpw.php' (include_path='.:') in **/private/var/folders/4t/sp89pcxn2hqgk_4ywh_n_bbm0000gn/T/com.realmacsoftware.rapidweaver8/RapidWeaver/10366/document-0x7ff974d57c40/RWDocumentPagePreview/news/index.php** on line **3**
Thanks everyone. The odd thing is that this behaviour is new. I have had that code on my site for years and previewing a web page worked perfectly until a few months ago. Has something changed within RapidWeaver?
I do hope that this issue gets fixed as I use this same Sitelok PHP code in the Prefix section of my site on approximately 700 pages. It has worked perfectly well for many years, until now apparently.
Thanks @instacks, swappping out require_once for include_once does work, but having read up on the subtle difference I don’t think I’ll be using it in this case.
Let’s hope RapidWeaver restores the fix that worked before, please @dan?