Kentico - Editable WebPartZones on children pages? - templates

I added a WebPartZone in the master page at the top pf the master page, this web part zone is a message bar that will display on all the pages but could be different on each page. Is it possible to have a web part zone in the template that is editable on each page? Or is a different way to do it?
Thanks

The short answer no. From the template engine prospective whatever editable in the master - is not editable in its children. All editable web parts/widgets editable on the master, are not editable in its children.
If you really want to have an editable text in the master and all its children, you probably need to clone and customize web part and form control it is based on. Or create you own web part.
P.S. You can have editable text in your page template so all page that use this template will have this editable text working.
If you can give more details on what kind thing you want to edit would be easier to provide an answer
P.P.S. You can have a work around but it will not be with editable text. You will have to edit message text at the form tab. Would that suits you?

You can add the webpart on your master, and use a macro to get the content, like {%CurrentDocument.GetValue("Message")%}, but you have to add a field to each page to store the message in.

Just throwing out one more option, if what you want to display changes from page type to page type, you can put a repeater on the master page, put a path of a period (current document), then use macros to set the page type to the current document class name and the transformation to currentdocument.classname+".mastermessage"
Using a macro, then add a transformation "mastermessage" to each page type it will encounter, then you can change the fields and format for each page type.

Related

Sitecore Conditional Showing of Fields

So I am rather new to sitecore, and it's a topic that wasn't covered during my training. My questions is just to help point me to the correct term, or documentation on a method to do the following.
I have a definition item, with a ton of field groups, what I want to do is something like:
if Value of Field X is "yes" then collapse/hide Field X or Field Group X.
Does that make sense? Is it a validation rule? or some other kind of rules, is it a workflow I need to attach? Do you place it on just the field I want to hide, or the field that triggers the action?
I appreciate any guidance.
There is nothing out-of-the-box in Sitecore to achieve what you want but there is no reason you cannot create a composite custom field type to do this. The following articles will help you achieve this:
Creating a custom Sitecore Field
Getting to Know Sitecore: Custom Fields, Part 1
Create a new control, inheriting either from Droplist (if the comparison of the value is to be text based) or Droplink (for comparison of ID). You could add a parameter in the Source field of the control to specify what the values that trigger the hide should be.
The underlying control in the Content Editor is just a standard HTML select element. Add onchange events to the control and add your Javascript handler to hide the other controls. Since I could not find a way of adding additional custom css classes to the Sitecore controls, it would be best/easiest to hide all other controls in the same collapsible group after you control. This would mean you would need to group your controls better (or logically at least).
The Javascript will be something like this (the Content Editor uses the Prototype JS framework):
if ($(this).getValue() == 'no') {
// find the parent container of this control and then hide all the next siblings in the same group
$(this).up('.scEditorFieldMarker').nextSiblings('.scEditorFieldMarker').invoke('hide');
}
You can test this by running the above in the console, change out the keyword this with the id of your field, e.g. $('FIELD2292054').
What I am not sure about is how to trigger the hide on initial load, i.e. when someone returns to an existing item, it may be possible by adding to one of the pipelines, but would be better using a JS solution if possible. I'll have a think about this and get a proper code sample up over the next few days.
EDIT: You can add an event handler to sc:contenteditorupdated to handle the content editor being rel-oaded.
document.observe("sc:contenteditorupdated", myFunction);
I wrote up a blog post and put the code on GitHub if you are interested.
Not sure if you have come across Andy Uzick's this blog post.
He wisely talks about hiding fields in the Content Editor and has also created a Sitecore Module called Hide Field Template Extension which is hosted on the Sitecore Marketplace with the full source code to extend.
After reading through and trying the extension, I do feel that it will not completely resolve your issue (how you have described it in the question).
But it will give you:
A mid-term solution to hide a few unnecessary field that some content editors would not like to view.
Fields that are only required by administrators for admin purpose - to de-clutter these fields could be hidden.
Just one thing to bear in mind that it mentions in the requirements Sitecore 6.5 & 6.6. I have not tested it in Sitecore 7. If you are using Sitecore 7, which I think you are, one could modify the source code and make it work for Sitecore 7.
Have a look and share your findings.
Happy Sitecoring!

