TOPIC:

Combine Two Fields in CB List View 4 months 2 weeks ago #242730

  • Topic Author
  • wellsjp
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 31
  • Thanks: 0
Is it possible to combine two fields in CB list view.

CB View is based on a CB data storage = presentations2020
I would like to combine two fields (PresenterFirst and PresenterLast) into one column (Presenter)?

Can I do this with a wrap code or another way?

John

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

Last edit: Post by wellsjp.

Combine Two Fields in CB List View 4 months 2 weeks ago #242736

  • tihana.krivic's Avatar
  • tihana.krivic
  • Away
  • Moderator
  • Moderator
  • Posts: 1789
  • Karma: 3
  • Thanks: 158
Hi,

Go to view->[text] (where is element Presenter) -> Scripts->Init (JS) and put this code:
contentbuilder.onSubmit(
   function(){
       contentbuilder._('Presenter').value = contentbuilder._('PresenterFirst').value + ' ' + contentbuilder._('PresenterLast').value;
       return true;
   }
);

Let me know if it works for you.

Regards,
Tihana
The following user(s) said Thank You: wellsjp

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

Combine Two Fields in CB List View 4 months 2 weeks ago #242737

  • TheMuffinMan's Avatar
  • TheMuffinMan
  • Offline
  • Developer
  • Developer
  • Posts: 10064
  • Karma: 167
  • Thanks: 804
Hi,

please try this as Item Wrap Code:
<?php $value = $item->colX . ' ' . $item->colY; ?>

Where X and Y are the field ids (integers) of the form elements behind it.
You can determine the IDs by doing right click => inspect on the column titles in the browser.

Then look for something like "col333" for each of the 2 and replace them with the X and Y above.

So let's say one field ID is 111 and the other is 222, it would look like this:
<?php $value = $item->col111 . ' ' . $item->col222; ?>

Once you got that up and running you probably want to hide the exta column.
If you confirm the above working for you, I gonna explain in the next step how to do that.

Regards,
Markus

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

Combine Two Fields in CB List View 4 months 2 weeks ago #242763

  • Topic Author
  • wellsjp
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 31
  • Thanks: 0


This is from highlighting the field name in the view screen and "Inspect element"


Am I correct in picking "176" for the ID?

I could not see any sign of "colxxx"

Also matches the ID column

Thank you very much for your help.
Attachments:

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

Last edit: Post by wellsjp.

Combine Two Fields in CB List View 4 months 2 weeks ago #242774

  • TheMuffinMan's Avatar
  • TheMuffinMan
  • Offline
  • Developer
  • Developer
  • Posts: 10064
  • Karma: 167
  • Thanks: 804
Hi,

I think they are a bit further up but you should be able to use these anyway.

Regards,
Markus

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

Combine Two Fields in CB List View 4 months 1 week ago #242810

  • Topic Author
  • wellsjp
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 31
  • Thanks: 0
I found the column number in the database table (see screenshot). I used that and it now displays the full name in the first name column.

Attachments:

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

  • Page:
  • 1
  • 2
Moderators: ForumSupport
Time to create page: 0.129 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!