Issue #2076Opened June 12, 2019by msassa2 reactions

[QUESTION] How make a new component to allow laravel blade directives?

Question

Hi, thanks for the nice work.

I'll like to know if there is a way to use blade directives inside the code.

I already add a new functionality to edit the source code, and work just fine. image

But when I write something like that, the canvas show a ugly text: image

And I like to find a way that @if don't render in the canvas. Do you know how? The template in the front end works just fine, but I like to hide that from the canvas. Thanks!

Answers (3)

artfJune 14, 20192 reactions

@msassa If you write the code like this, it's quite hard for the editor to understand it, but if you create a kind of custom conditional component you'll get more control over it. Here an example of your case where the condition can also be changed via trait https://jsfiddle.net/452fvwk6/

verdvermJune 13, 20190 reactions

What would parse that syntax during rendering?

I've been looking at running react in the canvas, but we need to load react and transpile components we create. There is an in browser babel script to do something like this. Haven't got it fully working yet.

Fundamentally, what you are writing is being interpreted as text/html

msassaJune 13, 20190 reactions

Hi, I'm saving that code into a file, in S3. Later, I use that files in a Laravel application. Everything work fine, the only improvement I like to do, is:

The code is correct as source code, and it has to be saved that way. But when I visualize that block on the canvas, I just need to see the html, not the @if (...) as well as the @endif ... It could be marked with something special as indicating that it is surrounded by a directive bucket, but that would not be necessary.

Actually, it shows something like this: image

Ideally, I would need to show something like this: image

Thanks

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.