Symfony2 custom (HTML5) date field creation - symfony

My target is to create a custom Date field (which should work with Doctrine). The main difference with the basic Symfony's one is that it shouldn't be 3 dropdowns, but one <input type="date">.
I've tried several tutorials like Symfony's book and some helpful answers here.
However the more solutions I try to embed, the more problems I see.
Could anybody write or advise the tutorial for this task?
Thanks in advance.

The date field type supports that already. Just set the widget option to single_text and voila — you'll have what you want. No need to create a special type for that. :)

In Symfony >= 2.6 they introduced a html5 option which will generate a HTML5 input element.
You can see the documentation here: http://symfony.com/doc/current/reference/forms/types/date.html#html5

Related

How to make MultiValueField with Composite Fields and i18n enabled work properly?

Have anyone tried to have a form with MultiValueField in Magnolia having Composite fields with i18n enabled and is working properly?
Currently, I'm encountering some weird behaviour when adding items to English then switching to other language and adding items again then switch back to English with items all gone. In one JIRA post it said it was already fixed but I still encounter this issue. Also encountered issues in sorting which apparently not supported by the DelegatingMultiValueTransformer.
If so, can you please show me the configuration you use to make this work properly? If needed customisation, can you give me ideas on how to do it?
Would really appreciate any help on this.
Btw, I'm using the latest release 5.4.6 now.
Maybe you don't want to put two questions in one request in the future ;)
Re language issue:
did you check that you have i18n enabled also on the subfields, since you are using deletage transformer? AFAIK with delegate you need to have them enabled on all fields in the hierarchy.
Re transformer & ordering:
IMO the only way out is to write custom transformer. Look at source code of MultiValueTransformer and in the part of the code where it goes just two levels down when checking child values, you need to go deeper.
You would also need to define different structure storage for your values there since one used by the MultiValueTransformer would not suffice for multiple levels.
Perhaps you can extend one of the more specialized MultiValue*Transformer or perhaps you try MultiValueJSONTransformer if storing all values in json array is enough for you (you would still need to extend it and to repopulate values back into dialog when opening dialog for editing).
HTH,
Jan

how can i make a datagrid value searchable using dexterity in plone?

I have a custom content type built with dexterity and I have a datagrid on it. What I want to do is make the fields in the datagrid searchable with plone search engine. Please provide some sample if possible. im a noob.
thanks
Have you tried this?
https://pypi.python.org/pypi/collective.dexteritytextindexer
For best results I think you shold read the section "Registering a custom field converter".
In addition you may find interesting reading this similar SO question:
Extending SearchableText using collective.dexteritytextindexer
It's really well written and contains link to code examples in github.
Ciao

Silverstripe 3 - Force list view of children for one page type

is it possible to force the children of a defined page type always to show as list?
And if yes, who? Can't figure out who to do this.
Thank you in advance
it is possible, however its pretty trick to get it working properly.
It is not only a lot of work to get it done right, it will also bring certain problems with it which you will have to overcome (eg the Preview Split Screen will not work, you will have to apply some custom javascript I think), so consider this carefully.
Have a look at the silverstripe-blogger module, micmania1 has done a pretty good job there.
He uses a GridField to display the blog children (BlogPosts) if you set the config like this:
BlogPost:
show_in_sitetree: false
you can find the module on Packagist and GitHub

The Text Formatting Toolbar symfony

Hiii,
I wanted to know if there are Text Formatting Toolbar for symfony to integrate into my textareas.
Someone can help or show a path.
Thanks for your help.
I guess, you are looking for something like TinyMCE.
Your question actually has nothing to deal with Symfony2 since it is client-side oriented.
Take a look at this bundle
https://github.com/genemu/GenemuFormBundle
It adds several new form fields to symfony forms, including a Tinymce form field which is what you need.

Drupal add filter through php snippet

I need to create a new filter for my view inside php snippet. Is it possible to do that using Drupal API? Can you also give me code example if possible?
Thank You,
Toliy
Your comment made much more sense ;)
What you are asking for is easily possible with Views out-of-the-box. Specifically, when you are in Views, lookk for the section called "Views arguments". To get you started there is a massive tutorial on drupal.org about them.
The path to your page will be something like:
movies/year/%
The character '%' signifies an argument

Resources