Answers.Body: <ol>
  <li>Non-programming approach:
  Use HTML Snippets for the profile. If it is not working according to documentation in book it might be that a) the documentation needs to be updated, or b) there is a bug in this functionality, or c) there is a bug in the custom page that includes the snippet. I would expect that c), b) and then a) are the likely order of solving this.</li>
  </ol>
  
  <p>NB: when using HTML Snippets, you should ensure that permissions to create all the objects needed for the form (eg custom fields, contacts, etc) are available to an anonymous user.</p>
  
  <ol start="2">
  <li>Programming approach:
  a) If you are doing this to allow one other site to callback into CiviCRM, then I would have it call CiviCRM's API via REST - <a href="http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API#UsingtheAPI-REST" rel="nofollow">http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API#UsingtheAPI-REST</a>.
  b) If you are expecting to reuse the form in multiple other sites, then I would create an iFrame via your CMS and include the iFrame from the other sites. The iFrame itself would still need to use the external services protocol at the above link rather than AJAX since in general it will not have logged in before posting.</li>
  </ol>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-03-24T17:42:04.593Z
Answers.LastActivityDate: 2015-04-02T23:27:29.680Z
Answers.LastEditDate: 2015-04-02T23:27:29.680Z
Answers.UserDisplayName: Joe Murray
Answers.Body: <p>We have implemented a newsletter signup form into a static non-drupal page by using profiles. The profile generator actually works quite well (using CiviCRM 4.4) but the resulting form is kind of overloaded. But you can break down the markup to a simple form:</p>
  
  <pre><code>                &lt;form method="post" action="https://example.com/civicrm/profile/create?gid=12&amp;amp;reset=1"&gt;
                      &lt;div&gt;
                              &lt;input type="hidden" value="" name="postURL"&gt; &lt;input type="hidden" value="https://example.com/civicrm/profile?reset=1&amp;amp;gid=16" name="cancelURL"&gt; &lt;input type="hidden" value="Edit:cancel" name="_qf_default"&gt;
                      &lt;/div&gt;
                      &lt;ol&gt;
                              &lt;li&gt;
                                      &lt;label for="email-Primary"&gt;E-Mail:&amp;nbsp;*&lt;/label&gt; &lt;input type="text" class="email required" id="email-Primary" name="email-Primary" size="20" maxlength="64"&gt;
                              &lt;/li&gt;
                              &lt;li&gt;
                                      &lt;label&gt;Newsletter:&amp;nbsp;*&lt;/label&gt;
                                      &lt;div class="input-group"&gt;
                                              &lt;input type="hidden" value="" name="group[8]"&gt; &lt;input type="checkbox" value="1" name="group[8]" id="group_8"&gt;&amp;nbsp;Cooking recieps&lt;br&gt;
                                              &lt;input type="hidden" value="" name="group[7]"&gt; &lt;input type="checkbox" value="1" name="group[7]" id="group_7"&gt;&amp;nbsp;Cats&lt;br&gt;
                                              &lt;input type="hidden" value="" name="group[9]"&gt; &lt;input type="checkbox" value="1" name="group[9]" id="group_9"&gt;&amp;nbsp;Dogs&lt;br&gt;
                                      &lt;/div&gt;
                              &lt;/li&gt;
                      &lt;/ol&gt;
                      &lt;div class="actions"&gt;
                              &lt;p&gt;
                                      &lt;input type="submit" value="Sign up" name="_qf_Edit_next" class="button"&gt;
                              &lt;/p&gt;
                              &lt;p&gt;
                                      &lt;small&gt;* required&lt;/small&gt;
                              &lt;/p&gt;
                      &lt;/div&gt;
              &lt;/form&gt;
  </code></pre>
  
  <p>The group inputs are part of a checkbox list and the index inside the name array represents the CiviCRM group id (e.g name="group[8]"). The form action url and the hidden cancelURL input are containing the profile id "gid", which you have created in CiviCRM before.</p>
  
  <p>The profile itself has to be a "Standalone Form or Directory" and be marked as "active". Of course it is containing active fields for contact groups and primary e-mail. The groups have to be of type "mailing list" and visible for public pages.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-03-25T08:28:18.807Z
