October 13, 200025 yr I made a search page where you select one of the following categories for example A,B or C. Each category includes few businesses. Some of the businesses in the categories have a "banner -image" in their container field. I want the banners to appear on the "search results" page. I used the following CDML TAG (<IMG SRC="FMPro?-DB=mydatabase.fm3&-RecID=[FMP-CurrentRecID]&BANNER=&-Img" X-CLARIS-USEIMAGEWIDTH X-CLARIS-USEIMAGEHEIGHT ALIGN=bottom> ) The problem is that most of the businesses don't have a banner in their container field so the web browser displays a broken images in the list between the ones that actually work. Are there any ways to prevent those broken image logos? Is there a way to modify the tag so that filemaker skips the empty container fields while processing the list? Thanks.
October 16, 200025 yr Put an [FMP-If][FMP-Else][/FMP-IF] on your html page. The IF checks whether the container field is empty (container.neq. ). If the field is NOT empty, display the graphic, ELSE nothing. If the container.neq. expression refuses to work, create a calculationfield in your database that does the check, then test this check field on the html page.
April 5, 200124 yr Newbies alternately, you can create a calculation field which generates the code for your image file automatically: field value image url (txt) a.jpg image src (calc) <img src="a.jpg"> the calculation goes like this: If( image url = "", "" ,"<img src=""images/" & image url & """>") this way if you have a value in image url, it will create an image tag and if it has no value, no image tag will be created. obviously substitute "images/" with whatever is your directory structure. you can also add attributes like border=0, a width and height value (helpful if it is standard, but even that's not necessary) hope this is helpful. feel free to e-mail me if you have more questions.
Create an account or sign in to comment