Suggestion for Datatables Editor Demo Improvement
Suggestion for Datatables Editor Demo Improvement
Hi, I just struggled with this for a bit so I wanted to post a suggestion to help others.
I downloaded the PHP version of the datatables editor demo.
I did not find an index.html in the root of the editor-php-1.4.2 folder.
I DID find one in Examples, so in apache, I set my doc root to ../Editor-PHP-1.4.2/examples
The result of this was that the examples came right up, but didn't work!
I spent a good 30 minutes messing with things, double checking I did things per the docs etc...
Suggestion:
1) Move index.html from /Editor-PHP-1.4.2/examples/index.html to /Editor-PHP-1.4.2/index.html
You would need to update all the links in this page, but it should be a simple find&replace
2) Add a line to the documentation to help new users understand where to set the root directory to.
- Jack
Replies
Hi Jack,
Thanks for the feedback - much appreciated! I will look at adding the extra index file for the 1.5 release. The document root is something that is web-server dependent so possibly not something that is suited for the Editor documentation - although if it does become a common issue, I'll certainly add a note about it.
Regards,
Allan
Hi Allan, I don't think the doc root is dependent in this case....
When setting the doc root (be it in nginx, iis, apache, etc) if it's set to the examples folder, then the css, images, js folders aren't accessible via a web browser.
When setting the doc root to Editor-PHP-1.4.2, then since there is no index.html at that level, the user will not see anything (may get an error, or may see a listing of files, depending on how the server is configured)
It's not a big deal, but every little thing that can be done to make it easier to learn should help potential users, and can only benefit everyone involved.
Its the first time I've heard this issue mentioned which is why I'm a little weary of complicating the documentation with it. Setting the root document is (in my experience) a relatively uncommon event (in that it does not happen frequently).
Allan
Hmm, I wonder if I set it up differently than most? Does this tool need a web server, or could I have just run it right from the files on the drive? Maybe I've over thought it!
Yes, it does need a web-server. Its just that normally a web-server has already been set up and folks will just use that server. It is absolutely perfectly valid to want to set up a new virtual host, or spin up an entirely new server for the trial. It just isn't something that I think is commonly done.
This is the fun thing about web dev - there are always a million ways of doing things :-)
Allan
Ahh, that makes sense - so you're thinking that the average person drops it into a subfolder of an existing server - makes sense.
I'm on OSX using MAMP Pro, which makes it easy to add new 'servers' locally
https://www.mamp.info/en/images/screenshots/en_hosts.jpg
would a good compromise be to add an index file in the Editor-php-1.4.2 folder with a single link:
<a href="examples/index.html">view Examples</a>
?
That looks really neat. I'm on a Mac myself, but with a Homebrew Apache build.
I've often wondered what a typical install of DataTables / Editor will be run on, but there is no good way of getting that information I think. I'll keep wondering!
That's basically what I was thinking. A meta refresh to the examples page probably.
Allan