How do you create a listview with a list of items that, when selected, take users to a website?

I used the "click to add/delete data" button in listview properties to set items because editing a listview. I'm confused as to how to link each of those items to a site when selected. Any assistance in doing this is blocks editor is most welcome.

Note: Apologies if this is a very simple task but I couldn't find specific help online plus I've been using this program for a week now with no prior experience in coding or development but I'm very eager to learn more.

Hi.
Show the code you are using now and how you create the listview data. The data are always the same ? You delete/update the data in listview? The text in listview is always the same for the same items?
I have to know how you store data, which kind , and how you add them to listview.
Probably you have to set a list variable with all the links or a list of list ( text in list view + link )

Lookup in pairs

This can help you. A list where each items are a list of two elements (for example: text and link) and if you find text you retrieve link .

Example:
you have
the first element of the list (name 1 , www.name1.it)
Second element of list (name2, www.name2.it)
Etc

If you lookup in pairs with key : name2 you got www.name2.it

So name2 could be the text you clicked in list view

1 Like

This is the block edit for going into the News & Media category page where I want to enable clicking to go to their respective sites.

Screenshot 2023-11-30 191254

This is how I entered the Listview Data.

I just want to know how to link the items to their sites using the block editor.

Only you set data in listview or all the user?
I can't see the box where you save the link and which kind of database you are using now.
Where you store all these informations?

Of course. I have to know where is stored the link to help you. After click you want to show site inside your app or out in default browser

OK i see it , sorry but i was by mobile and outside

I set the data only in the list view.

The red outline is how i ideally want to set up the linking.
(Maybe my blocks could be setup something like the green outline? :laughing:)

Ok, I'm not sure but you have to try if using add data to listview the data are saved in app so every users will download apk can see the data. I think yes.
Anyway you have to save the list of links in a variable and after click retrieve it to use in webviewer block.
The name used in main text will be always the same for that tv?

Alright. So I'll have to save the link data somewhere and retrieve it for use in my list. Got it thanks.
And yes, the main text for the TV will always be the same.

1 Like

This is one way using the pairs block I show you before but if your data are fixed you can create only a list with all links and use the Slection index to get the right value.
In this way you can see fast name and link to edit them in block editor

This is another way , more easy, but you have to save data in the right way because item number 1 of list for link has to be connected with number 1 of listview and so on

Okay. Thankyou sir. I'll give this a quick try and get back to you if I get myself into a tangle :slight_smile:

1 Like

In the First example the name will be the same , with space or uppercase etc you have in listview

I might not be doing something right because it still doesn't work when i click in the emulator :man_facepalming:

Do i have to create the list (AllLinksList) in the Designer view or just in Blocks editor?

Main text not details, see the get blocks and change it

1 Like

An example

2 Likes