Self-Evident / OneFileCMS

A single file cms - all in one file!
http://onefilecms.com/
165 stars 57 forks source link

Feature request - pass file name #38

Closed jwzumwalt closed 8 years ago

jwzumwalt commented 9 years ago

It would be nice to be able to pass a specific file name for the editor to open. i.e. onefilecms.php?fname=test.htm

Tanks for the hard work and your consideration to this suggestion :)

Self-Evident commented 8 years ago

This is a good suggestion. I'll tackle this after looking at some of the other issues (I'm a bit behind). If you, or anybody, have any suggestions on the implementation, that would be welcome.

Self-Evident commented 8 years ago

Actually, (and I don't know why I didn't realize this on first reading), you can manually enter a path and file name. That's actually how OFCMS passes some info to itself. For example:

http://www.example.com/onefilecms.php?i=some_directory/&f=H-sample.html&p=edit

The "i" parameter means directory "index" - the directory path to the file (relative to the root of the website) . The "f" parameter is the file's name. And "p=edit" means, well, edit page. :)

Hope that helps!

jwzumwalt commented 8 years ago

So... a "help" tab for a pop-up would be best so a user can access this information (and probably more)... right? At a minimum, this information should at least be in the program header comment.

In addition, I recommend the default be "edit" mode (after all, this is the main use of the program) and a parameter such as "n" be used for "no edit" - to disable editing (which would be rarely used).

This is what I put in my header and I expect there are some other hidden commands... "i" index - path to file (relative to site root) . "f" file name. "p" enable edit http://www.example.com/onefilecms.php?i=path/to/file/&f=sample.html&p=edit