Sitecore Web Forms for Marketers - Complex custom field

The client wants to be able to display, within a WFFM form, a list of Sitecore items (each item containing an image & some HTML text), each item next to a checkbox to allow the end user to pick one or more of these items.
Within the form designer, for this particular field, we would like to have an item selector which can be used by the content editor to pick and choose which items to display in the list.
Is this something feasible in WFFM? Are there examples of complex custom form fields that I could take a look at? Thanks!
I just found out that what I asked can be easily accomplished with the ChechboxList field type already provided by WFFM and some CSS styling to handle the content of each item.
Thanks and sorry for the post.

default text in mediawiki new pages

Does anyone know how to make mediawiki automatically populate a new page with some text when the edit button is clicked for the 1st time? I have tried the MediaWiki:Newarticletext page but this only affects the text that is displayed when a user visits a page that doesn't exist. I would like to provide my users the option of a pre-built template type page that doesn't require them to type in a lot of text that will be very similar on many new pages.
I don't think mediawiki templates are the way to go as they just imclude the text when the page is rendered and they don't provide the text for the user to customise.
thanks
Have you tried MultiBoilerplate? You can se this to load default pages - and you can create multiple default. The only problem is that it won't load when you create the page but just after (you need to press Load).

sitecore: webforms for marketers, one form, two pages

I want to use single form for several pages like a block. Sitecore always creates a new form for a page.
How to share/reuse a form?
Depends on weather you are using WFFM 1 or 2 but it is quite similar.
Go to "Presentation/Layout details" for the item (page) that holds the form. You will find a rendering called "Form Interpreter" click this.
If you are using WFFM2 there is a "FormID" field that has your form selected. Just add a similar rendering to every page that you want the form to appear in and select the same form.
For WFFM1 there would be a parameter called "FormID" and a sitecore ID, copy this ID and the same renderings to the other pages including the parameters.
Good luck, Larre
There's an option to select a form to copy from. See paragraph 2.3.1 "Copying an Existing Form in the Page Editor" of this guide.
I had same issue with WFFM MVC version 8.1 (initial release)
our content editors wanted to use experience editor(page editor) and didn't want to change the datasource by going to presentation details and updating the datasource.
It doesn't need any coding
1- Copy /sitecore/layout/Renderings/Modules/Web Forms for Marketers/Mvc Form and give it a name "Custom Form"
2- Set the Data source location
3- Add the new rendering to place holder settings
/sitecore/layout/Placeholder Settings/content
my blog post
http://azadehkhojandi.blogspot.com.au/2016/01/how-to-reuse-web-forms-for-marketers.html

What is the best UI for selecting tags from a list of existing tags?

I am using django-tagging. My model simply contains a field with a comma separated list of tags. I would like the user to be able to select tags from a list of already existing tags and also allow the user to add tags. Still resulting a comma-separated list of tags. How would I do that?
A pull down list doesn't work. I was thinking about simply listing all tags beneath the tag field and when a user clicks on an existing tag this is added to the tag field with a bit of javascript.
Other ideas are very welcome.
If you can use jquery there are several plugins to handle this and save you the JS coding:
Tag Suggest which can handle comma delimited tag lists and Autocomplete which also has the advantage of being used by Jannis Leidel's excellent autocomplete form widget for ForeignKey model fields
Having a separate complete list is a good start. I would also suggest an autocomplete implementation while the user is typing a tag name into the box. This helps eliminate the problem of having Batman and Bat-man and Bat Man as three separate tags.
I think your proposal of showing all tags and allowing the user to select them individually is a sound approach. Delicious.com uses this exact interface and it works wonderfully.
How about implementing it the same way Stack Overflow does for the ignored and interesting tags on the front page? Wait for the user to start typing, and as they do, fire off AJAX requests to the server and start returning the five most likely results, which you can then display in a hovering white box below the text box.