• 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: {if{photo:path}}This ALWAYS shows!{/if}

{if{photo:path}}<p>This ALWAYS shows!</p>{/if} 10 years 6 months ago #29244

  • billing7
  • billing7's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 6
Hi All,

I'm trying to use the {if}{/if} logic to display form submissions on the front end by displaying ONLY fields that have data. If I use the {if{field:value}}<p>{field:caption}: {field:value}{/if} logic, it works nicely for text data. However, if I use the same logic on an uploaded photo field, whatever's between the {if}{/if} ALWAYS displays because the {field:path} value defaults to www.mydomain.com/ regardless of whether an image has been uploaded or not.

Is there another value other than field:value or field:path that holds JUST the name of the uploaded file?(Which I'm assuming should be an empty string or null if no photo was uploaded and therefore the {if}{/if} logic would work properly.)

Thanks!
The administrator has disabled public write access.

{if{photo:path}}<p>This ALWAYS shows!</p>{/if} 10 years 2 months ago #30377

  • phaedrap
  • phaedrap's Avatar
  • OFFLINE
  • Fresh Boarder
  • Firmitas, Utilitas et Venustas
  • Posts: 3
I too am looking for a workaround on this.
Code for Life
The administrator has disabled public write access.

{if{photo:path}}<p>This ALWAYS shows!</p>{/if} 10 years 2 months ago #30473

  • silviup
  • silviup's Avatar
  • OFFLINE
  • Moderator
  • Posts: 309
  • Thank you received: 49
I have tested this on a local installation and the syntax works properly with the {field:value} placeholder. I have entered the following value in a 'View Submissions' menu item's Row Layout:
{if {file:value}}
<tr>
	<td>{details}{file:value}{/details}</td>
	<td>{detailspdf}Download PDF{/detailspdf}</td>
</tr>
{/if}

Please note that you need to enclose the entire row in the {if}{/if} syntax for this to work.

PS: remember to replace 'file' (in the '{file:value}' statement) with the actual name of your field.

By applying the scenario described above, submissions that have not had a file uploaded will not get displayed.
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
Last Edit: 10 years 2 months ago by silviup.
The administrator has disabled public write access.

{if{photo:path}}<p>This ALWAYS shows!</p>{/if} 9 years 10 months ago #31477

If your example is exactly the same as your code, you are missing a space after the first if
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!