Results 1 to 5 of 5
  1. #1
    Newbie
    Join Date
    November 26th, 2010
    Posts
    2
    WM-ImagePath noLink glitch
    I am having some issues with WM-ImagePath. I am not generating Detail Pages, only an index page. If I use the code:

    [WM-ImagePath: Photo]

    I get:

    <a href="" ><img src="/gallery/photo1.jpg" border="0" ></a>

    I want a link but the URL is in the database. I don't want the deprecated border attribute. Can I shut that off? Also, I need an alt attribute to make this valid HTML.

    Next I try the noLink option:

    [WM-ImagePath: Photo noLink]

    which produces:

    <img src="/gallery/photo1.jpg" border="0" noLink>

    What!? Not only the border attribute but it leaves the noLink in there, which is invalid HTML. I understand that it will work, but I have too much self respect to put that out there. Shouldn't it leave the link out automatically since I am not generating Detail Pages?

    In the end I had to write the whole thing myself:

    <a href="[WM-Field: Link]"><img src="[WM-Field: Photo]" alt="[WM-Field: Name]"/></a>

    Which gives me what I want:

    <a href="/article/one"><img src="/gallery/photo1.jpg" alt="Article One"/></a>

    Is this what I have to do, or am I missing something? Is there a way to use the WM-ImagePath and get valid HTML out?

    Thanks,
    Phil.
    Last edited by PhilA; November 26th, 2010 at 08:39 PM.

  2. #2
    ABW Ambassador ladidah's Avatar
    Join Date
    October 15th, 2007
    Location
    MA
    Posts
    1,888
    Quote Originally Posted by PhilA View Post

    In the end I had to write the whole thing myself:

    <a href="[WM-Field: Link]"><img src="[WM-Field: Photo]" alt="[WM-Field: Name]"/></a>

    Which gives me what I want:
    Great job. Thanks!

    I think your solution is great since you put the alt tag in there and eliminates the rest. Didn't even noticed that the "nolink" text was in the img src until I viewed source just now. Been a while since I played around with this.

  3. #3
    Affiliate Manager
    Join Date
    January 18th, 2005
    Location
    Los Angeles, California
    Posts
    1,913
    Good work, Phil.

    As noted in the WebMerge FAQ the WM-ImagePath tag is a useful convenience as a quick way to add images to a page, but for more options using the WM-Field tag within your own IMG tag gives you complete control over the presentation.
    Richard Gaskin
    Developer of WebMerge: Publish any data feed on any site
    http://www.fourthworld.com

  4. #4
    Newbie
    Join Date
    November 26th, 2010
    Posts
    2
    Thanks
    Okay, if that is what I have to do. Thanks for your replies. I was hoping that I missed something.

    My actual code gets much worse because I may or may not have a photo. If there is a photo, there may or may not be a link. If there is a photo, I want to alternate between two class values so the photo will alternate between float:left and float:right.

    Not to mention, that i have to prefilter my CSV file to remove records that I don't want to include. My first attempt was to wrap the whole thing in an if statement to decide if I wanted to include that record. Then, I could not have an if statement inside! Yikes! That sent me to to forums.

    I figured it all out but without nested WM-If's it is pretty messy. Richard, I do hope you include nested ifs in the next major release. Please, please...

    I have to say, that WebMerge has filled a need for me. The one monthly task that I am using it for was well worth the purchase price. I am sure I will find other places to use it as well.

    Phil.

  5. #5
    Affiliate Manager
    Join Date
    January 18th, 2005
    Location
    Los Angeles, California
    Posts
    1,913
    Quote Originally Posted by PhilA View Post
    My actual code gets much worse because I may or may not have a photo. If there is a photo, there may or may not be a link. If there is a photo, I want to alternate between two class values so the photo will alternate between float:left and float:right.
    That's a very interesting case. Could I trouble you to send me the HTML template you're currently using? While I'm not certain I'll be able to simplify things for that, I'll take a look and see if I can come up with something that will be of use to a good many people for similar circumstances.

    I figured it all out but without nested WM-If's it is pretty messy. Richard, I do hope you include nested ifs in the next major release. Please, please...
    I've been doing some R&D on nested IFs, and while it's doable it would take a bit of a memory hit. It probably won't be added to WM until v3.5 at the earliest, as there's much to do in other areas of the program that take priority, but I'm working on it.
    Richard Gaskin
    Developer of WebMerge: Publish any data feed on any site
    http://www.fourthworld.com

  6. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. Linking an ImagePath
    By dpdiaz in forum WebMerge (Fourthworld.com)
    Replies: 3
    Last Post: September 9th, 2010, 07:22 PM
  2. link vs nolink
    By FourthWorld in forum WebMerge (Fourthworld.com)
    Replies: 3
    Last Post: November 14th, 2004, 11:33 AM
  3. Linking noLink Images
    By kbrennan@usa.net in forum WebMerge (Fourthworld.com)
    Replies: 10
    Last Post: September 14th, 2004, 04:21 PM
  4. Resizing an image with WM-ImagePath tag
    By billbam in forum WebMerge (Fourthworld.com)
    Replies: 1
    Last Post: June 11th, 2004, 08:26 PM
  5. Feedback of nolink attribute
    By FourthWorld in forum WebMerge (Fourthworld.com)
    Replies: 12
    Last Post: February 4th, 2004, 09:42 PM

Tags for this Thread

Posting Permissions

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