Is it possible to have a custom title field in CB please?

  • Dragonrider
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 43
  • Thank you received: 1

Dragonrider created the topic: Is it possible to have a custom title field in CB please?

On our Volunteering website we are using Content Builder to enable non-users to submit voluntary positions via a CB form.

Whilst I can, and have, altered the title of the article manually. If I later make a change to the CB form, the original title is restored to the article.
For example, the title can be "Position" and the organisation posting the position we will call "Organisation".

In CB the title can be either "Position" or "Organisation", what I would like to do is have CB automatically change the title of the article to "Organisation - Position".

Is this possible please?
#235519
  • Posts: 2365
  • Karma: 85
  • Thank you received: 317

mihaela replied the topic: Is it possible to have a custom title field in CB please?

Hello,

Are you referring to a title that you set in ContentBuilder view > Content Template > Title Field?

If I understood correctly, the problem in your case is that you can set only one field here as title ("Position" or "Organisation") and you would like that values from both fields are saved as title ("Position" and "Organisation"). Is that correct?

Regards,

Mihaela
#235522
  • Dragonrider
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 43
  • Thank you received: 1

Dragonrider replied the topic: Is it possible to have a custom title field in CB please?

Yes, that is exactly what I would like to be able to do.

I can alter it manually, but if I then amend the cb form, the article title is reset to the original setting, eg Position whereas I wish to have both Organisation and Position displayed in the Article Title field, as created in ContentBuilder view > Content Template > Title Field

David
#235525
  • Posts: 2365
  • Karma: 85
  • Thank you received: 317

mihaela replied the topic: Is it possible to have a custom title field in CB please?

Ok, I understand now how you would like this to work.

To achieve what you want to as follows.

Crate an additional field in the form for this view.

Then in View Tab => In Editable column click on [text] and in windows that opens click on Scripts Tab and in Init (JS): section put the following code:
contentbuilder.onSubmit(
   function(){
       contentbuilder._('newfieldname').value = contentbuilder._('field1').value + ' -  ' + contentbuilder._('filed2').value ;
       return true;
   }
);
NOTE: In the code above you have to replace newfieldname with the name of new field that you have creted. Also, replace field1 and filed2 with the names of the "Position" and "Organisation" fields.

This will work in case your view is created based on Data Storage. What the code will do is it will concatenate values of these two fields in one which you can then use in view > Content Template > Title Field.

If your view is based on the BreezingForms form, I will give you different instructions.

Let me know whether this works for you and whether you have managed to apply this to your form.

Regards,

Mihaela
#235532
  • Dragonrider
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 43
  • Thank you received: 1

Dragonrider replied the topic: Is it possible to have a custom title field in CB please?

Hi Mihaela,

I have added the code as instructed, but so far, the result is that only the Name appears in the article title field even when I have used Display_Title as the Title chosen.

I can't see why this is not working???
#235537
  • Posts: 2365
  • Karma: 85
  • Thank you received: 317

mihaela replied the topic: Is it possible to have a custom title field in CB please?

Hello,

Can you please send me the code that you have used?

Also, are the names that you have put in the code the names from the "Name" column in Data Storage?

Regards,

Mihaela
#235547
Moderators: ForumSupporttomeperica
Time to create page: 0.067 seconds

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Summer Sale!

50% discount on all of our extension subscription plans & templates!

Get Your Subscription Here

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

Get 1 year access to all of our current and future products and 1 year of professional support -- 99 for just 49! (Summer Sale)

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

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!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here