#2365November 1, 2019by dukie662 answers
I want to show a predefined template when users open grapesJs something like this: Storage manager. HTML: <div id="gjs" style="height:0px; overflow:hidden"></div> <script src="app.js"></script> javascript in app.js: Result: Blank editor
artf
@dukie66 <div> style="background-color="red"; height="100px"; width="100px"</div> this is not how you supposed to write HTML
#2364October 31, 2019by mario-digital3 answers
I am trying to add the toolbar to the layers panel and I am not sure how to go about this. Is there any way to accomplish this? toolbar Where I would like to place them: Thank you for your response guys!
artf
At the moment, there is no easy way to change/customize navigator items content. What we could add next is a new callback option in configs that would be executed inside ItemView template and would allow any HTML content (similar to custom...
mario-digital
@pouyamiralayi This is what i mean
artf
Actually, it should be possible now to use the layerManager.onRender callback option
#2363October 31, 2019by CatalinCernea3 answers
Hi, since we wanna export the generated HTML and CSS and integrate it in a separate website its very probable to have CSS classes with same name and could lead to UI problems. We're thinking in renaming them after export and add a prefix on each class but don't know how to achive this or if it's a good thing. Has anyo...
devmohitagarwal
HI @iColdoCatalin , We faced the same issue and overcame this by sandboxing the css.To do so, I used sass.js (https://github.com/medialize/sass.js/) Steps: enclose the cssString with your custom class. say MyCustomClass.Run sass.compile fr...
artf
Thanks for the suggestion @devmohitagarwal not bad as the approach. In any case, I'd prefer moving all the discussion about namespacing CSS in export here so I'd close this issue
CatalinCernea
HI @iColdoCatalin ,We faced the same issue and overcame this by sandboxing the css.To do so, I used sass.js (https://github.com/medialize/sass.js/)Steps:enclose the cssString with your custom class. say MyCustomClass.Run sass.compile from...
#2361October 30, 2019by timkelly08103 answers
My team and I used grapesjs to create email templates and are storing them in an AWS S3 bucket. We have successfully sent an email through our web application, however, images fail to display. After clicking "view original", I can see that the image src displays properly, but the actual image doesn't display. We belie...
artf
https://github.com/artf/grapesjs/blob/dev/src/asset_manager/config/config.js#L77
artf
From what you said it might be also because you simply didn't enable to view images in that email... Anyway, this has nothing to do with GrapesJS itself so there is no reason to keep this issue open.
timkelly0810
Does grapesjs encode images within templates to base64? If so, is there a way to NOT do this or to decode before sending to S3? Edit: So I downloaded a template from the Amazon S3 bucket where we are storing them and it seems to already be...
#2360October 30, 2019by MartinPutz2 answers
Hi, I am trying to create a custom StyleManager property with 'integer' type. My ultimate goal is to 're-define' how certain units are displayed. For example, the user use unit 'X' and then the actual value would be different in pixels.(One of the reasons is the new dragmode since it is using pixels, so I want to keep...
MartinPutz
You were right, it works now. Thanks a lot. Great project!
artf
Actually, the integer property has a wrong implementation of init (I'll fix it in the next release). For now, update your init method with the code below and try if it works
#2359October 30, 2019by sheldon5forever3 answers
Hi guys, I'm working with grapesjs which version is '0.15.8', and in 'absolute' mode when I drag a block into canvas, I find the styles of component are missing. Define component as following: And I found the code in Droppable here: /utils/Droppable.js@L78 the component's styles are replaced. Should 'addStyle' be used...
pouyamiralayi
@artf yes! this is not happening if i remove `script`. the behavior is fine.
pouyamiralayi
Hi @sheldonwr this bug you are referring to is not reproducible in my side, here i tried your type definition on the demo and it is working, please check the below code and see what is missing in your side: the issue i observed with this c...
artf
Ok, actually a weird thing happens when a component has script property defined... Thanks for the report guys, I'll check this out. Can you confirm that without script it behaves correctly?
#2358October 30, 2019by Uysim3 answers
I can see that image has been set only with a single click on image asset. I want to close the modal even on when click. I try to set a callback on asset click But when I click on asset. The console never trigger.
artf
@Uysim you can extend the image type https://grapesjs.com/docs/modules/Assets.html#extend-asset-types Here is the original view of the image type
Uysim
@pouyamiralayi This is not correct. My question is about the callback when user click on image on assets manager. Your answer mean to close the modal immediately after it is opened
pouyamiralayi
Hi there! your answer is hereI want to close the modal even on when click. try to set a callback on asset click cheers!
#2357October 30, 2019by giorgiosjames1 answer
Explanation Using https://grapesjs.com/demo.html v0.15.8 on Chrome 77.0.3~ Windows 10 Pro Build 18362 Importing a Video component with any Boolean attribute (controls, loop, autoplay) using the import modal will break all boolean attributes on the component until the component is deleted. Reproduction StepsNavigate to...
artf
At first look the issue might be here: https://github.com/artf/grapesjs/blob/a850a305b80b8f86c0e7e4fb92b6492c2e5a1957/src/dom_components/model/ComponentVideo.js#L115-L117 indeed in the export/import I'd expect just ... controls> and not .....
#2356October 29, 2019by luvcharan3 answers
Hi, Add link (href) to image in grapesjs . First we add image in grapesjs and then add link to that image, its shows " Link " text next to that image, but i was unable to add link to that image. here i am adding screenshot below, can you please help me out , how to add link in image
pouyamiralayi
@luvcharan reference from the demo:
pouyamiralayi
Hi @luvcharan you must use `Link Block not Link`. 1) first add the link block. 2) then drop your image inside link block. 3) specify href for link block. cheers!
ck1ldn
Hi Do the links not work in a demo, unpublished template. I've been trying this and it's not working in preview
#2355October 25, 2019by ned-kelly3 answers
I know there's an older thread with Rulers support as a suggested roadmap item (but it's been closed) - Just wondering if there's any chance of seeing this in GJS in the future? - Would be an awesome addition - I'm currently in the process of writing crop/bleed marks plugins also for responsive print design (aka one d...
ronaldohoch
Hello, may it help: https://github.com/Ju99ernaut/grapesjs-rulers
artf
Just wondering if there's any chance of seeing this in GJS in the future? Sure we might see it one day but for now, it's not my priority so if someone else would like to start this as a PR it would be great
artf
Thanks @ronaldohoch, I'll close this in favor of the plugin