Pretty URLs and External Forms

Permalink
I notice when submitting to a method in an external form controller, the URL displayed in the browser goes from a "pretty" one to a long URL with lots of parameters on it. Since I'm essentially posting to a controller for the same page as the form itself, is there any way to not have the URL change?

(As a side note, if I keep all the controller logic in the external form file itself, and change the action to be that same file, everything works just fine -- just would be nice to move the control logic into the separate file).

 
jordanlev replied on at Permalink Reply
jordanlev
blech... I hate the external form. I just create custom form blocks instead. Here is some boilerplate code that gets you started -- much easier to understand and work with than the External Form block (in my opinion):

https://github.com/jordanlev/c5_custom_contact_form...

...as for the "non-pretty" form action URL... there was another thread about that recently:http://www.concrete5.org/community/forums/customizing_c5/pretty-url...

Unfortunately the short answer is "no".
mhawke replied on at Permalink Reply
mhawke
Just a tip if your installing jordenlevs custom form block in version 5.6. Make sure you have the C5's 'Overrides Cache' off or it throws an error when you try to install the block with "Dashboard > Block Types".

(Side note: Concrete5 really ought to provide a more informative error message when this happens.)
jordanlev replied on at Permalink Reply
jordanlev
Thanks for the heads-up! I had no idea (just started building 5.6 sites recently).

I've updated the README file to indicate this. Please feel free to let me know about any bugs or errors you encounter with my code in the future -- it helps me out a lot since I don't always run into every situation in my own work.

Thanks again.

-Jordan
klm1 replied on at Permalink Reply
@jordanlev -- yes, the form blocks do seem a lot better, but from what I understand, they don't work with databases that are completely external to C5 -- which I happen to have in this case.

I'll just keep everything in the one file right now and not use a separate controller file -- not as elegant but it does work.