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

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.

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...

Show preview of image in form

I want to achieve the following in a django form, for a models.ImageField:
do not show the standard <input type="file"> button ("choose file" button)
show a preview of the current image, for already populated models
for empty (new) models, show a custom button
clicking on the image preview or the custom button will open a file dialog to select the image from the user's file system
selecting a new image replaces the custom button or the old image preview with the preview of the new image
This seems to me like a normal workflow to select images in a form, but I do not seem to find any fully working solution. All I can find involves hacking around several parts:
styling the label and hiding the standard "choose file" button: https://www.youtube.com/watch?v=4p2gTDZKS9Y
use a widget instead of the standard for forms.FileField.
I have tried to use:
class ImagePreviewWidget(Widget):
def render(self, name, value, attrs=None):
return mark_safe('<img src="/media/%s" width="100px"/>' % escape(value))
For the widget, and I am using this in the form like this:
class DesignCampaignForm(ModelForm):
brand_logo = FileField(widget=ImagePreviewWidget)
This is properly showing the preview of the existing image, but I am unable to click on it to select another file, and even if I was that would not update the preview.
Is there an already available solution for this simple use case?
I haven't been able to find a complete solution, so I have done the following:
use a widget to render a modified ClearableFileInput, rendering an image and an <input> element
style the <input> in the element with CSS, to hide it
make sure that clicking in the image triggers the hidden <input> element, wrapping the <img> in a <label> and using the for attribute
add some javascript to replace the image preview whenever the selection in the <input> element changes
whenever the selection is cleared, show the original preview
A gist can be found here.
In my final solution (not yet in the gist), I have added a button for when the image is not yet selected.
edit: Gist only works for Django before version 1.11.x.
class ClearableFileInput has since been gutted and changed

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"]%>

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

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.