4 Replies Latest reply on Sep 18, 2006 3:54 PM by peterj

    Using images in URLs

    chris3

      HI,

      I am attempting to use an image within a URL in Portal 2.4.

      When I use the following code the link disappears:

      <a href='<portlet:actionURL><portlet:param name="perform" value="backToSelectDB"/></portlet:actionURL>'>
      <img src='<%= renderRequest.getContextPath() %>/images/edit-undo.png' HEIGHT="22" WIDTH="22" BORDER="0" ALT="Back to database select" TITLE="Back to database select"/>
      </a>


      No link shows on screen.

      If I use the same anchor code, but remove the image tag and use text, the link is shown:
      <a href='<portlet:actionURL><portlet:param name="perform" value="backToSelectDB"/></portlet:actionURL>'>
      back to select db
      </a>


      Is there any way to use an image within a URL?

        • 1. Re: Using images in URLs
          peterj

          Are you saying that the image is displayed but it is not a link, or are you saying that the image does not display at all? My comment below assumes the later.

          I have done this before and it worked fine. Have you looked at the HTML source within the browser? You should see the < img > tag within the < a > tag. The issue is probably that the src path is incorrect; viewing the generated HTML is the best way to debug the problem.

          • 2. Re: Using images in URLs
            chris3

            When I use text, the following is produced, and I can see the text:

            <a href='/portal/auth/portal/default/ao/ad?action=1&perform=backToSelectDB'>
            back to select db
            </a>


            When I use the image tag, I get this:
            <img src='/weborganiser/images/edit-undo.png' HEIGHT="22" WIDTH="22" BORDER="0" ALT="Back to database select" TITLE="Back to database select"/>
            <a href='/portal/auth/portal/default/ao/ad?action=1&perform=backToSelectDB'>
            <img src='/weborganiser/images/edit-undo.png' HEIGHT="22" WIDTH="22" BORDER="0" ALT="Back to database select" TITLE="Back to database select"/>
            </a>


            No image or link is visable, no link shows up using the Firefox Web Developer extension, and highlighting the anchor tag.

            I can't see anything wrong with the HTML. As an additional test I also used the image tag code before the anchor tag. The image displays fine outwith the anchor tags, but disappears within them.

            Strange.



            • 3. Re: Using images in URLs
              chris3

              I know this does not answer anything, but I gave up with image urls and just used an image input tag with javascript to set the form submit parameter.

              The image shows up fine in the image input tag.

              • 4. Re: Using images in URLs
                peterj

                That is strange. When I do the same thing I get the image showing up with a blue outline (I overrode the style to get rid of the outline).

                Try this. Change the image properties to lower case (e.g., height="22"). (In my code I did not provide a height or width.) Perhaps Firefox doesn't like uppercased attributes on an XHTML page.

                The only other thing I can think of is that a style setting could cause the problem. Do an Edit CSS (since you have the Web Developer extension) and see if there is a style sheet other than portal_style.css.