How to get selected locale in custom field type? - storyblok

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

Related

How to extend a field in Laravel Nova?

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

Always hidden field support in Podio API

I am creating apps using Podio PHP library and want to specify always hidden setting. I have tried it a lot but I did not find any option in the library so can someone please help me to point out how I can specify this setting.
After investigation, I am able to figure it out like how to pass the always hidden. When we are creating an app with fields then for each field we need to provide config array so in this config array we need to pass new property "hidden_create_view_edit" with true and it will create app field with always hidden setting.
Sample config array:
"config"=>array(
"required"=>false,
"label"=>"Name",
"delta"=>1,
"hidden_create_view_edit"=>true
)

Jive 7: How to change profile data / action?

I am writing a plugin for Jive (SBS) 7 and want to add more data to the template for the user profile Overview page (i.e. /people/admin ). In Jive 6 I did overwrite the profile path in struts and added my own ViewProfile action. But this action seems to be called no more.
I also cannot even figure out where the templates I changed get their data from (soy/people/profile/{userProfile, header, head}.soy) or what action is responsible for.
So how can I add another property to the soy file that gets a custom property for the targetUser? (custom property = property saved in the database table jiveuserprop)
You need to create a plugin and then use the option. Then, you simply use jquery to add the extra stuff.
you can create an action that takes in information using getters or post and throw it into the user's extended properties. You can create another action that'll retrieve that info in json.
then, simply use jquery's getJson to grab the info and use selectors to show the data in the user profile.
Don't forget to use the $j(document).ready(function(){ // your code here }); to show the info
simple example:
<scipt>
$j(document).ready(function(){
$j("div#j-profile-header-details").append("<p>hello World</p>");
});
</script>
will append "hello world" under the user's email address / job title.
hope this helps. feel free to ask more questions if it doesn't make sense. here's a good link on writing the javascript part of the plugin: http://docs.jivesoftware.com/jive/7.0/community_admin/index.jsp?topic=/com.jivesoftware.help.sbs.online/developer/PluginXMLReference.html
I got an answer in the Jive Developer community:
profile is an action in Struts2. /people/username is a URL Mapper permutation
https://community.jivesoftware.com/thread/263660

How to change dojo locale after dojo loaded?

We need set locale in data-dojo-config before dojo loaded so that dojo.i18n will work with this locale. Is there any workaround that we can change this locale in dojo/_base/config after dojo loaded so that any further dojo.i18n call will work with this new locale?
I have a single page application, by carefully design, I already be able to recreate all my UI widgets dynamically anytime. I want to add a Select somewhere so that user can change languages on the fly. Currently the only solution I have is put a queryString locale='newLocale' at Url and force browser refresh. That works but everything User have done lost and with a fresh start. That's not what I want.
Any idea? I don't afraid some changes of dojo to make this happen since my application will be built as a single layer and deploy to customers.
According to dojo's documentation, you cannot change the locale once it's loaded. See this page from their documentation, the relevant line is:
Once Dojo is loaded, it is not possible to change the locale for the
page.
Your description of adding a new parameter is what I've done in this situation, you can specify the locale property on the dojoConfig object to override the default locale.
EDIT: There is an open bug for this use case, see https://bugs.dojotoolkit.org/ticket/17196. In that ticket there also appears to be a workaround that basically involves manually loading the resource file of the language you want to use and updating any text.
So, adapting their example (http://jsbin.com/aquviq/1/edit), this would run after you initiate a change locale action:
require(['dojo/i18n!dojo/nls/' + resourceModuleWithLocale], function (resource) {
/* in here, you must set all of the text manually to the values in the resource object */
});
It still seems like a lot of work, but I suppose that's one possible way to accomplish this.

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.