Answers.LastActivityDate: 2015-04-07T07:35:19.077Z
Answers.LastEditDate: 2015-04-07T07:35:19.077Z
Answers.UserDisplayName: Philipp Michael
Answers.Body: <p>I have implemented this as a resource for an IFRAME. My implementation was in Drupal not Joomla and just used the CiviCRM API.</p>
  
  <p>So I built a simple app in Drupal that took a mailing list Id on its URL, checked that this was one that allowed public sign-ups, built and validated the form and then used CiviCRM's API to add the records.</p>
  
  <p>Then other sites simply included that as an IFRAME.</p>
  
  <p>This obviously required coding skills, but if you have those then using the API is a great way to be able to make it work just-so, regardless of the quirks your organisation requires (e.g. different themes for different sites).</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-03-24T16:42:34.840Z
Answers.LastActivityDate: 2015-03-24T16:42:34.840Z
Answers.UserDisplayName: artfulrobot
Answers.Body: <p>You might want to check out the <a href="https://civicrm.org/extensions/civiwci">CiviWCI extension</a>.  It's still in beta format - and when I tried it on Wordpress, I found a hard-coded URL that assumed Drupal.  It's designed for this situation though.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-03-24T17:01:55.317Z
Answers.LastActivityDate: 2015-03-24T17:01:55.317Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.Body: <p>In principle you can use the REST api to get the form and submit it.</p>
  
  <p>Also if you want to do the iFrame idea, make a link to the profile with <code>&amp;tmpl=component</code> at the end, which gives you the page with just component and no module. Then you can use that url for the iFrame.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-06T13:41:42.160Z
Answers.LastActivityDate: 2015-04-06T13:41:42.160Z
Answers.UserDisplayName: Elin
Body: <p>Our install is on Joomla, but Civi newsletter signup forms are needed also on other sites. They use everything from manual HTML (etc.) to other CMS platforms. How can I add group sign up forms to them?</p>
  
  <p>The Civi book suggests using profiles and they do have a HTML generator. However the code it produces both doesn't work and the generator itself is not maintained (according to the core team), so it appears there is no out-of-the-box solution for integration into other hosts since 4.5.</p>
  
  <p>What have you used, done in such situations? Please be explicit.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-03-24T16:39:18.707Z
