Replacing a url with other text in a link

Sorry I don’t know where to find the answer to this, though I am sure I have seen it somewhere. I am using huge long search urls as links in my Journal, and would like to type something appropriate over them. I don’t know html. Could someone please give me the code to do this?

If there is a fairly succinct thread or wiki somewhere, I will do my best to refer to it for future needs.

It would also be useful to know what is meant by the terms “Observation view” and
“Observation field view” to help interpret instructions eg the very useful Filter Cribsheet. I have bookmarked.

thanks.

Example url: https://www.inaturalist.org/observations/31219232 . Use the code:
<a href=https://www.inaturalist.org/observations/31219232>Your text here</a>
becomes :
Your text here

2 Likes

Thannk you very much @psyllidhipster! I look forward to using i!

you can drop the domain part of the url (https://www.inaturalist.org)… a relative link will work no matter what domain you are on, eg for iNaturalist.nz or iNaturalist.org

eg
<a href="/observations/987838">this flax</a>

there are some good html tricks in this NZ help page:
https://inaturalist.nz/pages/tips_tricks_nz

2 Likes

Always make sure the url is enclosed in quotes:

<a href="huge-long-search-url">text</a>

This is because some characters in search urls could break the html if they aren’t quoted properly.

2 Likes

Thanks Mark and bazwal. My first try worked, for now anyway, and I will incorporate these tips…and try and remember it! How do you guys keep this sort of info where you can find it - or do you remember it all?

I copied the spaces in the psyllid’s example, though I was a bit surprised to see them - was that intended?

By the way if you haven’t looked at the obs psyllid gave as an example, you really should - its an outstanding one!

When you say drop the domain part of the name, do you mean drop the http://www. bit too? And will these links to work for people who are not on the site at the time, but receive them in eg an email?

Could someone please tell me what is wrong with this one?
current Survey and trial observations at
RENH Trial site - Selected 2018-2021

Have I mis-copied the code? Or perhaps the problem is the hyphens and spaces in the Project name?
Unfortuately I need to have another Project with a similar name, in order to filter observations by both the Place (RENH Trial Site 2018-2021) and also by the Field required for the “Selected” (Traditional) Project. But maybe I will have to drop “2018-21” from the
Place and Project names?

editing…trying to show you the code I used, but it appears here as a link, but non-working of course…trying again by omitting the initial " <a "
and current Survey and trial observations at
ref=“https://inaturalist.nz/projects/renh-trial-site-selected-2018-2021”>RENH Trial site - Selected 2018-2021

Your html is just missing the h in the href tag.

<a ref="https://inaturalist.nz/projects/renh-trial-site-selected-2018-2021">RENH Trial site - Selected 2018-2021</a>

Should be

<a href="https://inaturalist.nz/projects/renh-trial-site-selected-2018-2021">RENH Trial site - Selected 2018-2021</a>

1 Like

thanks very much jdmore EDIT- yup that did it!!! thanks again

NB I also just changed the Place and Project names to try and get rid of some of the characters, so my earlier test examples will no longer work - sorry for any inconvenience if anyone tried in the interim

1 Like

Here in the forum, the little tool that looks like </> displays selected text literally instead of converting to a link.

1 Like

I just posted a Tutorial that might help:
https://forum.inaturalist.org/t/useful-html-tags-for-inaturalist-comments-and-other-text/6198

Yes. Everything before the first single backslash. This tip is only for a link on iNat, because the link becomes relative, ie “from the same domain that we are already on”. If you are following the link from in an email, then you are not on any domain and so the browser won’t know where it’s relative to.

To make it clearer, if you are looking at the observation at:
https://inaturalist.nz/observations/31838766

and it has a link to an observation at:
https://inaturalist.org/observations/31839874

then when you follow it, you will no longer be signed in, because you will be looking at a different domain. If the link is just:

/observations/31839874

then the browser adds the domain of where you are leaving from (ie “relative to where you have come from”), which keeps you signed in no matter what domain the observation is posted on.

2 Likes

thanks @jdmore

thanks Mark

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.