Jump to:

23023 Posts in 11882 Topics by 2830 members

General Questions

SilverStripe Forums » General Questions » Adding Contact Form in CMS

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 443 Views
  • nat.pike
    Avatar
    Community Member
    19 Posts

    Adding Contact Form in CMS Link to this post

    Hi there

    I'm wanting to add a contact form to a page but want to have the ability of where it is positioned on the page.

    I have used the UserForm Module in the past which is fine but it is positioned under the $content - I want the contact form within the $content.

    Is there a way that I can "embed" it from within the wysiwyg editor?

    I would be greatful for any feedback or if someone can give me any ideas on how I can achieve this.

    Cheers

    Natalie.

  • netnerd85
    Avatar
    Community Member
    42 Posts

    Re: Adding Contact Form in CMS Link to this post

    You could use a "shortcode" type thing. Basically what you want to do is a find and replace on the Content. Use a tag/shortcode in the WYSIWYG editor like [UserForm id=5] and search for that string using RegEx. You'll need to load the UserForm and get it's render HTML into the Content variable of the page (not sure how to get the html of the user form off the top of my head though). Overload the Content function on whatever page you have.

  • Willr
    Avatar
    Forum Moderator
    5464 Posts

    Re: Adding Contact Form in CMS Link to this post

    UserForms supports embedding the form within the content page (only on the same page as the form). Place $UserDefinedForm where you would like the form to display.

    443 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.