Follow User with links to profiles in "Following" list

I want my users to be able to “Follow” another user’s profile. This would just add them to a list and then can be displayed like “Following: User1, User2, User 3 etc.”

This much I think I can figure out. But how do I make those entries in the list output a link to those user’s profiles? So the list “Following: User1, User2…” would link you to User1’s profile if you click their name, or User 2 if you click theirs and so on.

thanks!

1 Like

Simplest way… just use a repeating group with a link element inside the cell…

hmm. Yeah not sure how that would work if I want to display them as cards.

Here’s an example of the “cards”. On the Index Page it lists most recent builds. When you mouse over it gives more detail.

image
and the elements that make up the reusable element for the card.
image

So I would need to somehow pull this same information, but from a list of “liked builds” or something.

I’m not sure I understand what you’re asking?..

Are you asking how to create a repeating group to show images? Or how to make an overlay show on hover? It’s not clear what the question is now (or how it relates to the original question about links)?..

Maybe this will help clarify?

You just need to save the ‘Liked Robot’ somewhere in your database (the actual reference to the Robot datatype, not a ‘link’ as you’re doing now).

So, one way or another you need to save the Liked Robot itself.

You can use a list of Robots on the User datatype, or you can create a new datatype (for Liked Robot) to link a User to a Robot.

In either case, you can then just use that as your RG datasource to display the User’s liked robots.

Also, I don’t see any reason to to use 2 different reusable elements for the Robot Cards (although you can) - I’d just use a single element (i.e. the RG) just with a different datasource (i.e. the Current User’s Liked Robots if it’s being saved as a list, or do a search for ‘liked Robots’ where the User is the current User: each item’s Robot)

I think I am starting to get it. I created the Field “Robots I like” and made it data type User on the User’s table of the DB.

So now when clicking the Heart icon, my work flow is
image
What would I choose to save the robot to the list though?

I created the Field “Robots I like” and made it data type User on the User’s table of the DB.

Maybe I’m misunderstanding what you’ve written there… but (obviously) the ‘type’ of the ‘Robots I Like’ field needs to be the same ‘type’ as the robot (whatever that is in your app… I think it’s ‘Build’?) - NOT User (which is what I read from what you wrote) - that would be for saving a list of Users, not Robots (or Builds, or whatever they are called in your app)

What would I choose to save the robot to the list though?

Again, whatever ‘type’ of thing the Robot is (I’m guessing it’s a Build - in which case Current Page Build is what you want to add to the User’s list of Builds).

Okay I get it now. I assigned “Robots I Like” as ‘Builds’ type rather than Users. This works and I Tried using the same Card to display the robots but it didn’t work as the original card was set to “Parent Group’s Builds”. I made a new card to show “Current User’s Builds I Like” and that all works with one exception.

When I click the card, it doesn’t take me to that Robot’s profile page.

On the Index which uses the original Parent’s Group Builds card, clicking the element takes you to that robot’s profile:
image

This however, doesn’t work for Robots I like as “Parent Group’s Builds” doesn’t work. I tried “Current User’s Robots I like” but I’m not sure what to put after that in order to make it link to that robot’s profile. (Which should be appname.bubbleapps.io/version-test/build_profile_2/

I’m so close!

Edit: I also noticed on the page that displays my likes, if I like more than 1, it displays as many cards as I like, but tries stacking them in each card.


Here, I’ve “Liked” 3 robots. It lists 3 cards but each card is trying to display all 3 rather than each one individually.

any ideas what to do to correct this last part?

Here, I’ve “Liked” 3 robots. It lists 3 cards but each card is trying to display all 3 rather than each one individually.

Yo must have your data sources configured incorrectly (I’m guessing you’re probably doing a search for things inside the RG cell, instead of referring to the current cell’s data)


This is how the RG is setup,

and the Reusable element


This is within the reusable element for the Image.

I’m not quite sure what you’re doing with the re-usable element (or what it is)…

But the image datasource is definitely wrong (you’re referring to multiple images instead of just one image).

The image data source should just be the current cell’s build’s image (if you’re using a reusable element somewhere in there that will complicate things a bit, but that’s basically what you still need to do - ultimately be referring to the current cell’s build).

This is the card I made that displays the robots image, creators name, etc. I pre-made the card and just drop it in the RG. This works on the index page where it shows all the recent robot builds that were created.

I’m confused. Are you saying that I can’t use a reusable element for the ‘likes’ page, and it needs to be apart of the page and then use current cell’s build?

what also doesn’t make sense to me is that if I only have 1 like. It displays everything properly. It only tries stacking/repeating them when I have more than 1 likes


With just 1 like, it displays properly.

That makes perfect sense, as if there’s only one like then the list of builds will only contain one item (so it will display correctly)…

This is the card I made that displays the robots image, creators name, etc. I pre-made the card and just drop it in the RG. This works on the index page where it shows all the recent robot builds that were created.

Ah, I see… so the Reusable element is just an image element?

In that case you just need to set the image datasource to be the current cell’s build’s image.

image
It contains a few things, the robots image, name, username of the user that created it, and date it was created. It also has a shape that is just some visual element that fades in/out when hovered.

How do you set it to current cell if it is a reusable element though?
For example: the image is currently set to “Current User’s Robots I Like: each item’s Robot Image” It doesn’t give me the option for Current Cell

It contains a few things, the robots image, name, username of the user that created it, and date it was created. It also has a shape that is just some visual element that fades in/out when hovered.

That’s what was confusing me (in your post you were referring to a reusable element, but you were only showing an image element in your screenshot…)

Personally I think having a reusable element inside the RG is complicating things a bit - it would make more sense (to me anyway) to have the RG itself as a reusable element…

But anyway, that changes things…

The image (along with everything else inside the reusable element) needs to have its datasource simply referring to the parent group’s build (assuming the reusable element is a group, and has a content type of build).

Then you just need to set the datasource of the reusable element to be the current cell’s build when you put it into the RG.

1 Like

ah! there we go. easy fix.
image
Now to get this to link to the robot build page and we’re in business!

1 Like