Is it possible to pre-propagate username in cb form?

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

Dragonrider created the topic: Is it possible to pre-propagate username in cb form?

Having started to understand how to use Content Builder (Thank you Mario) I wonder if it is possible to have the form to submit a voluntary position to have the username (organisation's name) already pre-filled in the CB form? (When user is logged in)

Or am I just not looking in the right place of the documentaion?

Thanks David

www.uk-webspace.com/vol/index.php/cbsubmit
#232780
  • Posts: 2154
  • Karma: 67
  • Thank you received: 264

DarkoCujic replied the topic: Is it possible to pre-propagate username in cb form?

Hey,

yes, it's possible. First off, is your view linked to a BF form or a pure CB?

If it's CB, then add the following to your Editable Template:
$items["XXXXX "]["value"] = JFactory::getUser()->username;
You have to replace XXXXX with the name of the field where you want to set the username.

If it's a BF form, then in your Before Form piece, add this:
$this->execPieceByName('ff_InitLib');
$username = JFactory::getUser()->username;
ff_setValue($username, 'NAME OF FIELD YOU WANT TO PREFILL');

Regards,
Darko

Satisfied with our support? PayPal tips
===========
Need to renew Pro Support? Buy Here!
===========
Satisfied? Consider a membership!
===========
Like us on Facebook
===========
Support Crosstec and get ALL EXTENSIONS and professional support for just $5. Here!
#232799
  • Dragonrider
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 43
  • Thank you received: 1

Dragonrider replied the topic: Is it possible to pre-propagate username in cb form?

Hi, thanks for that. It is pure CB and I'm obviously not posting the code in the right place as all I get is the code as above (with Name substituted for the "xxxxx(space)")
#232833
  • Posts: 2154
  • Karma: 67
  • Thank you received: 264

DarkoCujic replied the topic: Is it possible to pre-propagate username in cb form?

Hey,

that space was a typo, sorry about that.

Go to Content Builder -> Views and select your view. Then go to the Editable template of that tab and below the two commented lines, add the code from above:
$items["test"]["value"] = JFactory::getUser()->username;

Substitute test with your field name and it should work.

If it still doesn't work, please send backend credentials to darko.cujic@crosstec.org and I'll take a look.

Regards,
Darko

Satisfied with our support? PayPal tips
===========
Need to renew Pro Support? Buy Here!
===========
Satisfied? Consider a membership!
===========
Like us on Facebook
===========
Support Crosstec and get ALL EXTENSIONS and professional support for just $5. Here!
#232834
  • Dragonrider
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 43
  • Thank you received: 1

Dragonrider replied the topic: Is it possible to pre-propagate username in cb form?

Ah! Thank you, figured it out.

I think you meant to add the code in the Editable prepare area, NOT the Editable Template. Anyway, putting it in there makes it work! Thank you once again.

Have to say, this is a fantastic Joomla Component and the support here is 2nd to none!!!

Many, many thanks again.
#232835
  • Posts: 2154
  • Karma: 67
  • Thank you received: 264

DarkoCujic replied the topic: Is it possible to pre-propagate username in cb form?

Awesome, glad you figured it out. Yeah, just saw that I had written twice Editable template instead of Editable prepare :(

Let us know should you need anything else.

Regards,
Darko

Satisfied with our support? PayPal tips
===========
Need to renew Pro Support? Buy Here!
===========
Satisfied? Consider a membership!
===========
Like us on Facebook
===========
Support Crosstec and get ALL EXTENSIONS and professional support for just $5. Here!
#232836
Moderators: ForumSupporttomeperica
Time to create page: 0.065 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