In Hartl's Rails Tutorial, what does the CSS for textarea refer to? - railstutorial.org

In section 5.1.2 one adds some custom CSS, including the following:
textarea {resize: vertical;}
but I can't find any textarea tags anywhere in the HTML. Is it tagged implicitly, or does this CSS just not refer to anything?
(A search of the github doesn't turn up any hits for textarea outside of styling sheets.)

There is a text_area field here, in the micropost form:
https://github.com/mhartl/sample_app/blob/master/app/views/shared/_micropost_form.html.erb
You were probably searching the repo for 'textarea', which yields no results as Rails uses form helpers. f.text_field, f.date_field etc

Related

Does tinymce have an option, via menu, to insert form fields into it or just by editing the code?

Does anyone know of a ready-made plugin that allows adding input, textarea, select etc. on tinymce?
The tinymce.dom.Selection API (https://www.tiny.cloud/docs/api/tinymce.dom/tinymce.dom.selection/#select) allows you to select elements or set content in the TinyMCE editor. You can assign the API class to an action or an interaction element like a button or form, and any selected content will be replaced with the contents the API action passes in.
If that's not a good fit for what you need, is there an example of the type of adding input, a textarea, or a select you're looking for?
There are no official plugins that allow such interactive elements to be added. TinyMCE is a text editor that is built to create blog posts, articles, etc. By design, it is not a page builder. However, there may be some unofficial plugins on GitHub that may implement such features.
If you are going to insert forms and text areas that should not be edited or reconfigured afterward, you can use templates. They may come as any valid HTML. Thus, some fixed forms can be just saved as templates.
Another way is, of course, inserting HTML directly into the code.

CQ5/AEM - Certain links are not rewriting

We're experiencing some inconsistency with URLs on our publish instance. Some links are having the /content/project/ removed whilst others are not.
The /etc/map has been created and seems to be working as expected, except for these links.
An example of where the rewriting is links in the OOTB Text component.
Just highlighted the text and used the hyperlink in the RTE.
The output HTML on publish comes through as the desired
<a adhocenable="false" href="/path/support.html">My Link</a>
A link that's not being rewritten is from a component, in it's dialog we have a richtext xtype that is referenced in the jsp
<cq:text property="description">
This however is output on the publish as:
<a adhocenable="false" href="/content/project/path/support.html">Other Link</a>
I've had a look in /system/console/configMgr and the Day CQ Link Transformer Checker and this has a:href, area:href, from:action, input:value. So I thought this would pick up the links under anchors.
If anyone can suggest where I should be looking to resolve this, any help would be appreciated.
Upon further investigations I noticed that the links that were not working were contained in tags, and therefore not rewritten by AEM

how to enable <meta> tag in TinyMCE 4.0?

In previous version of TinyMCE I was able to use valid_elements : "+*[*]" to enable using <meta> tags but in new version, it does not work anymore!
When I go to source code I cannot see the meta tags although they are embedded in html code. So, editing meta tags by source code editor is not possible!
I was in the same situation than you (TinyMCE 4 VS markups).
In fact my goal was to handle this video markup example : https://support.google.com/webmasters/answer/2413309?hl=en
I wanted TinyMCE to not touch anything ^^
In the "tinymce.init" function, just add :
extended_valid_elements : "div[*],meta[*],span[*]",
valid_children : "+body[meta],+div[h2|span|meta|object],+object[param|embed]",
And you'll be fine.
The "extended_valid_elements" option allows you to override the behaviour of specified markups. Like you'll read in the official documentation, you have to be careful to include all default values because you are currently overriding them.
Personally I didn't bother and allowed every attributes with [*]
That's not very clean, I would rather use this option :
extended_valid_elements : "#[itemscope|itemtype|itemprop|content],div,meta,span",
to properly authorize new attributes for those 3 markups but again you have to specify ALL default values (for example with just this line, the "id" attribute for div markups was cleaned...)
The "valid_children" option allows you to authorize curious embed markups regards to the official XHTML schemas : that's exactly what we want here. With this configuration, TinyMCE will not reorder unexpectedly your markups.
Hopes this helps !
Regards
There's lots of issues with tags like that in a contenteditable based editor, tinyMCE 4 has solved it by adding a new plugin that keeps the doctype, title, and meta tags in memory and dynamically adds it to the editor when viewing source and submitting the form. It's called fullpage. I also think that this plugin links any stylesheet that's added with the content_css setting.

Jahia CMS module which provides body html tag

I read that Jahia CMS uses 960gs framework as default for page layouts, also I read that all divs defining rows should be nested into a "special" div which has class equals to container_16. So I decided to find a module which in its view renders html for that special div. I tried file content search for "container_16" and found a bunch of css files and that's all, no view for any module showed up. And it made me confused and I kinda want to find a module which provides a basic html tages like "body" tag.
Does anybody knows the name of the jahia module
The module you're looking for is called "grid" and the source code is available here : http://subversion.jahia.org/svn/jahia/trunk/modules/grid/
Inside the row.jsp file you will find the following div :
<div class="container_16">

do DIVs inside form tags cause problems?

It seems sometime to work fine and sometimes not, so in should I use divs inside form or not?
and in general is there a guide for what HTML tags will not work inside other tags?
Divs do not cause any intrinsic problems inside forms. Any CSS rules or JS that might get applied to them may cause problems, but the same is true of any element.
The HTML 4.01 specification includes a guide on how to read DTDs. This is applicable for HTML 3.2 and 4.x as well as XHTML 1.x. HTML 5 does not have an official DTD, so you have to pay attention to the "Content model" for each element in the spec.