Results 1 to 10 of 10

Thread: Image Display

  1. #1
    Join Date
    May 2008
    Location
    West Midlands, UK
    Posts
    32

    Default Image Display

    Hi

    Can someone help me out with a bit of code?
    I have a mixture of links - some have images and some don't.
    I am using the following code to display images in areas where I want to have them displayed:

    <img src="<%$site_url%>/<%$image%>">

    However, using this code, links without an image display the cursed red cross.
    What I need is an if statement to test if an image is present.


    Regards
    Millards

  2. #2
    Join Date
    Oct 2007
    Location
    Sydney
    Posts
    652

    Default

    Quote Originally Posted by Millards View Post
    However, using this code, links without an image display the cursed red cross.
    What I need is an if statement to test if an image is present.
    Try something like this

    <%if $image !="$tpl_base/images/transparent.gif" %><img src="<%$site_url%>/<%$image%>">
    <%/if%>
    Good luck
    Mitchell
    Last edited by Mitchell; 05-15-2008 at 04:13 AM.

  3. #3
    Join Date
    May 2008
    Location
    West Midlands, UK
    Posts
    32

    Default

    Quote Originally Posted by Mitchell View Post
    Try something like this



    Good luck
    Mitchell
    Hi

    No joy I'm afraid but your syntax may help me work something out.

    Thank You
    Millards

  4. #4
    Join Date
    Oct 2007
    Location
    Sydney
    Posts
    652

    Default

    Make sure there is a blank image called "transparent.gif" is available in your active themes images folder.

  5. #5
    Join Date
    Oct 2007
    Location
    Sydney
    Posts
    652

    Default

    or what about this?

    <%if $image !="$site_url/transparent.gif" %><img src="<%$site_url%>/<%$image%>">
    <%/if%>

    and have "transparent.gif" file in you main directory!

  6. #6
    Join Date
    May 2008
    Location
    West Midlands, UK
    Posts
    32

    Default

    Hi Mitchell
    Now that you have helped me with the syntax I am getting somewhere.
    The links with images are now showing the required image and the cursed red crosses have disappeared.

    Many Thanks
    Millards

  7. #7
    Join Date
    May 2008
    Location
    West Midlands, UK
    Posts
    32

    Default

    Quote Originally Posted by Mitchell View Post
    Try something like this



    Good luck
    Mitchell
    Hi Mitchell
    Just to let you know that the first code you sent did work. The reason it didn't work when I first entered it into script was because I didn't delete some of my own code elsewhere.

    Thanks Again
    Millards

  8. #8
    Join Date
    Oct 2007
    Location
    Sydney
    Posts
    652

    Default

    Quote Originally Posted by Millards View Post
    Hi Mitchell
    Just to let you know that the first code you sent did work.

    Thank you,
    ... well, enjoy experimenting. After it is done it worth while all the hard work.

  9. #9
    Join Date
    May 2008
    Posts
    49

    Default Question

    Where are you putting that code to show thumbnails in listings?

  10. #10
    Join Date
    Oct 2007
    Location
    Sydney
    Posts
    652

    Default

    Quote Originally Posted by jrusso543 View Post
    Where are you putting that code to show thumbnails in listings?
    Put this on your row.html file.

    Code:
    <img src="http://image.picoshot.com/thumbnail.php?url=<%$url%>" align="middle">

Similar Threads

  1. Sub Categories Display
    By jromano in forum v5.x
    Replies: 2
    Last Post: 09-17-2007, 05:13 PM
  2. Google PR display
    By troller in forum Blocks and Modification
    Replies: 11
    Last Post: 10-02-2006, 07:19 PM
  3. Display title
    By cucupidon in forum v5.x
    Replies: 1
    Last Post: 07-20-2004, 06:24 PM
  4. category display
    By Hart_House in forum v5.x
    Replies: 1
    Last Post: 12-03-2001, 04:57 PM
  5. Replies: 6
    Last Post: 11-21-2001, 06:21 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •