I tried to create a customized theme form symfony_3 form.
path: app/Resources/views/form
And I set the form as current theme
$view['form']->setTheme($form, array('app/Resources/views/form'));?>
But that does not work and the system calls the default symfony form theme. How can I fix that?
you could try define the form theming globaly in your config.yml as explained in this doc or locally like this other doc:
Hope it helps
Related
How do I change the text on the Remove (the one assigned class 'has_many_remove') button on an active admin f.has_many stanza from 'Remove' to 'Hide'? Only for the current page/model and not site-wide.
I confirmed this feature is missing from Active Admin, see the discussion in the issues section of the Active Admin github repo: https://github.com/activeadmin/activeadmin/issues/5283
For application-wide change, you just need to add the following inside config/locales/en.yml:
en:
active_admin:
has_many_remove: "Hide"
But for page-specific change, you need some help from JS.
p.s. I can update the answer with js solution if you can provide your specific needs.
I have been using ng-tagsinput from benford -> http://mbenford.github.io/ngTagsInput/
I am trying to add tooltips for tags added in input field. This tooltip should show contents of the tag. Can anyone help me to add tooltips for the tag?
Any help is appreciated.
Thank you,
I have made little changes in latest file of ng-tags-input.js and ng-tags-input.min.js that will solve your requirement of tool tip.
I have added ng-attr-title={{$getDisplayText()}} at ngTagsInput/tag-item.html template section in js file. by simply adding title attribute to the span tag will work. This change made for you, but #mbenford the creator of this library may add this as an feature.
You can download the file from below links. and you can see the tooltip on tags :)
https://ufile.io/k5v8w - min js
https://ufile.io/sntbh - unminified js
This is a very old question but a template approach is better. Just use the "template" attribute and add tooltip to your template. Details here:
http://mbenford.github.io/ngTagsInput/documentation/guides/custom-templates
How can I customize the template of my field plugin? how to apply bootstrap classes to it?
Where can I get the default template of a f:field (for example) to customize it ?
Thank you
You can check documentation of grails field plugin, I think is very clear Grails Field Plugin Custimization Page
In resume, you have to create gsp file templates, for the diferent fields, it can be done by varios options for example property type, propery name, controller, action, etc. In those template files you can apply the bootstrap clases you want to use.
I've created a theme and applied it to my ASP.NET MVC site. However, the elements on the page aren't picking up the styles automatically. If I do the following for a specific element they get applied appropriately:
$("input[type=button]").button();
$("input[type=submit]").button();
Am I right in thinking I need to do this for all the different elements? Perhaps incorrectly, I assumed this would be done automatically by referencing the css and custom js files?
Thanks
you can write :submit instead of input[type=submit], but I know that's no the answer of your question.
The jQuery UI library only provides code to style your website, but it doesn't do it automatically. So what you need to do is something like this:
$(":submit, :button, :reset").button();
But sometimes you want to use icons or something like this, then you can use
$("#specificButton").button("option", "...", "...");
I hope it helps!
I am using SF 1.2.9 (with Propel ORM), to build a website. I have generated admin modules for some of my models. I want to modify the template used to display the Form because there are some fields that I dont want to display (but need) - example the 'slug' field in a form.
Since the templates are autogenerated, I cant make the changes there. How can I specify a template to use for rendering a form in the new/edit view?
In general, to override generated templates with your own, you just have to name your template same as generated one.
But looks like you do not need it. Hint: you can choose which fields to show in admin generator. Please consult symfony reference manual to realize how
To hide or remove fields from a form, I think you should check that link.
To sum up, the admin generator uses a ORM sfForm to render the edit action. So if you remove fields:
// lib/form/doctrine/ADoctrineClassForm.class.php
class ADoctrineClass extends BaseADoctrineClass
{
public function configure()
{
...
unset($this['field_name']
...
You can also change the widget used the render the field by redefining which widget to use:
//in ADoctrineClass configure method also
$this->widgetSchema['a_field_a_want_to_hide'] = new sfWidgetFormInputHidden()
I hope this helps.