Comments.Text: I've successfully used the "Generate HTML Snippet" functionality before.  Could you provide more detail about what doesn't work in your situation?
Comments.UserDisplayName: Jon G - Megaphone Tech
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-03-24T16:53:42.810Z
Comments.Text: I'd have to retry and it would probably better fit into a new, specific question, since this one is about alternatives.
Comments.UserDisplayName: lynxlynxlynx
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-04-06T13:35:35.167Z
Comments.Text: I recently tried to use a generate html snippet and it messed up the markup on the page, probably an unclosed `<div>` or similar although I couldn't find it.
Comments.UserDisplayName: Elin
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-04-06T13:57:45.980Z
Comments.Text: I wonder if it's any better in 4.6. It was known to work in 4.4 ...
Comments.UserDisplayName: lynxlynxlynx
Tags: <civimail><profile><forms><4.5>
Title: How should I add sign up forms into 3rd party sites?
ThreadText: # How should I add sign up forms into 3rd party sites?
  
  (Asked by: username_0 on 2015-03-24)
  
  Our install is on Joomla, but Civi newsletter signup forms are needed also on other sites. They use everything from manual HTML (etc.) to other CMS platforms. How can I add group sign up forms to them?
  
  The Civi book suggests using profiles and they do have a HTML generator. However the code it produces both doesn't work and the generator itself is not maintained (according to the core team), so it appears there is no out-of-the-box solution for integration into other hosts since 4.5.
  
  What have you used, done in such situations? Please be explicit.
  
  **Tags:** civimail, profile, forms, 4.5
  
  > **Comments:**
  > **username_1**: I've successfully used the "Generate HTML Snippet" functionality before.  Could you provide more detail about what doesn't work in your situation?  
  > **username_0**: I'd have to retry and it would probably better fit into a new, specific question, since this one is about alternatives.  
  > **username_2**: I recently tried to use a generate html snippet and it messed up the markup on the page, probably an unclosed `<div>` or similar although I couldn't find it.  
  > **username_0**: I wonder if it's any better in 4.6. It was known to work in 4.4 ...  
  
  ---
  
  ## 5 answers
  
  ### Answer by username_3 on 2015-03-24. Score: 7 | Accepted answer
  
  1. Non-programming approach:
     Use HTML Snippets for the profile. If it is not working according to documentation in book it might be that a) the documentation needs to be updated, or b) there is a bug in this functionality, or c) there is a bug in the custom page that includes the snippet. I would expect that c), b) and then a) are the likely order of solving this.
  
  NB: when using HTML Snippets, you should ensure that permissions to create all the objects needed for the form (eg custom fields, contacts, etc) are available to an anonymous user.
  
  2. Programming approach:
     a) If you are doing this to allow one other site to callback into CiviCRM, then I would have it call CiviCRM's API via REST - <http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API#UsingtheAPI-REST>.
     b) If you are expecting to reuse the form in multiple other sites, then I would create an iFrame via your CMS and include the iFrame from the other sites. The iFrame itself would still need to use the external services protocol at the above link rather than AJAX since in general it will not have logged in before posting.
  
  
  ---
  
  ### Answer by username_4 on 2015-03-25. Score: 6
  
  We have implemented a newsletter signup form into a static non-drupal page by using profiles. The profile generator actually works quite well (using CiviCRM 4.4) but the resulting form is kind of overloaded. But you can break down the markup to a simple form:
  
  ```
                  <form method="post" action="https://example.com/civicrm/profile/create?gid=12&amp;reset=1">
                      <div>
                              <input type="hidden" value="" name="postURL"> <input type="hidden" value="https://example.com/civicrm/profile?reset=1&amp;gid=16" name="cancelURL"> <input type="hidden" value="Edit:cancel" name="_qf_default">
                      </div>
                      <ol>
                              <li>
                                      <label for="email-Primary">E-Mail:&nbsp;*</label> <input type="text" class="email required" id="email-Primary" name="email-Primary" size="20" maxlength="64">
                              </li>
                              <li>
                                      <label>Newsletter:&nbsp;*</label>
                                      <div class="input-group">
                                              <input type="hidden" value="" name="group[8]"> <input type="checkbox" value="1" name="group[8]" id="group_8">&nbsp;Cooking recieps<br>
                                              <input type="hidden" value="" name="group[7]"> <input type="checkbox" value="1" name="group[7]" id="group_7">&nbsp;Cats<br>
                                              <input type="hidden" value="" name="group[9]"> <input type="checkbox" value="1" name="group[9]" id="group_9">&nbsp;Dogs<br>
                                      </div>
                              </li>
                      </ol>
                      <div class="actions">
                              <p>
                                      <input type="submit" value="Sign up" name="_qf_Edit_next" class="button">
                              </p>
                              <p>
                                      <small>* required</small>
                              </p>
                      </div>
              </form>
  
  ```
  
  The group inputs are part of a checkbox list and the index inside the name array represents the CiviCRM group id (e.g name="group[8]"). The form action url and the hidden cancelURL input are containing the profile id "gid", which you have created in CiviCRM before.
  
  The profile itself has to be a "Standalone Form or Directory" and be marked as "active". Of course it is containing active fields for contact groups and primary e-mail. The groups have to be of type "mailing list" and visible for public pages.
  
  
  ---
  
  ### Answer by username_5 on 2015-03-24. Score: 5
  
  I have implemented this as a resource for an IFRAME. My implementation was in Drupal not Joomla and just used the CiviCRM API.
  
  So I built a simple app in Drupal that took a mailing list Id on its URL, checked that this was one that allowed public sign-ups, built and validated the form and then used CiviCRM's API to add the records.
  
  Then other sites simply included that as an IFRAME.
  
  This obviously required coding skills, but if you have those then using the API is a great way to be able to make it work just-so, regardless of the quirks your organisation requires (e.g. different themes for different sites).
  
  
  ---
  
  ### Answer by username_1 on 2015-03-24. Score: 5
  
  You might want to check out the [CiviWCI extension](https://civicrm.org/extensions/civiwci). It's still in beta format - and when I tried it on Wordpress, I found a hard-coded URL that assumed Drupal. It's designed for this situation though.
  
  
  ---
  
  ### Answer by username_2 on 2015-04-06. Score: 2
  
  In principle you can use the REST api to get the form and submit it.
  
  Also if you want to do the iFrame idea, make a link to the profile with `&tmpl=component` at the end, which gives you the page with just component and no module. Then you can use that url for the iFrame.
  
  
  ---
  
  