How to hide or display a block of paragraphs in your custom-made Word?
The Block tags enables you to display or hide a part of your Word document, which may contain text, tables, images, etc.
Note: Block tags do not work in the header of the Word document.
It is always built in two parts to frame the table or the block of paragraphs to make it appear or disappear: one tag before and the same tag after.
For example, you have a table in your form. You do not want it to appear in your Word document if it is not completed during mobile or tablet entry. The item tag block syntax is:
##_block:field##
Make part of the Word document disappear.
##_block:field##
Conversely, if the field in question is entered on the mobile, the block tag will display the paragraph block that it frames!
For example, you have a table listing your supplies to order on your form. You want it not to appear in your Word document if no lines are entered when typing on the mobile or tablet. The syntax of the block tag is:
##_block:table_supplies##
##_block:table_supplies##
(the tag of our table being: ##table_supplies##)
The block tags allows you to determine the visibility of a table or a block of paragraphs in your Word document based on a field list or choice.
For example, you have a field list with the following items (Code:Elément):
NB: it is essential to define a Code to be able to use this item tags.
You want your block of paragraphs or table in your Word document to appear only if you selected “Airplane” in your list. You must build your block tag in the following manner:
##_block:list-A##
Make part of the Word document appear if “Airplane” is selected.
##_block:list-A##
If you have selected “Train” or “Car” in your field list, your table or block of paragraphs will not appear in your Word document.
For example, you have another list called “Type of Service” with the following choices:
You want your table to appear, listing the different repairs you offer, only if Repair (new customer) (code 334) and / or Repair (code 404) are selected. In this case it will be necessary to use the operator -in:
:
##_block:type_service-in:334,404##
The table with the different repairs.
##_block:type_service-in:334,404##
(the tag of our list being: ##type_service##)
You want your booklet to appear with the different prices of your devices unless Repair (code 334)(new customer) and / or Repair (code 404) are selected. In this case, it will be necessary to use the operator -nin:
:
##_block:type_service-nin:334,404##
Text, table or image to appear.
##_block:type_service-nin:334,404##
(the tag of our list being: ##type_service##)
You want your paragraph to appear inviting your new customers to subscribe to the loyalty card only if new customer is selected. In this case, it will be necessary to use the operator -like:
:
##_block:type_service-like:3##
Text, table or image to appear.
##_block:type_service-like:3##
(the tag of our list being: ##type_service##. 3 is our internal code to signal the presence of a new customer in our files)
You want to remind your customers of the advantages of subscribing to the loyalty card. For this, you want this information to appear only if new client is not selected. In this case, it will be necessary to use the operator -nlike:
:
##_block:type_service-nlike:3##
Text, table or image to appear.
##_block:type_service-nlike:3##
(the tag of our list being: ##type_service##. 3 is our internal code to signal the presence of a new customer in our files)
You want your block of paragraphs or table in your Word document to appear only if you have checked Yes in the check box. You must build your block tag in the following manner:
##_block:check_box##
Make part of the Word document appear.
##_block:check_box##
You want your block of paragraphs or table in your Word document to appear only if you have checked No in the check box. You must build your block tag in the following manner:
##_block:check_box-0##
(-zero)
Make part of the Word document appear.
##_block:check_box-0##
You must build your block tag in the following manner:
##_block:field-eq:##
Text, table or image to appear.
##_block:field-eq:##
For example, you want to see a text stating that no comments have been entered when your “Comment” zone is left empty. The syntax of the block tag is:
##_block:comment-eq:##
No comments have been entered.
##_block:comment-eq:##
(the tag of our Input field being: ##comment##).
You must build your block tag in the following manner:
##_block:field-ne:##
Text, table or image to appear.
##_block:field-ne:##
For example, you want your New Customer paragraph to appear when your New Customer Name field is completed. The syntax of the block tag is:
##_block:name_new_customer-ne:##
New customer :
first_name_new_client## ##last_name_new_client##
##address_new_client##
##_block:name_new_customer-ne:##
(the tag of our Input field being: ##name_new_customer##).
If you want to test the presence of a media n in your form, you will have to build your block tag in the following way:
##_block:field-ge:n##
Text, table or image to appear.
##_block:field-ge:n##
For example, if you would like to see your painting (containing your 4th, 5th and 6th pictures) only if you took a 4th picture, The syntax of the block tag will then be the following:
##_block:photo-ge:4##
##photo:4-200x## | ##photo:5-200x## | ##photo:6-200x## |
##_block:photo-ge:4##
(the tag of our Photo being: ##photo##).
Tip: If you want to test the presence of your 4th photo in your table element in line 1, you can organize your block tag as follows:
##_block:photo[1]-ge:4##
##photo[1]:4-200x## | ##photo[1]:5-200x## | ##photo[1]:6-200x## |
##_block:photo[1]-ge:4##
(The tag of our Photo being: ##photo## and ##photo[n]## allows us to test the presence of a photo in line n).
The following operators allow you to display (or not) a paragraph block according to the information entered:
The syntax is as follows:
##_block:field-lt:3##
Text, table or image to appear.
##_block:field-lt:3##
The information will appear if the field contains a number less than 3.
For example, you want a text to indicate that the delivery is offered when the total order is greater than or equal to 500$. The syntax of the block tag is:
##_block:order-ge:500##
Delivery is offered.
##_block:order-ge:500##
(the tag indicating the total of our order being: ##order##.)
The _user_ref operator allows you to display a paragraph block based on the presence or absence of a custom user field.
If you want a paragraph block to appear when your user has at least one custom user field:
##_block:_user_ref##
Text, table or image to appear.
##_block:_user_ref##
If you want to make a paragraph block appear when the first custom user field is filled:
##_block:_user_ref1##
Text, table or image to appear.
##_block:_user_ref1##
If you want to make a paragraph block appear when the first custom user field is The United States of America:
##_block:_user_ref1-USA##
Text, table or image to appear.
##_block:_user_ref1-USA##
Do not hesitate to comment on this article!
All your questions, comments and suggestions are most welcome!
To facilitate your navigation and to offer you adapted and personalized content, we would like to accompany you during your visit...
Is it OK for you?
To facilitate your navigation, to offer you adapted and personalized content, we would like to accompany you during your visit...
Is it OK for you?
Post a comment