How to make a hyperlink within a document in Writer

I want to make a link from one phrase to some text that follows within the same document.
It is important that the link still work after I cut and paste that text into a webform.

I would also like to make a link from text in a document to a photo in the same document
It is important that the link still work after I cut and paste that text into a webform.

Thanks!

I dont think, there is a way do what you are trying todo.
But maybe if you explain a bit more, what the webform will do with the text (i.e. insert it into a webpage) there might a way to use relativ links to achieve working hyperlinks after input.
But i see little chance for them to be working in both contexts.

Quick transfer from one location of a document to another one is based on cross-references or bookmarks.

You must first define a target for the link. You have two possibilities:

  • bookmark

    Select the word(s) or object to be the target and Insert>Bookmark. Give it a name and Insert.

    Note: bookmarks are preferentially meant to navigate within the LO Writer document and are listed in the Bookmarks section of the Navigator.

  • cross-reference

    Select the word(s) or object to be the target and Insert>Cross-reference. In Type, click on Set Reference*, give a name and Insert.

Where you want to create a link, select the word(s) which will become the holder of the link and Insert>Hyperlink. Click on the Document icon. At right of the Target: text box, press the button with a reticule icon and select your target either from the Bookmarks or References lists or type directly the name in the box.

If you save the document as HTML (I recommend you save only a copy as .html and keep the original in .odt format), the link is converted to HTML <a> element and the target is coded as a #fragment as expected in an HTML page.

Since I don’t understand what you mean with “webform”, I can’t answer about the survival across copy’n’paste. If you copy the part containing the link and paste it into the same document, the hyperlink is pasted too. If you paste into another application, it depends on the other application (does it handle ODF data? will is use only the .txt version of it?). I doubt that LO Writer puts an HTML version of the copied block into the clipboard.

Edit your question to provide more details on your goal.

To show the community your question has been answered, click the ✓ next to the correct answer, and “upvote” by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!

In case you need clarification, edit your question (not an answer which is reserved for solutions) or comment the relevant answer.