Currently, it seems possible to show the simplenews subscription form only in a block. It would be great if it could be shown in the main content area also, just like the user registration form which can be shown both in a block and in the body area.

For example, I can alias "user/register" to "register" and the registration form will show up in the main content area of the register page.

The user registration form can be shown both in a block and in the main

Comments

venkat-rk’s picture

Sorry, please ignore the last line.

DriesK’s picture

This is already possible :-) read this issue.

What you want is option number 5:

  • Subscription to the newsletters can be managed in the following ways:
    1. Through the blocks. Anonymous users have both subscribe/unsubscribe, logged in users have only the relevant option
    2. Through the "manage my subscriptions" link: shows all newsletters available. Anonymous users are directed to http://domain/newsletter/subscriptions, logged in users to http://domain/user/uid/edit/newsletter
    3. At the simplenews admin pages: a simplenews admin can change all subscriptions
    4. If the admin also has the "administer users" permission, he can also go to http://domain/user/uid/edit/newsletter of each user
    5. Through a custom page. A custom page can be built by using these functions:
    • simplenews_subscription_manager(): takes no arguments and prints the same form as in "manage my subscriptions". However, logged in users are not redirected to their account's page in this case, they can update their subscriptions right away.
      Use _simplenews_subscription_manager() if you want the form returned and not printed
    • simplenews_recent_newsletters($tid, $count, $title): prints a list of recent issues. $tid is a required argument (the term's tid), the others are optional. $count defaults to 5 (the number of issues displayed), $title defaults to NULL (sets a title above the list).
      Use _simplenews_recent_newsletters($tid, $count, $title) if you want the list returned and not printed

    Please close this issue after you've read it and are satisied with the answer.

    DriesK’s picture

    I case you don't know how to use the API:

    create new node, set the input filter to PHP, and add this code:

    simplenews_subscription_manager();
    

    Above and below it, you can add as much text/html as you want.

    venkat-rk’s picture

    Wonderful. Thank you for such a prompt response.

    And, yes, I wouldn't have know how to use the API, so it is great that you showed me the way to do it :-)

    venkat-rk’s picture

    Status: Active » Closed (fixed)
    davidshaw’s picture

    I know this is an old issue but comes up high on google.
    To print a Simplenews 6.x-1.0-rc6 subscribe form in a node or block set input to php and drop this in:

    print theme('simplenews_block', 8);

    Make sure the 8 above matches the tid for your newsletter's taxonomy term id.

    ryank76’s picture

    Version: 4.6.x-1.x-dev » 6.x-1.0-rc6

    I tried that code above and got this error:

    warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'simplenews_block_form_2' was given in /home/content/b/r/o/brooklynnet/html/grrrl/includes/form.inc on line 366.