How to extend a field in Laravel Nova? - vue.js

I'm using Laravel Nova and I'd like to create my own custom field based on this field : BelongsToMany. The idea is to get the code used for that field and then add my own.
I tried to create a custom field and then extend it (is it the right way ?) but then how can I edit the VueJS part of the field ?

Yes, That's right. You can able to edit vuejs part of the filed as well. For info, you can check this docs https://nova.laravel.com/docs/2.0/customization/fields.html#fields

Related

How to get selected locale in custom field type?

I'm trying to build custom field type / plugin in Storyblok according to their guide and need to get selected locale or current slug at least. I don't see such information in Vuejs instance of that plugin. Can anyone advise on it and provide some code how to do it?
This information can now be accessed by the new attribute this.storyItem

How can I pass same data to multiple views in Odoo?

I have some data that I need to pass to every website views in Odoo. The problem is that I don't know the proper way to do that. I have thought about manually add them to every render method, but it doesn't feel right for me. And it violated DRY, of course.
I am using Odoo 12. Thank for your help!!
every page of odoo call website.layout template (for header & footer) so you can place your data in layout template and it will available in every page

How do I update Jira custom field values via REST api

I need to update "matter" field (single select list). What is the best way to do that?
I have a values in bulk (more than 100) to be added to the custom field. Is there any way i can do this by using an API. I have also checked the link
But nothing is mentioned here as well.
Just add the customfield to the issue json like
{ "fields": {"customfield_XXXX": "value"} }
where XXXX is the customfield number. You can get it by looking at the custom field screen on Jira and look at the link shown in the browser bar by hovering you mouse on the custom field action links.
Moreover you said that is a single select list so the value will be only ONE.
If you intend to CREATE or EDIT a customfield on the fly with 100 choices it is a completely different problem.
Check this unresolved suggestion on the Atlassian website for advice. The issue contains also a workaround with a custom plugin available.

yii-user extension - how to add a checkbox profile field?

Yii framework, yii-user extension (using latest version of both, to date): how do I add a simple "checkbox" field for the profile of all users?
I am logged in as admin, and went to user/profileField/admin. I can add new field but the closest I get to is adding a "BOOL" field which is rendered as a dropdown, while I need a checkbox... . When "BOOL" is used I cannot specify the widget and even if I could, there's no documentation on those yii-user widgets.
Any help is welcome!
Open up modules/yii-user/views/user/registration.php. Around line 40, add something like this:
else if ($field->field_type=='BINARY') echo $form->checkBox($profile,$field->varname,array());
Now when you want to create a checkbox field, choose the BINARY field type. If you want to require that it's checked, add this to the 'Other Validator' field: {"compare":{"compareValue":"1"}}
I've had a look around the docs for that extension and I don't actually see a single checkbox anywhere in the screen shots or mentioned anywhere in the wiki either.
You might be able to dive in and add support for one in the places you need it, Yii nicely handles all the HTML elements so it shouldn't be too hard to add the feature in a primitive form. CHtml::checkBox() or CHtml::checkBoxList().
Then again if your already running into problems with it, it's probably going to be easier in the long run for you to write what you need yourself.

Adding a custom field type to SugarCRM?

I'm trying to add a custom field type to our SugarCRM 6.2 instance. I want to add an "email link" type field. I want it to function like the URL field, but prefix every address with "mailto://" prefix instead of "http://".
It will be good if that field type is available in studio while creating new fields or in minimum, some custom code to achieve it.
What I did up to now:
- I've copied include/SugarFields/Fields/URL to include/SugarFields/Fields/Email
- In modules/ModuleBuilder/language/en_us.lang.php I've added a title for the email field
But unable to get anything working. Any help?
First of all you do not want to make any coding changes outside of the custom directory. Doing so outside of this directory is not upgrade safe.
Create a custom fields directory in your custom folder
Create new template files (.tpl) for your custom field
then you can just add a regular textfield in studio
then edit your viewdefs in your custom directory
in your tpl file concatenate the mailto:// to your text and just add the persons email address and it will take care of the rest for you
why you need custom field type for such small functionality? Just add your custom JS file in editviewdef.php. Then use some jQuery selector to perform certain action. For detail view, you can use view.detail.php to add required text in run time.
This will help you to store less data in database and display more in frontend.