Skip Navigation

[Resolved] social icons continue

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 4 replies, has 2 voices.

Last updated by Nigel 5 months, 4 weeks ago.

Assisted by: Nigel.

Author
Posts
#2699951
Schermafbeelding 2024-05-29 134716.png

Tell us what you are trying to do?
You helped me kindly with this issue: https://toolset.com/forums/topic/split-showing-social-icons-on-artists-page/

But the problem is, that if a userdoes not fill out all the available social URL's , there are blanks between the icons on the front-end
I would like them to automatically line up and fill in the blanks. See attached image.
Perhaps you can tell me a better way to do this?

I need same now on my other project site: hidden link
Thank you!

#2700133

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

Reading the other thread, it seems that you are using the Single Field block to output the social icons and links.

In which case you would need to wrap each Single Field block in a Conditional block that tests whether the field you will use is not empty (i.e. it has a value to generate the icon and link with).

See https://toolset.com/course-lesson/using-toolset-conditional-block/

#2700155

Hi, yes that is what i do, and that works. But the problem is that i have 5 social media options for each user, instagram, youtube, twitter, facebook, twitter.

But when someone does not fill in, let's say, Youtube, there will be a gap between instagram and twitter. (See attached image in first post)

#2700158

i would like the icons to align automatically if a user does not enter all social media links

#2700183

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

I guess you must be arranging the icons inside a grid, and you will have empty grid cells when there is nothing to output. Would that be right?

(I can't tell from your sites, they are not public.)

You need to be outputting the icons as part of the flow so that they don't take up space if they don't exist.

The core Row block lets you add multiple child blocks which will be displayed in a row. So you can add your conditional blocks as child blocks of a Row block, and if some of them don't output anything, the others will close the gaps.

#2700222

Oh! Thanks a lot, that worked!