How to go to the site by name

Hello everyone!
Can you explain to me how to make it so that, for example, the user selects the genre of the book and in the node "function" is calculated, for example, if you want the genre of history, then the result in the node "text" will give the title of the book "Spartacus".
How to make it so that you can click on this title and the user goes to the site of this book, where he can read it?

You could create a <a href...> html link.

[{"id":"7b407620.964008","type":"inject","z":"bf9e1e33.030598","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"spartacus","payloadType":"str","x":240,"y":3320,"wires":[["5e1ed103.9087d8"]]},{"id":"5e1ed103.9087d8","type":"ui_text","z":"bf9e1e33.030598","group":"2d4fe667.28f8ba","order":10,"width":0,"height":0,"name":"","label":"text","format":"<a href=\"{{payload}}\" target=\"blank\">{{payload}}</a>","layout":"row-spread","className":"","x":570,"y":3320,"wires":[]},{"id":"2d4fe667.28f8ba","type":"ui_group","name":"demo","tab":"1caa8458.b17814","order":1,"disp":true,"width":"12","collapse":false},{"id":"1caa8458.b17814","type":"ui_tab","name":"Demo","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

when you click the spartacus text it should open a new browser page at google/search?q=spartacus.

<a href="{{msg.payload}}" target="blank">{{msg.payload}}</a>
1 Like

Is it possible to write code in the "functions" to go to the site?

That is not what you asked, how can you click on text in a function node?

I think you need to be more clear in what you are asking.

I meant that a list of genres is given, the user selects any genre, and in the "functions" node you need to write code that outputs the title of the book in "text" with the transition to the site. Is it possible to do this?

Sure you need to generate an a href link for each book as i showed in my example.

1 Like

I understand, thank you very much!

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