Archived topic
Generate Blocks & email opt in
13 replies · Started by Christopher on March 9, 2021
I did read Email capture or Optin Plugin to work with GenerateBlocks + GeneratePress Pro thread. I'll admit it went a little over my head.
I'm wanting to put a simple email capture using mailchimp. Just email address and "get now" button. I have the pro version of GeneratePress & the free version of GenerateBlocks
Ideally I'd have it on the side (sidebar) of every page except the static front page.
-(1) Would I be right in saying that I can't do that in customizer because I don't want it on the front page?
It looks like generateblocks doesn't integrate with forms based on the other thread.
- (2) Would the only solution be to create a block at the side of all my other pages with a "get now" button that sends them to an external landing page/form? I'd like to avoid this if possible because it's a nother hoop to jump through rather than just adding email and submit
- (3) Is it possible instead to use generateblocks to create the "mini landing page" at the side of a page, with place for typing email, "get now" button and integrating it with mailchimp? I forget how I did it but I've used landing page builder - think clickfunnels, grrovesite, zcart etc- in that way... API?
Thanks
Hi there,
where in sidebar do you want it displayed ? eg. Top ( above all widgets ) or Bottom ( below all widgets ).
I think think that I basically want to a subscription box, but for it to be on the side... I don't have a sidebar enabled on elements at all as I didn't want it on the home page.
Looking at various videos that don't really answer my questions, I'm wondering if what I really want to do is build a sidebar as an element and then (I'm not really sure what this means!) hook it into every page except the fontpage (and a few others, Thank you pages etc)?
Use a Block Element.
Add your Container Block with the GenerateBlocks plugin, and within that add your Optin shortcode.
Set the Block type to Hook.
And select the before_right_sidebar_content
Then set the Display Rules to where you want it - note if a page doesn't have a sidbear for example the front page then it won't display this block.
note if a page doesn’t have a sidbear for example the front page then it won’t display this block
Maybe a dumb question.
How can I make every page but the front page have a sidebar?
This opt in would literally be the only thing I'd want in the sidebar.
Is the page a static page ? ( ie. not showing your latest posts )
If so you can use the Layout Meta box in the post editor:
https://docs.generatepress.com/article/layout-metabox-overview/
Where you can set the Sidebar to none
Yes, it's a static page thanks, I'll give that a go.
Do I need to enable/have sidebars showing in the customizer (I'd taken it off) and then using the layout meta box to take it off the front page?
Hi Christopher,
Customizer doesn't control sidebar layout for static pages.
So how to set the customizer sidebar options depends on your preference for other pages.
Sorry that I'm not getting it, it's a huge learning curve for me compared to drag and drop editors where I'd be used to making a mini landing page at the side of a page in about 5 mins!
Use a Block Element.
Add your Container Block with the GenerateBlocks plugin, and within that add your Optin shortcode.
Set the Block type to Hook.
And select the before_right_sidebar_contentThen set the Display Rules to where you want it – note if a page doesn’t have a sidbear for example the front page then it won’t display this block.
- Do I go: Appearance>Elements> Add new element?
- Then the "element type" is "block"? (rather than "hook"?)
- This is where I think I get stuck:
* Do I need to start building the opt-in-box that will become the sidebar by beginning with "container" and then building out like I would a page?
* Are there any tutorials on how to do this- eg the email opt in box (would it be a button of some type?), how to attach the mailchimp code
* If so, does it need to be a certain size, so that when it gets attached ("hook"?) to my chosen pages as a sidebar that it won't be too big compared to the page, or does GP/GB resize it?
-> And then how would I set that block to hook? Or have I got it completely wrong and I need to set the element to "hook" rather than "block"?
- If that's the case, can I still make something like I described in this post?
I've just seen when I roll right down to settings how to set the element to hook
Would what I'm trying to do work if I set it to "right sidebar", and turned off the static front page I didn't want it to show on via Layout Meta box in the post editor? Would it show on the other pages/posts?
No worries, here's an article about how to create block element:
https://docs.generatepress.com/article/block-element-overview/
Insert a shortcode block in your block element, then paste the short code from the mailchimp there.
https://www.screencast.com/t/MB5QulOzfh4d
If the static page is the front page, then choose front page as location in display rule of the block element.
For the specific static page, you'll need to choose right sidebar in page editor > layout meta box.
https://docs.generatepress.com/article/layout-metabox-overview/
You don't need to activate any sidebar in customizer if you don't need them in other pages.
Insert a shortcode block in your block element, then paste the short code from the mailchimp there.
https://www.screencast.com/t/MB5QulOzfh4d
Im having trouble finding the mailchimp shortcode.
I don't have the mailchimp for wordpress plugin. This isn't the problem is it?
1) It's not the one that starts <script id="mcjs"> and ends </script> in intergrations is it? I imputed that into the shortcode block and it just displayed the text. That was from mailchimps "WP integrations" page.
2) I looked in the Embedded forms section in mailchimp "to copy and paste into your site" but that doesn't seem like it's it either.
I found that by trying to follow https://www.wplogout.com/add-subscriber-box-in-generatepress-without-plugin/ to find the mailchimp shortcode
[Ive not followed the article because a) it's bigger than I want and b) it's more coding than I understand plusenabling javascript too]
3) API keys don't seem to be the shortcode either; again it does nothing when it's in the shortcode block
Aah shortcodes are only available if using the plugin.
Instead use a HTML block to add your Script.