1

I am a Wordpress guy, and I've been given the task of handling my companies Craft site.

I have been at this for hours, and can't seem to figure out how to get the damn form to appear on the page I created.

The one line of code thing does not work when I copy paste it. I have no website data on my local device, so this is all browser-based.

I really have no clue where to go from here, and the boss expects results. I have the form created in Craft, it is only a matter of figuring out how to make it appear.

Please help a major n00b. Thanks.

Edit: My form is named stlForm When I say it's all browser based, I mean I can only edit as much as I can by logging in as an admin. I have no Local data, FTP to access that I know of (our web people are MIA).

1
  • 2
    Can you please update your answer with more information about what your form is named and an example of the code you are using in your templates. Also, I'm not sure what you mean when you say "this is all browser-based". Jul 28, 2017 at 0:22

1 Answer 1

3

If you don't have a local development environment setup, you will need FTP access to the server where Craft is installed to edit templates. The one line of code cannot be copied and pasted into a field in the control panel like one might do with WP.

First of all you will need to make or edit a template to show this form. The "one line of code" needs to be placed in the template where you want to show the form.

For Example

If you are adding a “Contact Us” form that you want to appear at https://[YOUR-DOMAIN-HERE]/contact-us then you would do the following steps:

  1. Login to your company’s server via FTP with and FTP client like Filezilla, Transmit, or Cyberduck. You’ll need to get the FTP login credentials from your company.
  2. Find the location where Craft is installed. If it has not be placed above the webroot then you could probably find it under public_html/craft or www/craft.
  3. Find the templates folder inside the craft folder.
  4. You have a few options at this point:
    • Make a new file and name it contact-us.html or contact-us.twig depending on your preference. You can probably just make a new file with the .html extension if you don’t have a local development environment set up. I don’t know if there is any performance gains using .twig over .html. You can make a new file usually by right-clicking in the folder where you want it created and there is a context menu to make a new file.
    • OR you can make a new folder under templates and name it contact-us. Then under that folder you can make a new template named index.html. Your folder structure will then look like craft/templates/contact-us/index.html.
  5. Open the new file that you created in the previous step.
  6. Add the "one line of code" referring to your form.
  7. Save the template.
  8. Go to your browser and type in httpS://[YOUR-DOMAIN-HERE]/contact-us and you should see the form there.

This is probably the simplest way to get your form to show up on your site. There are more advanced and client-friendly ways to do this but this should hopefully get you started.

You’ll need to check the other templates to see how they are created if you want to include the same style as the rest of your site. There is usually a line of code at the top of the template that says something like {% extends '_layout.html'%} or similar.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.