WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Constant Contact for WordPress] Insert Constant Contact into single page (12 posts)

  1. highermonkey
    Member
    Posted 4 years ago #

    Hi and thanks for the fantastic widget! Can you tell me if there is a way to insert the Constant Contact form input into a single page rather than the side bar. Thanks so much in advance!

  2. jamesbenson
    Member
    Posted 4 years ago #

    We have plans for this in a future release, it will allow you to insert a signup form into a single post using a shortcode in the post body, I can't put a time on when this might happen but likely to be a couple of months.

  3. Zack Katz
    Member
    Posted 4 years ago #

    This is only tested once, but it should work until we release the version James is talking about:

    $CC = new constant_contact_api_widget();
    $CC->widget();

    This should work properly, but once we change how widgets are configured, it likely won't work in the next version.

  4. highermonkey
    Member
    Posted 4 years ago #

    Thanks for the quick response! In the meantime your workaround...

    $CC = new constant_contact_api_widget();
    $CC->widget();

    Where is this code placed? I am mostly a designer...forgive the ignorance. Best!

    Kenny

  5. Zack Katz
    Member
    Posted 4 years ago #

    In the template wherever you want the form to be shown. Or you could download a plugin that runs PHP inside the content and add it to your content that way. You could try Sniplets, by John Godley.

  6. Jeremy Clarke
    Member
    Posted 3 years ago #

    Dang. I was going to turn this into a shortcode but it wont' work properly because the widget?() method echo's the $output no matter what. To be shortcode-compatible all display functions need to offer an $echo parameter in their $args so that it can be turned off and the html returned by the method instead.

    That would probably be the best place to start the process of shortcoding the widget stuff. Once you have that in place the actual shortcode is ludicrously trivial:

    function constant_contact_shotcode($atts) {
    	$CC = new constant_contact_api_widget();
    	$output = $CC->widget('echo=0');
    	return $output;
    }
    add_shortcode('constant_contact_form', 'constant_contact_shotcode');

    Thanks for the plugin, I'll just deal with the sidebar version for now.

  7. jamesbenson
    Member
    Posted 3 years ago #

    We have plans for this as mentioned, you seem to know PHP so if you decide to implement this yourself please let us have the code and we can probaly include it within the plugin for everyone to use.

  8. LeadingResults
    Member
    Posted 3 years ago #

    Thanks for the tips so far. I am not a coder of any sorts, but can follow the logic here. I put the sniplets plugin into my site. When I paste the code you put above:
    -> $CC = new constant_contact_api_widget();
    -> $CC->widget();
    into the sniplet, all I get is that text returned. What else do I need wrapped around it to make it work in the sniplet. Thanks much! Dan

  9. Jeremy Clarke
    Member
    Posted 3 years ago #

    @Jamesbenson: Cool, its probably fairly simple, usually it just means adding all output to an $output variable as you go instead of echoing it, then at the end you return $output or print it depending on the $args['echo'] parameter.

    I'm working on something else at the moment but when I get back to my concon stuff I'll try to make a patch for you including the shortcode.

    Sorry for the slow reply, I didn't see your response till now because of hte lack of forum subscriptions, I'm subscribing to this thread now!

  10. Streetwise
    Member
    Posted 3 years ago #

    Any updates on this? I would LOVE to be able to embed it into a page rather than via widget on the front page.

    Thanks.

  11. GranPaSmurf
    Member
    Posted 3 years ago #

    Ouch! I really need to put this on a page; we have lots of Constant Contact list options.
    Anybody done this and willing to step through it with an old guy that can't even spell coode?

  12. up2early
    Member
    Posted 3 years ago #

    I need this too, the ability to place the sign up form on a page and not as a widget.

    I used the following, as suggested above, on a site with Exec-PHP installed.

    $CC = new constant_contact_api_widget();
    $CC->widget();

    This just displayed the above as text

    also tried:
    <?php constant_contact_api_widget-3; ?>

    which displayed nothing.

    Thanks in advance for any help!

Topic Closed

This topic has been closed to new replies.

About this Topic