Is it possible to incorporate ejs code into grapesjs? - ejs

I'm using grapesjs on a project and I want the user to be able to drag in a block that would add an ejs script, for example <%= data.title %>
I've tried doing it just like that, but the exported html is <%= data.title %<
plus it looks ugly in the editor.
Has anyone had a similar problem and made a solution?

Related

Tab completion for ejs tags such as <% %>

I am using ejs for my template engine. In the .ejs files, it is fine to tab completion with normal html tags. However, I cannot find a way to tab completion for ejs tags such as <% %>``<%= %> etc. How could I make it?

Creating Custom Content Element in TYPO3

Cany anybody tell me how to render the following structure in
typo3 without developing a new extension.
<div class="sidebar-details">
<div class="sidebar-details-title">
<h4><span>MY TITLE</span></h4>
</div>
<div class="sidebar-details-body">
<p>
TEXT
</p>
</div>
</div>
What would be the best/recommended way to achieve this ?
Start using gridelements.
Gives you exactly what you want.
http://typo3.org/extensions/repository/view/gridelements
You can activate the RTE html mode and put it in its source or make use of HTML element, but that's depending on your needs.
If you want to keep RTE functions for editing the text what I mentioned first is the recommended way. Have done it several times myself.
If you are using Template mapping using Templavoila so, you can create FCE(Flexible content element) for it and you can map this part.
If you are using fluid template mapping so, you can create gridelement for it. and map all part.

GWT anchor to kick off new css class

Im building a nav menu and am struggling with something really simple here. In my UI binder i have this
<header class="{res.css.mainHeader}">
<a href="#{res.css.mainNav}" class="{res.css.openMenu}">
open
</a>
<a href="#" class="{res.css.closeMenu}">
close
</a>
<h1>new header</h1>
</header>
So when I write and test this in html, it works fine. you click on the word open, and everything animates, shows all the cool stuff, the world is a happy place. But i can't figure out how to translate this into GWT.
When I run the above code, I get this error
[WARN] [itrgwtprototype] - Escaping unsafe runtime String expression used for URI with UriUtils.fromString(). Use SafeUri instead: <a class='{res.css.openMenu}' href='#{res.css.mainNav}'> (:20)
But I have a sneaking suspicion that GWT has a better way to do it than SafeUri. How do i make this work? The CSS stuff is correct, but the anchor click is whats messed up.
thanks.
You are setting the anchor href property with a css value (href="#{res.css.mainNav}").
If you want to translate it entirely in GWT you should listen to ClickEvent on you open menu and then do something like open a panel or something else. In order to do so you can replace the anchor with a Label (or InlineLabel) and listen on click events on it.

Submit button not work while using ClientValidation of asp.net mvc 2.0

I have one form with text box, submit button, drop down list ..... I'm using <%Html.EnableClientValidation(); %> to validate all the elements in my form. But the probem is when I write <% using (Html.BeginForm()){ }%>, the validation works, But when I click on the submit button, it did nothing even though I complete all the condition of each elements. And the submit button is submitting while I use <form method="post"> instead of <% using (Html.BeginForm()){ }%>.
I use jquery tab in my view, so I have more than one submit button that do different task(I test the value of the submit button in my controller).
Could any one tell me, what did I wrong here?
Thanks in advanced.
I'd make sure that you wrap your entire form in the braces when using the <% using (Html.BeginForm()){ }%>. If your submit button is not contained within those braces, then it will not cause the form to post.
<% using(Html.BeginForm()) { %>
... form elements here ...
<% } %>
When you use this method, remove the other form tags on the page as this syntax is equivalent to writing:
<form>
... form elements here ...
</form>

Typo3: adding elements inside an list item <LI>

Im trying to get something like this:
<ul>
<li>
<h3>Some header</h3>
<p>Some text</p>
</li>
</ul>
inside a Text element, but when I try to apply the blocktype to the content of the <li>, it applies it to the whole content.
Im using rtehtmlarea. What can I do?
Strange - this works in my installation. You should check the RTE configuration in page TSconfig. I assume something like this:
RTE.default.proc {
allowTagsOutside = img,hr,[your Tags]
}
Another suggestion is: Disable the Rich Text Editor (there is a checkbox below the textarea), enter your tags, then enable it again. The tag structure should be preserved.
If not, drop me a line, I will post my RTE configuration.
If you need a waterproof solution, try playing around with your RTE.default typoscript.