• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Hide empty conditional fields in admin mail

Hide empty conditional fields in admin mail 12 years 1 month ago #22496

Hi, first at all, thanks to rsjoomla for your powerful components.

I need hide empty conditional fields in admin email.

I though with the last upgrade with that code:
"Added - Scripting language in User, Admin & Additional Emails and Thank You Message: {if {placeholder:value}}this text gets displayed if the placeholder has a value{/if}"

i will to be able and i try to do that:
{if {placeholder:value}}{dogsname:caption}{/if} - but it doesn't work.

and:
{if {dogsname:caption}{/if} - but it doesn't work too.

Please help me.

Thanks!
The administrator has disabled public write access.

Hide empty conditional fields in admin mail 12 years 1 month ago #22505

  • silviup
  • silviup's Avatar
  • OFFLINE
  • Moderator
  • Posts: 309
  • Thank you received: 49
Note that you need to replace 'placeholder' in {placeholder:value} with the actual name of your field.

Also, I have noticed that you have used '{dogsname:caption}' in the second example you have provided. Note that the {fieldname:caption} type of placeholders will not be helpful in this situation, try using the {fieldname:value} type ({dogsname:value} in your case).

Also, make sure that you are using the latest revision of RSForm!Pro (rev. 46).
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.

Hide empty conditional fields in admin mail 11 years 6 months ago #25272

Should you use the <br /> inside the {if}'s

Example:
{if {prod1:value}}{prod1:caption} x {prod1:value}<br />{/if}
{if {prod2:value}}{prod2:caption} x {prod2:value}<br />{/if}
{if {prod3:value}}{prod3:caption} x {prod3:value}<br />{/if}
{if {prod4:value}}{prod4:caption} x {prod4:value}<br />{/if}
{if {prod5:value}}{prod5:caption} x {prod5:value}<br />{/if}
{if {prod6:value}}{prod6:caption} x {prod6:value}<br />{/if}
Last Edit: 11 years 6 months ago by robert.bollen.
The administrator has disabled public write access.

Hide empty conditional fields in admin mail 11 years 6 months ago #25378

I'm trying to accomplish the same thing and i almost got it working :) I have alot of conditional fields that shows/hides depending on one choice. However i'm having problems with the caption.

I'm trying to make it look like this in the admin e-mail:

City: New York

If i use: {if {City:caption}}{City:value}{/if} the result is only the value is displayed (New York)
If i use: {if City:value}}{City:caption}: {City:value}{/if}, like robert mentioned above the enire code is displayed in the email like this:

{if City:value}}City: New York{/if}

Any idea what i'm missing?
The administrator has disabled public write access.

Hide empty conditional fields in admin mail 11 years 6 months ago #25380

  • octavian
  • octavian's Avatar
  • NOW ONLINE
  • RSJoomla! Official Staff
  • Posts: 783
  • Thank you received: 110
{City:caption} won't work (the caption is a static value, it never changes, so why should you make a condition based on it)?
{if City:value} won't work either because you haven't added the mandatory curly brackets {}. So, the correct format is:
{if {City:value}}City: New York{/if}

However, I'm sure City might contain values other than New York so it's better to use:
{if {City:value}}City: {City:value}{/if}

Please do follow the documentation available: www.rsjoomla.com/support/view-article/80...t-php-knowledge.html where all of the above is explained.
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.
The following user(s) said Thank You: michael510

Hide empty conditional fields in admin mail 11 years 6 months ago #25381

octavian wrote:
{if {City:value}}City: {City:value}{/if}
That worked like a charm. Thank you. There are still empty lines where the other fields goes that aren't being displayed depending on user input but i guess i can live with that.

octavian wrote:
Please do follow the documentation available: www.rsjoomla.com/support/view-article/80...t-php-knowledge.html where all of the above is explained.
I have looked around but must have missed that particular post :whistle:
The administrator has disabled public write access.

Hide empty conditional fields in admin mail 11 years 6 months ago #25383

  • octavian
  • octavian's Avatar
  • NOW ONLINE
  • RSJoomla! Official Staff
  • Posts: 783
  • Thank you received: 110
Regarding the empty lines: if your editor encloses all fields within <p> tags, you can simply put the <p> tags inside the {if} clause. For example, instead of:
<p>{if {City:value}}City: {City:value}{/if}</p>
Use:
{if {City:value}}<p>City: {City:value}</p>{/if}

If you're using a WYSIWYG editor, you'll have to toggle it off or find a button that lets you view & edit the HTML source code.
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.
The following user(s) said Thank You: michael510

Hide empty conditional fields in admin mail 11 years 6 months ago #25384

I was using a <br> on each line but they were outside the if-statement and they caused the empty lines, placing it inside worked. The e-mail looks sweet now :)

Thanks again.
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!