nova-translatable icon indicating copy to clipboard operation
nova-translatable copied to clipboard

Allow more field types

Open agustinprod opened this issue 7 years ago • 17 comments
trafficstars

I use trix and markdown field types for translatable content, adding support to this field types will be really useful.

agustinprod avatar Aug 26 '18 08:08 agustinprod

I will look further into this, I like the idea :)

mrmonat avatar Aug 26 '18 11:08 mrmonat

Added Trix support in Version 1.1.0 (https://github.com/mrmonat/nova-translatable/releases/tag/1.1.0)

mrmonat avatar Aug 26 '18 13:08 mrmonat

Adding markdown support seems a bit more difficult, because there is no wrapper around the native laravel nova markdown field (like there is for trix), so basically I would have to copy the whole markdown field logic & ui into this custom field...

mrmonat avatar Aug 26 '18 13:08 mrmonat

Awesome. Looking at the source, as you say, looks harder for the markdown one... Maybe another approach can be toogling a form level language field changes instead per component, but i'm not really sure if possible.

agustinprod avatar Aug 26 '18 14:08 agustinprod

I guess a MD wrapper will be added in a future release, but in the meantime... how about adding a ->textarea() call to create a textarea instead of an input field?

kiroushi avatar Oct 10 '18 00:10 kiroushi

I guess a MD wrapper will be added in a future release, but in the meantime... how about adding a ->textarea() call to create a textarea instead of an input field?

you can, just don't use the ->singleLine() option

mrmonat avatar Nov 13 '18 12:11 mrmonat

+1 for markdown field :) would love this feature

voidgraphics avatar Jan 09 '19 15:01 voidgraphics

Cant use trix with withFiles() method

taliptako avatar Feb 08 '19 03:02 taliptako

I think having this as a Panel Type field would make more sense as it would allow using any component.

idragon81 avatar Feb 11 '19 11:02 idragon81

@killgt But how ?

taliptako avatar Feb 21 '19 23:02 taliptako

Using the actual approach of the package I prefer to have something like a Text field (extending the original from Nova) and adding extra bits like a translatable() option (so then you don't need the singleLine()) and also you don't need to change the name in case that you was using the Spatie's Translatable field block

But I'm agree with @idragon81 we can have both things, a TranslatableTabs and extended fields like I said

d8vjork avatar Mar 28 '19 20:03 d8vjork

@taliptako, Did you manage to add "withFiles()" support?

lab08tonci avatar Apr 12 '19 15:04 lab08tonci

Hello,

has anyone found a solution to make the image field translatable ?

YannikFirre avatar May 05 '19 08:05 YannikFirre

Hello,

has anyone found a solution to make the image field translatable ?

Hi, check this package. It have a lot todo, but basically uses a different approach...

PS: this package is based on astrotomic/laravel-translatable

y-martini avatar Jul 30 '19 12:07 y-martini

Adding markdown support seems a bit more difficult, because there is no wrapper around the native laravel nova markdown field (like there is for trix), so basically I would have to copy the whole markdown field logic & ui into this custom field...

@mrmonat I'm not sure if this would work, but can't you create a small wrapper component for the nova markdown field (https://github.com/laravel/nova/blob/master/resources/js/components/Form/MarkdownField.vue)?

Basically just like this:

<template>
    <markdown v-bind="$attrs"  v-on="$listeners"></markdown>
</template>
<script>
import markdown from 'path/to/nova/resources/js/components/Form/MarkdownField.vue';

export default {
    components: { markdown }
}
</script>

And then include this component in this package here? 🤔

tomhatzer avatar Aug 21 '19 16:08 tomhatzer

+1 for file upload, it's the very reason to go with trix in the first place

Ragash avatar Aug 26 '19 23:08 Ragash

@mrmonat did you have a chance to add Markdown field?

php-writerman avatar Aug 12 '20 13:08 php-writerman