# How to go to the site by name

**URL:** https://discourse.nodered.org/t/how-to-go-to-the-site-by-name/63824
**Category:** General
**Tags:** node-red-dashboard, function-node
**Created:** [12 June 2022 15:57 UTC](https://discourse.nodered.org/t/how-to-go-to-the-site-by-name/63824 "2022-06-12T15:57:23Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Eva01](https://avatars.discourse-cdn.com/v4/letter/e/278dde/32.png) [@Eva01](https://discourse.nodered.org/u/Eva01)
#### Post date: [12 June 2022 15:57 UTC](https://discourse.nodered.org/t/how-to-go-to-the-site-by-name/63824/1 "2022-06-12T15:57:23Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [12 June 2022 16:17 UTC](https://discourse.nodered.org/t/how-to-go-to-the-site-by-name/63824/2 "2022-06-12T16:17:10Z")

</div>

You could create a \<a href...\> html link.  
e.g.

```auto
[{"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=\"http://www.google.com/search?q={{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.

```auto
<a href="http://www.google.com/search?q={{msg.payload}}" target="blank">{{msg.payload}}</a>

```

---

<div class="post-metadata">

### Author: ![Eva01](https://avatars.discourse-cdn.com/v4/letter/e/278dde/32.png) [@Eva01](https://discourse.nodered.org/u/Eva01)
#### Post date: [12 June 2022 16:34 UTC](https://discourse.nodered.org/t/how-to-go-to-the-site-by-name/63824/3 "2022-06-12T16:34:42Z")

</div>

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

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [12 June 2022 16:41 UTC](https://discourse.nodered.org/t/how-to-go-to-the-site-by-name/63824/4 "2022-06-12T16:41:38Z")

</div>

> [@Eva01](#):
>
> 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 c

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.

---

<div class="post-metadata">

### Author: ![Eva01](https://avatars.discourse-cdn.com/v4/letter/e/278dde/32.png) [@Eva01](https://discourse.nodered.org/u/Eva01)
#### Post date: [12 June 2022 16:56 UTC](https://discourse.nodered.org/t/how-to-go-to-the-site-by-name/63824/5 "2022-06-12T16:56:32Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [12 June 2022 17:03 UTC](https://discourse.nodered.org/t/how-to-go-to-the-site-by-name/63824/6 "2022-06-12T17:03:37Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Eva01](https://avatars.discourse-cdn.com/v4/letter/e/278dde/32.png) [@Eva01](https://discourse.nodered.org/u/Eva01)
#### Post date: [12 June 2022 17:32 UTC](https://discourse.nodered.org/t/how-to-go-to-the-site-by-name/63824/7 "2022-06-12T17:32:31Z")

</div>

I understand, thank you very much!

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [11 August 2022 17:32 UTC](https://discourse.nodered.org/t/how-to-go-to-the-site-by-name/63824/8 "2022-08-11T17:32:39Z")

</div>

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