Copy link to clipboard
Copied
I'm loving the Device Preview option, but I'm a bit stuck trying to figure out if it's possible to set it up using includes.
For instance, let's say that I load everything from index.php, which has "include($_GET['page'].'.php')" - so while I'm working on the index file, I can see the homepage just fine, but let's say in case of "index.php?page=contact" - I would need to edit the contact.php file, however, when I open that file, it wouldn't load through the index, it "thinks" it's own page... which makes sense, but is there any way to set it up so that I can open contact.php in Dreamweaver and see "index.php?page=contact" in the device preview?
You can't because Real-time Preview runs inside a shell. The only way to see your page is by right-clicking on the page -> This Frame -> Open Frame in New .. as in the following and then entering the URL parameters.
Copy link to clipboard
Copied
Do you have a local testing server?
Copy link to clipboard
Copied
Yes, I do. That's what I mean. index.php will load fine, and when I go to contact.php, it also shows me contexts of that php file, but I'm hoping to figure out a way to load index.php?page=cotact when I'm editing contact.php.
Copy link to clipboard
Copied
You can't because Real-time Preview runs inside a shell. The only way to see your page is by right-clicking on the page -> This Frame -> Open Frame in New .. as in the following and then entering the URL parameters.
Copy link to clipboard
Copied
Yes, I can inspect it and see the frame. I was curious if anyone created some sort of workaround for similar situation either using actual php code or .htaccess routing.
The best I came up with thus far is setting a flag in index.php and then redirecting when to index when flag isn't detected, but it seems very hacky.
Copy link to clipboard
Copied
Have you tried Brackets? It would be interesting to know if it works in Brackets.
Copy link to clipboard
Copied
No, I haven't used Brackets before. I mean, the default preview seems to be doing it's job, so I'd assume brackets would work exactly the same.