24
votes
Accepted
How to change item templates and retain existing data
You can do this with Sitecore PowerShell Extensions.
PowerShell Extensions 4.5 or Higher
Use the Set-ItemTemplate commandlet with the -FieldsToCopy parameter.
$rootItem = Get-Item master:/content;
$...
22
votes
Accepted
Deleting an Item with a null Template
A safer method would be to use the DbBrowser. You can find this by going to <yoursiteurl>/sitecore/admin/dbbrowser.aspx. You will get a screen where the content tree loads up on the left and you ...
18
votes
How to change item templates and retain existing data
You can rename Title2 to match name of Title1 and then simply change the template.
Sitecore will preserve data if the names of the fields match.
Template A
Title1 Single-Line Text
SubText1 ...
18
votes
Accepted
How to delete data templates?
This seems like a perfect taks for Sitecore Powershell Extensions
First of all I would get a list of template IDs to remove
$templateIds = Get-ChildItem /sitecore/templates/you/better/know/where/to/...
17
votes
Accepted
SXA Page Design vs Page Standard Values vs Page Branch Template
With Sitecore Experience Accelerator you can forget about previous methods, however, there is nothing that will block you from using them.
Before - NO SXA:
you had to decide how your page will look ...
17
votes
Accepted
How to remove a language version of a data template?
Sitecore doesn't expose the version manager [you've shown] on templates. However, you can use the DB Browser (~/sitecore/admin/dbbrowser.aspx) and manage items, templates, etc. that way. Simply point ...
16
votes
what will happen when a field is marked as both Shared and Unversioned
In reality, you have only 3 options. However the combination of checkboxes gives you 4.
The Answer
A versioned field (default)
This acts like one would expect. The field can have multiple values and ...
14
votes
Accepted
How to apply Site specific workflow in Sitecore?
If the workflows are not drastically different, you can achieve 'site-specific' workflow via content security.
Step 1: Workflow security
Create a single workflow definition with some generic access ...
12
votes
Accepted
What happens if the same field name is used in two separate inherited data templates?
Sitecore stores fields for templates as individual Items. As they are Items, they have a unique ID that can identify them. When Sitecore stores the values of fields for an item (most commonly in the ...
11
votes
Accepted
Setting up a source using ID and limiting the items you can select. is it possible?
You can use the ID instead of the path in your initial source:
DataSource={C46A-4...CE}&ExcludeTemplatesForSelection=Bar
11
votes
Accepted
TemplateManager.GetTemplates always returning null
Yea. Change your code to this:
var templatePath = "User Defined/Project/Common/Content Types/Links";
var template = TemplateManager.GetTemplate(templatePath, Context.Database);
If your path starts ...
11
votes
Accepted
What is the difference between default value of a template and it's standard value in Sitecore?
From my understanding
Default Value
In the definition item for each data template field, you can specify a value for the Default value property. When a user creates an item, Sitecore copies the ...
10
votes
Accepted
Is it okay to add fields to Standard Template or add Base Templates to it?
Whenever I do this, I create a new template that I inherit. If wanted to add a new field called widget, I would create a new _template called _widgetdata (notice the _ to dictate the fact that this ...
9
votes
Accepted
Field names in content editor are wrong (multiple colons and no capitalisation) but fine in VS
It sounds like you have a matching item in /sitecore/System/Dictionary/.
I did a quick test by adding a Dictionary item that matches the name of a field and the Content Editor picks it up.
9
votes
Multiple templates sections with same name
Template field sections are for grouping purposes only. It doesn't matter if there are multiple sections with the same name. If there are multiple sections with the same name, Sitecore will display ...
9
votes
What is the difference between default value of a template and it's standard value in Sitecore?
It is a quite interesting question. I've never thought about it. I fully agree with previous answer except using tokens. Tokens can be used in the Default Value as well as in the Standard Value. I ...
9
votes
Accepted
When to use Number vs Integer field type
The main difference is, one stores an Integer and one stores any number, e.g. 12.50.
There are a couple of caveats.
The decimal separator is different between countries. And Sitecore's default input ...
9
votes
Accepted
Template inheritance - how to resolve duplicate usage
A solid option is to build components that have a data source item rather than relying purely on fields defined on the page.
Here's a scenario to help explain what I mean:
Let's say you need to ...
8
votes
Accepted
How to use a Helix feature for multiple sites with specific template source settings per site?
You're going about it wrong. Or - I should say - not in accordance with Helix principles.
First and foremost, your idea of a common base template to be used on all websites is not recommended ...
7
votes
Accepted
Best way to add rendering in base template and inherit
If you have not already used a base template with presentation, this will be tricky. Normally I would have a base page template with some core presentation elements and then all other page templates ...
7
votes
Standard values on base templates
Standard values are default field values used as fallback, if the item does not have a field value defined. If your item has a field value (even an empty field value), the standard value is ignored. ...
7
votes
Accepted
Get all items where a certain template appears in its template inheritance
Sitecore PowerShell Extensions
At first your question made me think of this where the user wants to find media items of a certain length. I encourage you to check that out to see some different ways ...
7
votes
Accepted
Can you prepopulate an image field with an existing image?
This is what Standard Values are for. You can set the value of the field on the __Standard Values item underneath the template of the item you're creating (or a base template, if you prefer):
If the ...
7
votes
Accepted
Sitecore populating date field with yesterday's date via $date token
The difference between $date and $now is contained within the Sitecore.Data.ReplaceValues method:
protected virtual string ReplaceValues(string text, Func<string> defaultName, Func<string>...
7
votes
Sitecore populating date field with yesterday's date via $date token
Based on @jraps research, this is what I believe is happening:
$date is taking the current UTC date and storing that in the DB - if you are in UTC-4 and you create the date when the UTC date has ...
7
votes
Accepted
Changing the display name of field in the template does not reflect the name at item level
Your understanding is not correct.
It is indeed the Title field which is displayed above the Field in the Content Editor. By default, this is set to the Field’s name, but you may change the value if ...
6
votes
Accepted
Force template versions in English
In a clean install of Sitecore 8.1 update-3, the templates and their related sections/fields are always created in English, no matter what language the user may be working in from the ribbon:
But if ...
6
votes
Accepted
Override the source of a template field
Branching off of @SzymonKuzniak's answer, the simple answer is "no" but the complex answer is "yes, with some trickery, by tapping into the getLookupSourceItems pipeline."
In order to minimize ...
6
votes
How to remove a language version of a data template?
Another way to do this is using Sitecore Powershell Extenstions. There is a cmdlet called Remove-ItemLanguage, this removes the specified language version from the item.
Example that removes the ...
6
votes
Sitecore General Link linking to itself (internal item) by default
Try putting the below in the standard value's raw values:
<link text="link text" linktype="internal" class="" title=""
target="" querystring="" id="$id" anchor="" />
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
templates × 132content-editor × 15
presentation × 14
sxa × 12
inheritance × 8
fieldtype × 7
best-practices × 6
experience-editor × 5
powershell-extensions × 5
datasource × 5
branch × 5
mvc × 4
multilingual × 4
sitecore-query × 4
components × 4
jss × 3
sitecore-api × 3
media-library × 3
helix × 3
content-management × 3
field × 3
sitecore-commerce × 2
glass-mapper × 2
tds × 2
powershell × 2