Jump to content

Download Manager Topic Template Logic


Phillyman

Recommended Posts

Posted

I have my IP Downloads set to create forum topics. Everything is great, however if a custom member field is left blank, the field will show as "Guest" when the topic is created. Here is the code, I am wondering if I can enclose it with some sort of logic to check if the field exists before echoing it out to a forum post. That way it will only output on the topic if it is actually populated.

 

   <span style='font-weight: bold;'>
  Uploaded By:  </span>
    {expression="\IPS\Member::load( $file->customFields()['field_16'] )->link()" raw="true"}&nbsp;&nbsp;&nbsp;
  <span style='font-weight: bold;'>    

 

Posted
{{if $file->customFields()['field_16']}}
	<span style='font-weight: bold;'>
	Uploaded By:  </span>
    {expression="\IPS\Member::load( $file->customFields()['field_16'] )->link()" raw="true"}   
{{endif}}

 

Posted
On 8/1/2019 at 3:07 AM, Martin A. said:

{{if $file->customFields()['field_16']}}
	<span style='font-weight: bold;'>
	Uploaded By:  </span>
    {expression="\IPS\Member::load( $file->customFields()['field_16'] )->link()" raw="true"}   
{{endif}}

 

That worked great! Thank You!

 

i love you GIF

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...