How do I change the template of the Mailchimp Wordpress widget? - templates

I want to change how the form looks like and the labels on the fields of the form.

Login in as Admin and then, under the Plugins area in the sidebar, click Editor. There's a dropdown menu labeled "Select plugin to edit". Click that and select "MailChimp" and then click the "Select" button. The sidebar widget form is called mailchimp/mailchimp_widget.php
The form's code begins right after the first PHP block.
You can also edit the code directly by looking in the wordpress/wp-content/plugins/mailchimp/ directory. The translations are in the po sub-directory.
The trick with this template is that the fields are loaded from elsewhere. In order to change the label, you have to set the option of the fields in the PHP code. Each field is looped through and printed out automatically.
For example to change the "Email Address" label to read "Email" add the following code at the end of the first PHP block:
$mv[0]['name'] = 'Email';
This assumes that the first field that will be printed out is the Email Address field. You can do a var_dump to see what other options are available.
If you want to make more drastic changes to the form, remember that when the widget is updated, you'll have to make the changes again and merge them with the updated version.

Related

Can one of the fields in a Drupal webform be Wysiwyg HTML field?

I want to have a field in a Drupal Webform where users can input some formatted HTML (tables, headers, etc.) Is there a way to do that?
Yes.
The form element is called "Text format." This sounds like a format selector of some kind, but it's actually a text element. If you set it to "Basic HTML," for example, the CKEditor WYSYWIG loads.
The image below is an example (the 'field' labeled Notes/URL(s)). If users wish to enter HTML directly, the code view button in the toolbar allows for that.
Here's what the initial page of the webform config looks like for this element...

How to remove required validation from WFFM hidden required fields in sitecore?

I am working on WFFM Sitecore.
I have one droplist "Title" with option of
Mr
Miss
other title
And one required text-box called Other.
The text-box is hidden on page load and it will be shown only when the user selects the other title option from droplist.
If we are selecting Mr or Miss then the Other text-box is hidden but it is still a Required field. When we submit the form it triggers the required field validation of the hidden Other text box .
How can I remove the required fields that are hidden on WFFM save action.
You will need to remove the "Required" flag from the field in the WFFM editor, and then add some custom JS validation that checks the Title field and if its set to Other Title, validate that the text box has been populated.
You can't do that in WFFM without custom JavaScript.
You would also want to make sure that your server code validates this again to protect against someone trying to bypass the JS validation.

Where do I set fields that can be edited in Sitecore editor options?

Where in sitecore do I configure what fields are displayed when I click this button? (Currently, it lists 3 of the 7 fields that are on the template, I'd like to add another to be editable).
Screenshot
It is one of Edit Frame buttons. When you open your control markup, you see something like this:
<sc:EditFrame ID="editFrame" runat="server" Buttons="/sitecore/content/Applications/WebEdit/Edit Frame Buttons/Default">
...
</sc:EditFrame>
It differs for MVC, but is similar. You need to get Buttons attribute value.
When you open /sitecore/content/Applications/WebEdit/Edit Frame Buttons/Default path in core database you see list of children. It is your buttons. For your case it should be only one button: Edit Item. This item has Fields field where using pipe as delimiter is list of fields that are available for editing.

Make Django form results editable

I have a form which users fill and all the results are displayed on another page as a table. How can I make the results editable in that page (table)? If you want to edit some row you can press something like an edit button which will make the row change the values from text to their respective widgets as in the form, so you can edit it yourself.
Try django-jeditable which uses jEditable jQuery plugin.

Sitecore: Hide data template field from page editor

I have 2 data template fields "title" and "id", used for the HTML page title and the id attribute in the body tag respectively. When the page is viewed using Page Editor, Sitecore attempts to render editor controls on these items and because they are outside of the main form tag, controls don't get rendered correctly. I don't need these to be editable in the Page Editor.
What's the best approach/solution to handle fields like these?
Is hiding these 2 template fields from the Page Editor a solution?
If so, how do you hide the fields from the Page Editor and still have it available on the Content editor (so we can still edit it within the Content editor)?
In Page Editor, all you should need to do is render their values without a FieldRenderer. e.g, bind the field values to a standard .NET control. Or use a scriptlet -- <%=Sitecore.Context.Item["Title"]%>