Spacing Issues - using If + formmenu + toggles

Hey!

So I'm working on a snippet that I'd like to be able to select the topic and be presented with the toggles for that scenario - I'm using import to build the scenarios to not compound the master.

The Text Blaze form opens exactly how I want it to, the menu selects the topic and then that triggers the import with the related topic / toggles

However this is creating multiple spacing issues, when I use the trim command it then moves the import directly next to the menu box and the toggles appear to the side of it, and I need them to appear under it - but remove all the spacing and return it to the top of the text box.

I very well could be using trim incorrectly or maybe there is not a way to accomplish this?

Hi, and welcome to the forum! :slight_smile:

With multiline commands like {if} or {formtoggle} you generally want to have trailing or leading new lines be within the command. This can be counterintuitive as it's generally not how you would write the snippet by default.

For example let's say you have two optional paragraphs in your snippet:

Paragraph 1

{formtoggle}Paragraph 2 -- not the way to do it as you'll have an extra blank line if this formtoggle is off{endformtoggle}

Paragraph 3
{formtoggle}
Paragraph 4 -- correct way as extra spacing will only show when formtoggle is on.
{endformtoggle}
Paragraph 5

Hope this helps. Please post a concise sample of your snippet it this doesn't resolve the issue for you.

Thanks for the reply!

So this did fix it in the context of Google Docs or even the try it now/test window within Text Blaze.

However when I input into the CRM system it then begins placing all the spaces at the top the further down the toggle is.

A simplified example of what I have it set as is

{note}Note to our department
{endnote}
{formtoggle: name=example 1}
This is what this error means, here is what you need to do.

Please send this.
{endformtoggle}
{formtoggle: name=Example 2}
example

send example
{endformtoggle}

This repeats through like 7 toggles.

The further down the toggle the more spaces appear above it blank. These spaces do not appear in Google Docs or Text Blaze tests.

The only appear again when I enter into the CRM.

They did not appear at all when I had it set as
{formtoggle: name=example 1}example 1{endformtoggle}{formtoggle: name=example 2}example 2{endformtoggle}

When I use this method the CRM accepts it fine but then it gets cluttered when there are a lot of toggles for the solutions to that example.

Looking at your snippet, it looks like you want your last example:

{formtoggle: name=example 1}example 1{endformtoggle}{formtoggle: name=example 2}example 2{endformtoggle}

The if you have a newline between your {endformtoggle} and the following {formtoggle} that line should be included in thee output regardless of whether the toggles are on or not.

To address the clutter you have a few options:

You can make that more readable in the snippet editor like so:

{formtoggle: name=example 1}example 1
{endformtoggle: trim=right}

{formtoggle: name=example 2}example 2{endformtoggle}

The trim setting can be added to any command to remove white space on both sides (yes) the left or the right.

As an alternative, you can make it more readable in the preview with:

{formtoggle: name=example 1}example 1
{endformtoggle}{note}

{endnote}{formtoggle: name=example 2}example 2{endformtoggle}

The contents of any {note}{endnote} fields will be removed on insertion

Hey I really like the note use to add spacing.

However it now is creating additional spacing where Toggle 1 is even though it's not enabled.

So it says
(blank row)
This is a test!

Instead of
This is a test!

I had it removing those spaces using the steps you provided from the first response which in Google Docs and in Text Blaze "Try it out" windows were working fine.

However when it triggers in the CRM window we use, it adds those blank rows even though they aren't being added in any other programs.

So a snippet with 8 toggles listed like the last example would end up doing this:

(empty row)
(empty row)
(empty row)
(empty row)
(empty row)
(empty row)
(empty row)
RESPONSE FROM TOGGLE 8

I'm convinced it's an issue with the CRM accepting the input from Text Blaze so I don't think much can be done - since it worked in Google Docs and in Text Blaze itself.

Sometimes things can behave differently in some editors versus others, so what you are seeing is definitely possible.

However, the exact behavior seems a little strange for me. Happy to dig into this more with you. Shoot me an email at support@blaze.today and we could do a debugging call/screenshare if you are interested.