interactiondesignfoundation / nova-unlayer-field Goto Github PK
View Code? Open in Web Editor NEW🦜 Drag’n’drop email builder for Laravel Nova that uses Adds a Laravel Nova field for Unlayer service under the hood.
License: MIT License
🦜 Drag’n’drop email builder for Laravel Nova that uses Adds a Laravel Nova field for Unlayer service under the hood.
License: MIT License
load save disign have problem
and got error
editor.js:2 Uncaught (in promise) TypeError: Cannot convert undefined or null to object
in console and template saved not load
Unlayer::make('Email Template', 'design')
->config([
'projectId' => '888888',
'displayMode' => 'email',
'locale' => 'en',
]
)
->savingCallback(function (NovaRequest $request, $attribute, Model $model, $outputHtmlFieldName) {
$model->html = $request->input($outputHtmlFieldName);
})
->onlyOnForms()
->hideFromDetail()
->hideFromIndex(),
...
Hey. Thanks for your package.
I would like to know if it is possible to somehow use my variable values.
For example, routes, data from a model, etc.
I gave web
as displayMode value, but it is loading email mode only.
It should be as simple as using the __
translation helper that is available on the Vue instance, i.e. change these lines:
nova-unlayer-field/resources/js/components/FormField.vue
Lines 29 to 34 in d965fdf
to this:
on: '▶ ' + __('Enter fullscreen'),
off: '✖︎ ' + __('Exit fullscreen'),
Or maybe it's this.__('Enter fullscreen')
, I'm not 100% sure.
Anyway, like this, a developer can define a translation in a translation file and if none is defined it will still display the English text.
A more elaborate alternative (might be overkill) is to make the text completely customizable, something that could be used like this when instantiating the field:
Unlayer::make('something')->withButtonLabels([
'enterFullscreen' => 'foo',
'exitFullscreen' => 'bar'
])
Hi,
I'm using the latest version of your package. Creation page works, I can save it to database, no problem.
Issue is, when I face to editing page, empty page appears, not my previous design.
Unlayer::make('Content', 'content')
->config([
'displayMode' => 'email',
'locale' => 'en',
])
->savingCallback(function (NovaRequest $request, $attribute, Model $model, $outputHtmlFieldName) {
$model->html = $request->input($outputHtmlFieldName);
})
->onlyOnForms()
->hideFromDetail()
->hideFromIndex(),
I store content field as json and html field as html.
Am I missing something?
Thanks.
Hello,
First of all thanks for this package.
I've correctly installed the package but I had same error on save. Every time I try to save I'm having this error:
Array to string conversion
vendor/laravel/framework/src/Illuminate/Support/Str.php#488
I would also ask some more information to get correctly working this field. Here is the code:
Unlayer::make('Design')->config([
'projectId' => config('unlayer.project_id'),
])
->savingCallback(function (NovaRequest $request, $attribute, Campaign $newsletterModel, $htmlFieldName) {
$newsletterModel->content = $request->input($htmlFieldName);
}),
config('unlayer.project_id')
where it get the config?
What should I do to save correctly the config design ?
I've created a field on my table with json type to save the design as you illustrate on the docs, and also a content field to save html code.
Thanks
examples of Nova packages with tests:
Laravel nova 3.2 introduced new method called height()
for code field. Same method implemented with this plugin with different signature. it throws error.
Hello,
how we can manager uploap image?
The docs from unlayer says that we need to add a callbacks like the this:
unlayer.registerCallback('image', function(file, done) {
var data = new FormData()
data.append('file', file.attachments[0])
fetch('/uploads', {
method: 'POST',
headers: {
'Accept': 'application/json'
},
body: data
}).then(response => {
// Make sure the response was valid
if (response.status >= 200 && response.status < 300) {
return response
} else {
var error = new Error(response.statusText)
error.response = response
throw error
}
}).then(response => {
return response.json()
}).then(data => {
// Pass the URL back to Unlayer to mark this upload as completed
done({ progress: 100, url: data.filelink })
})
})
How can we add this feature?
Many thanks
The README says this option is optional, however failing to specify it causes a javascript error from vendor.js
- locale is not defined
.
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates are awaiting their schedule. Click on a checkbox to get an update now.
These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.
composer.json
php ^8.1
laravel/nova ^4.20
interaction-design-foundation/coding-standard ^0.3.0
orchestra/testbench ^9.0
phpunit/phpunit ^10.5 || ^11.0
vimeo/psalm ^5.22
.github/workflows/psalm.yml
actions/checkout v4
shivammathur/setup-php v2
actions/cache v4
.github/workflows/run-tests.yml
actions/checkout v4
shivammathur/setup-php v2
actions/setup-node v4
actions/cache v4
package.json
@vue/compiler-sfc ^3.2.33
form-backend-validation ^2.3.8
laravel-mix ^6.0.43
lodash ^4.17.21
postcss ^8.4.14
vue-loader ^16.8.3
node >=16.0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.