How to use an image as a link.

Anything to do with this site.
Post Reply
User avatar
Ezriilc
Site Admin
Posts: 46
Joined: Sun May 24, 2020 10:43 am

How to use an image as a link.

Post by Ezriilc »

The following is a bbcode ATTACHMENT tag which cannot be made clickable inside a URL tag. It will forget the url and show the closing URL tag after it. I think this is a bug in phpBB3.

Some words before the attachment, but inside the url.
BannerMellon.jpg
BannerMellon.jpg (101.21 KiB) Viewed 901 times
Some words after the attachment, but still inside the url.[/url]

This is an IMG tag using the image url (found above) inside a url tag to make it a clickable link:

Image
User avatar
Ezriilc
Site Admin
Posts: 46
Joined: Sun May 24, 2020 10:43 am

Re: How to use an image as a link.

Post by Ezriilc »

The above post is a demonstration of what I think is a bug in phpBB3. Here's an explanation of the problem.

If one wishes to upload an image (or any kind of file) as an attachment to a post, the file cannot be made a link by nesting the bbcode ATTACHMENT tag inside a URL tag. One must show the image as an IMG tag and put that inside a URL tag. However, because the attached file has not been called in an ATTACHMENT tag in the post at least once, phpBB3 automatically adds an "Attachments" box to the bottom of the post with the file(s) in it, thereby making it show twice.

To put an attached image into a post as an IMG tag, one must find the actual url for the uploaded file. Here's how to do that.
  1. Click the "Attachments" tab/button below the post editor box and follow the prompts to upload the file.
  2. Click the "Preview" button to see the file in the post.
  3. Right-click the image and click "View image" or "Open image in new tab", then copy the url from the address bar.
  4. Go back to the post editor and put that copied url into an IMG tag in the post.
  5. Finally, to make the image a clickable link, wrap the IMG tag in a URL tag that points to wherever you want.
There is no way around this as far as I can tell. I'm going to try to work out a way to fix it, but I don't know when that might be.
Last edited by Ezriilc on Sun Jun 21, 2020 8:31 am, edited 1 time in total.
Post Reply