I want to spit out slightly different html based on a filter condition passed to cfdirectory.
Here is my cfml:
<cfdirectory
directory="#dirName#"
name="fileList"
action="list"
type="file"
filter="*.jpg|*.jpeg|*.png|*.gif|*.mp4"
>
<ul id="content">
<cfoutput>
<cfloop query="fileList">
<cfif filter NEQ '*.mp4'> // I guess this is not possible and is throwing the error
<li class="content image">
<img src="img/#name#" />
</li>
</cfif>
<cfelse>
<li class="video image">
<video controls="controls">
<source src="img/#name#" type="video/mp4">
</video>
</li>
</cfif>
</cfloop>
</cfoutput>
</ul>
I presume that I cannot simply access the filter
inside the cfif
, but I am not sure how to skin it. Does it need to be stored in a variable outside of the loop?
Any help much appreciated