Skip to Content Skip to Menu

🌟 CB Editor Assistant 1.0.0 is here! Discover our new AI Joomla Plugin that wrote its story! (and this banner!)
Start at just $12.50/month* or 💸 save 30% with our 🛍️ Black Friday Intro Offer for your subscription's lifetime
🎉 Black Friday sale is here! Great savings on professional and developer memberships! Get 25% off now with code BLACK-FRIDAY-2024!

[SOLVED] Alligning field horizontally in tab

6 years 5 months ago - 6 years 5 months ago #305072 by massimolivio
[SOLVED] Alligning field horizontally in tab was created by massimolivio
Hello,
I would like to know if it's possible to allign fields in a tab horizontally via CSS.
In fact lets' say I have field CB_1 , CB_2, CB_3 showing in a user's profile tab they are always displayed vertically like

---example vertical----
CB_1
CB_2
CB_3


Instead I would like them to be shown horizontally

---example horizontalal----
CB_1 | CB_2 | CB_3

If YES would you please give me few lines code for css styling ?
Many thanks in advance.
M.-)
Last edit: 6 years 5 months ago by krileon. Reason: Added [SOLVED] tag to subject

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48560
  • Thanks: 8292
  • Karma: 1445
6 years 5 months ago #305074 by krileon
Replied by krileon on topic Alligning field horizontally in tab
Yes, as each field is just contained in a div element. Shouldn't need any CSS though as you can move the fields to a tab that's in a not shown on profile position then use a Custom HTML field with substitutions to format them directly next to each other. Example as follows.

[cb:userfield field="CB_1" /] | [cb:userfield field="CB_2" /] | [cb:userfield field="CB_3" /]

See the below tutorial for further substitution usage information.

www.joomlapolis.com/documentation/279-community-builder/tutorials/18353-using-substitutions-throughout-cb

If you still prefer to do this with CSS the below example will set 3 fields to equal size.

Code:
#cbfr_CB_1_FIELD_ID_HERE, #cbfr_CB_2_FIELD_ID_HERE, #cbfr_CB_3_FIELD_ID_HERE { display: inline-block; width: 33%; vertical-align: top; }

Replace CB_1_FIELD_ID_HERE, CB_2_FIELD_ID_HERE, and CB_3_FIELD_ID_HERE with the ids of your 3 fields. You can add custom CSS to CB using CBs built in CSS override functionality shown below.

www.joomlapolis.com/blog/kyle/18711-template-css-overrides-made-easy


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: nant, RebeccaWool

Please Log in or Create an account to join the conversation.

6 years 5 months ago #305099 by massimolivio
Replied by massimolivio on topic Alligning field horizontally in tab
Thanks a lot !
Have a nice day.
M.-)
The following user(s) said Thank You: krileon

Please Log in or Create an account to join the conversation.

6 years 1 month ago #308091 by RebeccaWool
Replied by RebeccaWool on topic Alligning field horizontally in tab
Hello Kyle,

I used this solution to present fields in a horizontal line and it works:
Code:
[cb:userfield field="CB_1" /] | [cb:userfield field="CB_2" /] | [cb:userfield field="CB_3" /]

Except it appears to stop privacy and conditional options from working. Therefore it is not possible to show/hide the field under certain circumstances.
Is this the case?
In order for CB Privacy and CB Conditional to work correctly, do fields have to be displayed in the "normal" way on tabs?

Many thanks.

Life is a constant learning curve and I've just started out!

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48560
  • Thanks: 8292
  • Karma: 1445
6 years 1 month ago #308104 by krileon
Replied by krileon on topic Alligning field horizontally in tab
[cb:userfield field="FIELD_NAME" /] substitutions should still respect privacy and conditions. They should output empty if privacy or condition prevents viewing of the field. Ensure you're not viewing the users profile as a CB Moderator as moderators are exempt from privacy controls and some conditions (depends on the condition).


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

6 years 1 month ago #308138 by RebeccaWool
Replied by RebeccaWool on topic Alligning field horizontally in tab
Kyle,

Yes, the code:
Code:
[cb:userfield field="CB_field_name_here" /]

Does obey privacy and conditional requirements and this is as expected.

However, if I have the following in a custom HTML field:
Code:
[cb:userfield field="CB_course_date" /]

Where the field cb_course_date has a type set to "date", it does not appear in the tab! But if I use:
Code:
[cb_course_date]

in the same custom HTML field, when viewing the tab it clearly shows the date.
But this latter CB substitution does not comply with privacy and conditional settings.

I am confused, why is this? I simply wish to use the first CB substitution for the date field but can't. It will save lots of [cb:if] statements.

Thank you.

Life is a constant learning curve and I've just started out!

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum