Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • SaphuA 124 posts 87 karma points
    Jun 05, 2009 @ 00:04
    SaphuA
    0

    Making a contact form

    As a way to try and learn Umbraco I am developing a, rather simple, configurable contact form.

    The form should have the following feates:
    - Create a new form
    - Change some settings
    - Add input fields to it

    What I have done so far is create the document types needed to 'design' the form:
    - ContactForm
    --- TextField
    --- TextArea

    My guess is that I have to create a UserControl that I will use to create a Macro and then add this Macro to the tempalte of ContactForm. However, I have no idea how I can let my UserControl know which ContactForm it should render and how to get all node's for that form.

    Could someone please point me in the right direction?

    Thanks!

    Ps. As soon as we have things settles down in our company I will make the usercontrol available for public and write documentation on how to develop such a controll.available for public and will

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jun 05, 2009 @ 08:32
    Dirk De Grave
    0

    Hi,

    A Dutch company has released a form builder package (beta). Follow those guys on Twitter 'http://twitter.com/axendo' and get it touch with them if you'd like to test out that package. Alternatively, have a look at Doc2Form (http://umbracoext.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=5251 - Doc2Form Package for v4)

    Hope this helps.

    Regards,
    /Dirk

  • SaphuA 124 posts 87 karma points
    Jun 05, 2009 @ 08:35
    SaphuA
    0

    Thanks for your reply.

    However, I would rather develop my own package so I get to learn how to develop in Umbraco.

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jun 05, 2009 @ 08:39
    Dirk De Grave
    0

    Ok, great idea, but still, you'll learn a lot by exploring the code of Doc2Form...
    Have a look at the code and then start building your own package from what you've learned exploring other examples.

    I've had good experiences in doing so myself.

    Just my 2 cents.

    Cheers,
    Dirk


  • dandrayne 1138 posts 2262 karma points
    Jun 05, 2009 @ 10:34
    dandrayne
    0

    If you want to create your own usercontrol, maybe this would also help a bit - http://www.nibble.be/?p=12

  • SaphuA 124 posts 87 karma points
    Jun 05, 2009 @ 14:36
    SaphuA
    0

    Thanks for your reply. The video was usefull, but pretty much what I already explained above. What I need to know are the steps that come after this video.

    - How do I let the UC know which node it is currently on?
    - How do I get the sub-nodes from that node?

    Etc.

  • fed 199 posts 70 karma points
    Jun 05, 2009 @ 14:58
    fed
    0

    You should look at the Node class in umbraco.presentation.nodeFactory namespace... it has some useful functions like Node.GetCurrent() to get the current node. and n.Children for it's childnodes..

  • SaphuA 124 posts 87 karma points
    Jun 05, 2009 @ 18:09
    SaphuA
    0

    [quote=fed]You should look at the Node class in umbraco.presentation.nodeFactory namespace... it has some useful functions like Node.GetCurrent() to get the current node. and n.Children for it's childnodes..[/quote]

    That was extremely usefull! Thanks! I will surely be able to make something out of this now.

    One more problem though:
    I am using Document Types, because I like the visual feedback that it gives to my user. However, I've come to understand that this is not the 'legid' way to go. What alternatives do I have?

    Is there a way to remove the generic properties like publishing or the link to document?

    Thanks!

  • SaphuA 124 posts 87 karma points
    Jun 06, 2009 @ 20:12
    SaphuA
    0

    Thanks to all the replies and the very nice umbraco assemblies I've gotten pretty far. Here's a screenshot of the Node's and the generated Form. The text is in Dutch.



    I would still like to know if it's possible to stop Umbraco from adding the default stuff to my nodes. Every form item now gets its own page (Contact/Reden/Klacht.aspx) :( And I don't need the publishing dates either.

    Thanks!

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jun 07, 2009 @ 08:23
    Dirk De Grave
    0

    Hi,

    [quote]I would still like to know if it's possible to stop Umbraco from adding the default stuff to my nodes. Every form item now gets its own page (Contact/Reden/Klacht.aspx) :( And I don't need the publishing dates either.[/quote]

    Nope, you can't, as this is the way umbraco is functioning. Every node is a document (or every document is a node) which has at least the general properties such as url name, template, created at, updated at...

    On a sidenote, I still don't see any advantage over the existing Doc2Form and FormBuilder packages. But as umbraco is so flexible, you're free to tweak the system to suit your needs.

    Cheers,
    /Dirk

  • SaphuA 124 posts 87 karma points
    Jun 07, 2009 @ 12:19
    SaphuA
    0

    That's too bad :( So there is no way to create nodes withouth them being a document?

    IMO, the advantage of my method is that the visual feedback and the freedom the user has is quite nice. I still don't like the Macro forms as they are too jammed with information.

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jun 07, 2009 @ 13:44
    Dirk De Grave
    0

    [quote]That's too bad :( So there is no way to create nodes withouth them being a document?[/quote]

    unless you're exploring the fields of custom sections and info stored in non core tables.
    A great tut that may get you started can be found at: http://blog.sitereactor.dk/2009/04/26/google-analytics-for-umbraco-first-installment/

    [quote]IMO, the advantage of my method is that the visual feedback and the freedom the user has is quite nice. I still don't like the Macro forms as they are too jammed with information.[/quote]
    I think we have to agree to disagree on this one. But, if it fits your needs and works out well for you, there's nothing to keep from not doing it your way. I'm not against it, and I'm not questioning your way of thinking, but just think it's too much overhead.

    Cheers,
    Dirk

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Jun 08, 2009 @ 17:00
    Jeroen Breuer
    0

    [quote=SaphuA]That's too bad :( So there is no way to create nodes withouth them being a document?

    IMO, the advantage of my method is that the visual feedback and the freedom the user has is quite nice. I still don't like the Macro forms as they are too jammed with information.[/quote]

    Every node is a document and a page you can visit. I've created a datatype which redirects to another node. This way when you visit a page which you don't want to be visited it gets redirected to another page. Umbraco has a default property for this (umbracoRedirect as a contentpicker), but with my datatype you can also redirect to the node parent or the homepage. Using umbracoRedirect should be enough in this case.

  • William Charlton 171 posts 218 karma points
    Feb 09, 2012 @ 18:31
    William Charlton
    0

    @SaphuA

    How did you get on building your contact form?

    I'm creating some documentation for how to create an Umbraco site from zero knowledge to a simple working site. I want to include a contact form but not one that has been added as a package.

    Can you help?

Please Sign in or register to post replies

Write your reply to:

Draft