External Forms File Location

Permalink 6 users found helpful
I noticed that there is one sample external form included with the install. I wanted to try out creating an external form but I can't for the life of me find where this sample form is located in the file structure and, consequently, don't know where to create a new external form.

 
andrew replied on at Permalink Reply
andrew
Here's what you'll want to do.

1. Make a new directory in the blocks/ directory in your root install, named "external_form".

2. Go into concrete/blocks/external_form/ and copy the "forms/" directory from there into the directory you just made.

3. You'll notice two files in there now, test_form.php and controllers/test_form.php. Change that to whatever you'd like your new form to be called (e.g. "contact_us.php" for both filenames.)

4. Open controllers/contact_us.php, and change

TestFormExternalFormBlockController

to

ContactUsExternalFormBlockController

Now, edit your site, and add an external form to a page. You should now see "Contact Us" as a form in the list. Add that to a page, and you should see your new form. You can edit the HTML in blocks/external_form/forms/contact_us.php, and edit what happens automatically when the form submits by modifying the action methods inside the controller. Whatever action you give your form (by default it's "test_search" will automatically run, when submit, the function that has the same name with action_ in front of it.

So, if you change your form to submit to <?=$this->action('process_contact_form')?>, you'll just need to create a method in your controller named action_process_contact_form - and it should run automatically.

Hope this helps!
jrussell replied on at Permalink Reply
I host my site directly with concrete5 and it seems that certain file locations are different. I can't find any concrete directory and, as a result, no forms as indicated. This might be due to the way concrete5 handles their hosting but I'm not sure. Any other ideas/tips?

Thanks much
andrew replied on at Permalink Reply 1 Attachment
andrew
We keep all of our core code in one place, shared between all concrete5 installs.

I've attached a zipped copy of what you'd find in the concrete/blocks/external_form/forms/ directory. You should be able to create blocks/external_form/forms/ in your local directory and use these as a starting point (Let me know if this doesn't work.)
dihakz replied on at Permalink Reply
dihakz
Hi, Andrew-

You're touching on something I have been trying to figure out! I am implementing several concrete5 CMS's for different clients. I have customized the core app, and don't want to have to customize it each time (or copy the same files over, etc.) whenever setting up a new client.

How can I also have ONE central c5 installation, that all CMS's reference, so that I only have to keep one version customized, and up-to-date?

Thanks!!
Darren
frz replied on at Permalink Reply
frz
It sounds like you'd really benefit from joining our hosting partner program. Amongst many other benefits, you get a whitepaper that explains how we do just that.

http://www.concrete5.org/help/support_and_partners/c5hosting_partne...
-frz
dihakz replied on at Permalink Reply
dihakz
not that I would not be interested... I am... however, I'm not a hosting company! :-)

I resell hosting for hostmysite.com... but, as a developer I deploy a lot of this stuff.
frz replied on at Permalink Reply
frz
The idea of creating these areas for professionals who work in a field is more about having that private space that fosters open communication.

I am a hosting company, but I don't actually have servers in the basement.

My guess is our stringent approval committee would probably grant you membership.
dihakz replied on at Permalink Reply
dihakz
one more question, on that, then:

Would I have the option of being a Hosting partner or a Services partner? (also, is it just one or the other?)
frz replied on at Permalink Reply
frz
Yes these are different and Service partners do not get the centralized hosting white paper.

We are proudly offering a 10% discount on joining both plans at once however.
Sparx replied on at Permalink Reply
Sparx
Having one main c5 install that is customized with extra blocks and features etc, and my clients C5 websites are on seperate domain names, but run off the same core C5???

Is this possible? What is involved to get this done??

Cheers
kutis replied on at Permalink Reply
kutis
but it is still a multiple install

on your host, move the siteA.com/concrete to /concrete_core (just an example to make it obvious)

then remove all the concrete directories in all other sites. then go to each site create a hard link to concrete_core

ln -s /concrete_core concrete
bnsubrahmanyam replied on at Permalink Reply
bnsubrahmanyam
I have added Sucessfully the external form to my site.

Thanks!
Subrahmanayam--INDIA
neatgadgets replied on at Permalink Reply
I got to step 4, but I don't see the new form in the list. Tried reopening the browser with no success.

So I have a copy of the forms folder from concrete\blocks\external_form in the block\external\blocks\external_form

I have checked permissions to be owned as they should and on the php scripts are -wr-r--r--

Is there something I am missing?
neatgadgets replied on at Permalink Reply
Had a typo in the folder name. external_forms should be external_form
llj replied on at Permalink Reply
Thanks for the instructions Andrew. Straight forward and simple and took me less than a minute to get my new external form on my site.
harmst replied on at Permalink Reply
thank you, for this.

i have a little Problem. I need a img on my external form, but $this->getThemePath() give not the correct Path to my Site Themes.

What is the correct Way ?

Best Regards
Thomas
intellib replied on at Permalink Reply
Hi

This is my first time tring C5.
What can I do with the labels and the error messages for the diffrent languages? I don't understand the technic/logic behind this mechanism in C5 - THX
misebaz replied on at Permalink Reply
misebaz
Hi,

I am trying to create external forms but unable to. I tried the steps that Andrew has given above but cannot do it. I am unable to open the attachment he provided also.

Can anyone help me?

Thanks
removemeplease replied on at Permalink Reply
removemeplease
I don't know what he attached, either. You didn't describe much about what part of his steps you were having trouble with, you only said you can't do it. So it's a shot in the dark here, but here is the solution that worked for me:

http://www.concrete5.org/community/forums/usage/tried-to-add-an-ext...

It rolls back a page that you might've messed up trying to get an external form on it.
misebaz replied on at Permalink Reply
misebaz
Hi dfo,

Sorry for not being clear enough but step two in Andrew's post is what I am having trouble with. How can I find this location from the Website? I think if I knew how to locate it I might finally get the hang of these External Forms.

I didn't mess up a page so I don't need to roll back.

Sorry if the above sounds too simple but I'm not very tech savvy.

Thanks

Barry
removemeplease replied on at Permalink Reply
removemeplease
Alright, so wherever you installed Concrete5, that directory is called your "ROOT". For me, it's [server_name]/htdocs/, for others it might be [something_else]/public_html/.

When you find your ROOT, it contains many folders:
blocks/
concrete/
config/
controllers/
css/
elements/
files/
...many others...


I assume you found your ROOT because you didn't have trouble with andrew's step 1, where he says to create a directory in blocks/ called 'external_form'.

So now go back to your ROOT.

In step 2 he says to click into concrete/blocks/external_form/ and copy the folder in there called 'forms'.

So from your ROOT, click into concrete/ then into blocks/ then into external_form/ and right-click the 'forms' folder and select Copy.

You'll paste this into the 'external_form' folder you created in step 1. So go back to your ROOT, click into blocks/ and then external_form/. Go to the Edit menu in the top left corner of your screen and select Paste. You should now see a folder called 'forms' and can continue on to step 3.

Ultimately I'll bet the confusion came from having to go back to your ROOT. If you click into the concrete/ directory from your ROOT, you'll see it looks exactly the same as your ROOT - it contains all the same folders. These are all the default source files that make your site function. It would be dangerous to edit those files directly and potentially break something that you can't fix without reinstalling Concrete5. So andrew's step 2 is basically making a copy of these source files in your ROOT so that you can work on them without causing irreparable damage to your Concrete5 installation.

It's like in Photoshop, when you start editing a photo it's always best to duplicate the original in a new layerso if you royally mess up, you still have the unedited base layer.
misebaz replied on at Permalink Reply
misebaz
Hi dfo,

Sorry but didn't get past step 1 :-/
cannonf700 replied on at Permalink Reply
cannonf700
Will the results to an external form appear in the reports section of the dashboard?

what would a good "action" call/class look like? the contact form uses "submit_form" can you reuse this?
BeKindRewind replied on at Permalink Reply
BeKindRewind
I actually would like to know how to do this as well. I want to create a custom external form layout (because the regular form block is too simple), but have it post the data to the reports section of the dashboard.
aaron replied on at Permalink Reply
I would like to see this also, any examples would be great BUMP...
mbayhylle replied on at Permalink Reply
mbayhylle
This would be really helpful to me, too.
Any input would be welcome.
okhayat replied on at Permalink Reply
okhayat
matogertel replied on at Permalink Reply
matogertel
The community form block solves precisely this issue. It allows you to use the form block to define all the form fields, but create your own view easily and attach an external controller to it.
Check it out here:
http://www.concrete5.org/community/forums/block_requests/new-commun...
mikeb replied on at Permalink Reply
mikeb
Just a short note to prevent some hair pulling! It's important to make sure that when changing TestFormExternalFormBlockController to your form name that you do it exactly the same as your form name without the underscores. So if your form is called my_feedback_form then you should rename the ExternalFormBlockController to MyFeedbackFormExternalFormBlockController
A bit pedantic I know but in my case I didn't realise this and it cost me some time :-)
vinfo replied on at Permalink Reply
vinfo
How I can manage external forms that I create?
How I can manage through the Dashboard?
frz replied on at Permalink Reply
frz
The custom forms all live in a single directory. You can add to them
directly from the file system. There's no way to manage them through
the dashboard.

best wishes

Franz Maruna
CEO - concrete5.org
http://about.me/frz