How to display User's posts in a feed

I am building a social network site where users can make posts and other users can read them in a feed.

I am having trouble displaying the posts in terms of size. I am displaying posts in a repeating group and sorting by date created and I’ve created a text box and image box and video player etc but my problem is some user’s posts will just be text whereas others will be a picture or a video. So what I’m struggling with is how to display the posts so that it looks good (resized maybe) whether the user posts a video or just a few words of text.

I have a data type called Post with fields like Text, Image, Video, Audio, etc.

Hi
Just a little aside but doesn’t answer your full question. For large text items I use bubbles :truncate at a fixed number of characters and trail off with … when a user clicks on the text you can then do what you want. Pop up with the full text etc.
Just food for thought.
Kyle

I did this by creating the different elements and arranging them vertically, one on top of the other, then displaying them according to different criteria:

  1. The header - contains user image, username, and out-of-the-box text that is created when the post is created.
  2. Text container - only visible if this post’s text is not empty.
  3. Multiple image container - if this post’s images: count > 1, then it’s visible
  4. Single image container - if this post’s images: count is 1, then it’s visible
  5. Special “hiring” post container - this is only displayed if the post’s type is newHire.

Bottom line: Put all of your elements in a vertical line, make them their full width, and hide them with collapsed height unless certain criteria are met (if this post’s video is not empty then the video element is visible, for example). This is what mine looks like in the editor:

And here is a link to a vid of the hiding/collapsing in action based on the rules created.

Kind of a crummy vid of the scroll, but this is the result:
https://www.screencast.com/t/S8Ui9hsM7Bt

Thanks. There are so many little tricks like that I haven’t worked out yet. Cheers.

Thanks so much. That will definitely work for what I’m trying to do. I haven’t used the conditional stuff much but it will solve some other issue I have too.

This topic was automatically closed after 70 days. New replies are no longer allowed.