Questions tagged [templates]

Questions about working with Sitecore templates - base templates, data templates, field sources, ...

Filter by
Sorted by
Tagged with
26
votes
4answers
4k views

How to change item templates and retain existing data

We are refactoring our project and are trying to clean up the usages of templates throughout the project. There are a number of templates that are very similar that could all be using the same data ...
13
votes
2answers
2k views

How to remove a language version of a data template?

I created German versions of several data templates by accident. For regular items, there's an option to remove a version at tab "Versions" –> section "Versions": For templates, though, the whole "...
11
votes
3answers
489 views

How to delete data templates?

I am trying to delete a large number of data templates - an entire section. However I have some content items that use those data templates and also there seems to be a lot of template inheritance ...
11
votes
2answers
2k views

How to apply Site specific workflow in Sitecore?

I have problem at hand for which I'm confused about what is the best practice for going after it. I have thought to intercept item creation process in Sitecore and read the site node properties. This ...
10
votes
5answers
4k views

What is the difference between default value of a template and it's standard value in Sitecore?

Default value is ABC, standard value $name. I only get ABC for the item added in the content tree. May be my standard values are corrupt and need to reset. But what is the difference between these 2?...
10
votes
1answer
1k views

SXA Page Design vs Page Standard Values vs Page Branch Template

Sitecore historically had two options for building reusable page design: Page Standard Values Branch Template Both these options allow to build composition of visual components and later build pages ...
10
votes
1answer
1k views

Restrict Item by Base Template on a Field IncludeTemplatesForSelection

Out of the box it is possible to restrict items in a fields data source by its base template type. I can specify a filter as follows that restricts to items of type Employee... DataSource=/sitecore/...
9
votes
4answers
2k views

What happens if the same field name is used in two separate inherited data templates?

Given that a data template can inherit from other data templates, what happens if the same field name is used in two separate inherited data templates?
9
votes
0answers
3k views

Droplink source query breaks with templateid or templatename

I have a few fields in a template, and two of them have template name restrictions. Using the restriction, I get 0 results, and when removed I get all the items I want (plus others I don't) With ...
8
votes
2answers
2k views

what will happen when a field is marked as both Shared and Unversioned

If I check both shared and unversioned checkboxes in a template, what will happen? I knew difference between shared and unversioned. Want to know final result of checking both field in template.
8
votes
1answer
1k views

Setting up a source using ID and limiting the items you can select. is it possible?

I'm building a template and I want to limit the items the authors can select on a TreeListEx field. I know this can be done specifying the datasource as posted here Like setting the value on the ...
8
votes
2answers
6k views

Get all items where a certain template appears in its template inheritance

Is there a way to get all items where a certain template appears in its template inheritance? Say I want to get all items where /sitecore/Templates/Common/Sections/Search appears in that inheritance ...
8
votes
2answers
399 views

Sitecore Data Exchange Framework Branch Template Issue Template is invalid

I am working on importing the data from file system provider into Sitecore using Data Exchange framework.While adding the content using regular template in sitecore, the items are imported fine.But I ...
7
votes
3answers
515 views

Is it okay to add fields to Standard Template or add Base Templates to it?

I would like to add a field to all of my templates. The easiest approach appears to be to either Add the field directly to Standard Templates (/sitecore/templates/System/Templates/Standard template) ...
7
votes
3answers
1k views

Override the source of a template field

If I have a template that is inheriting a field from a base template, Is there any way to override the source of that field?
7
votes
2answers
996 views

Template standard values final layout

Which purposes can be reached by using final layout in template standard values? What are advantages and disadvantages to use final layout in template standard values?
7
votes
1answer
3k views

When to use Number vs Integer field type

I can't seem to find any guidance (official or otherwise) on when to use the Number field type vs the Integer field type. What are the main differences that I should be considerate of? Sitecore 8.0
6
votes
2answers
2k views

Deleting an Item with a null Template

Thru a series of unfortunate events (most likely missing a template in a package between servers/instances) I found myself having issues inserting links thru the General Link field. Tracked it down ...
6
votes
1answer
1k views

TemplateManager.GetTemplates always returning null

Got the following call: var templatePath = "/User Defined/Project/Common/Content Types/Links"; var template = TemplateManager.GetTemplate(templatePath, Context.Database); This is always returning ...
6
votes
2answers
1k views

Field level Validation Rule => “OnSave”?

I need an 8 characters length enforcing validator. I created a MaxLength=8 and combined it with a MinLength=8 validation rule. Then I enter "1234567890123' and it's saving, no question asked! It ...
6
votes
1answer
1k views

Best way to add rendering in base template and inherit

We are 80% from the completion of the project. And noticed that we need to create a couple of renderings that must exist on all pages. I thought the best place to do this would be presentation ...
6
votes
2answers
324 views

Data loss after changing template fields to shared

I am facing data loss in our Testing server after making some template fields Shared. However, in my development machine, I still have all the values for those Shared fields which I have lost in the ...
5
votes
2answers
377 views

Sitecore populating date field with yesterday's date via $date token

I have a date field in one of my templates who's default value is $date. When I create an item using that template, the raw value is 20190522Z, but when I view it not raw I see it as yesterday's date ...
5
votes
1answer
620 views

Multiple templates sections with same name

What will happen if there are multiple field section with same name? Its a general question, and I thought if there are multiple Field Sections, the Content Editor will get confused while changing ...
5
votes
2answers
446 views

Force template versions in English

In a multi-language solution, the developers switch back and forth between multiple languages when creating content, testing, etc. If the developer forgets to change the context language to English, ...
5
votes
2answers
609 views

Templates and Rich Text Editor properties

I have a field called "description" but I want to use different Rich Text editors with it. Can I do this with the same template, or do I have to make different templates with the same field name?
5
votes
1answer
3k views

Inheritance between templates

My question is the same as previously asked here with no answer. We have a bunch of page templates with same header/footer, etc. The idea was to create a base template which would contain all of the ...
5
votes
1answer
549 views

Helix and field sources

In a feature for an event I have 2 templates: Speaker and Session. A session has a speaker, so in the session template we have a field to select a speaker. As project templates, I also created ...
4
votes
2answers
1k views

Sitecore General Link linking to itself (internal item) by default

Every BasePage template I have has a general link field that needs its value to be set to itself by default, with the ability to change it. Is there anyway to do this on the standard values of the ...
4
votes
2answers
670 views

'$name' able to set default value for already existing related page Item

Scenario: I have a template (say A), and having 50 page items already exist related to template type A. Objective: Now have a requirement to add one more field for template A with default value '$...
4
votes
1answer
343 views

How to setup child templates by default

I'm trying to see if I can setup child templates, on a given parent template, that would show up every time the parent template is used to create an item. I tried adding the child templates to the ...
4
votes
1answer
324 views

Can I modify Standard Values variables, such as $name, to be all lowercase?

The use-case for this situation is that I want to use the $name of the item to populate a text field for CSS class. Example: bg-$name Since this is for a CSS class, I want it to be lowercase, but ...
4
votes
2answers
678 views

How to edit the insert options for existing content using that template?

I'm VERY new to Sitecore so forgive me, if this question doesn't make any sense. I've added an insert option to the __StandardValues of a template. I expect the content using this template to have ...
4
votes
1answer
117 views

Different Field source for different Language

Is it possible to assign different field source for the different language? For example, I have a sample template in with samplefield. samplefield has a field source as /sitecore/content/Home-en ...
4
votes
1answer
125 views

Reversed Insert Options

Has anyone implemented a feature like Reversed Insert Options? Meaning a template should know where it should be added as an Insert Option rather than what it can add?
4
votes
0answers
89 views

Is it possible to inherit insert options from multiple base templates?

I'm trying to inherit insert options from two templates. I created a template item and set both of the templates as base templates in the Data section. However, only the first base templates insert ...
4
votes
1answer
198 views

Multiple queries for a droplink - removing duplicates

So, I have multiple organizations content on my site, they are all grouped into a regional content area, and I also have a global content area. One of my templates looks into a folder that has a ...
4
votes
1answer
764 views

Creating Glassmapper Models Programmatically with Standard Values

Is there no standard way to incorporate/ consider a template's standard values when creating a Glassmapper model programmatically? This is all I can find online, but it seems that you have to rename ...
3
votes
2answers
285 views

Template inheritance - how to resolve duplicate usage

Some time ago my team and I decided to break out some often-used fields into components that can be inherited, a Heading field being one of them. We put the Heading field into it's own template and ...
3
votes
1answer
222 views

Field names in content editor are wrong (multiple colons and no capitalisation) but fine in VS

I have a situation where I have a template and thus content items of that template whereby the field names seem to have problems in the content editor but not in visual studio. Notice below that ...
3
votes
1answer
55 views

Can you prepopulate an image field with an existing image?

It seems like you can do this via the Default Value item in the field properties but when I add the path to the image I want, and then create an item with that template, it doesn't show that image. ...
3
votes
2answers
375 views

what is the best way to have multivalue fields in template?

I've a template name "teacher". Teacher template has following fields : - Name - Designation - DateOfJoin - Social Where social field should capture following data: - Type (FB/Twitter/Instagram) - ...
3
votes
1answer
247 views

How can I merge field sections across templates in Sitecore

Let's say I have a template, Template A, that has a field section, Foo Data, that contains some fields. If I create another template, Template B, that inherits Template A and add a new field, "Bar", ...
3
votes
1answer
132 views

Enabling Item Language Fallback for SXA component datasources

In our Sitecore instance we have a number of different languages, and we have enabled item level language fallback. We have enabled item level fallback on all of our page templates, and this works as ...
3
votes
1answer
303 views

How to make a empty field behave like a null field value when it comes to standard values?

By default, standard values are only applied to a template field if its value is null. I heard during the Sitecore Developer Foundation training that we can configure it so that an empty field would ...
3
votes
1answer
376 views

Replace or Update Base Template of a Template

I am trying to remove a base template if found and add a different base template if not found. In the code below the standard template is never found even though I know its there. Is it because I'm ...
3
votes
1answer
373 views

How to enable role selection within a template field

Is there a way to define a template field where a user can select a Sitecore role from a dropdown? I noticed that in Sitecore 8.2 under the Developer Types section there is a Sitecore User field type, ...
3
votes
1answer
616 views

Getting insert options even though item is configured to have none

I'm working on a clients site and I am currently facing a weird behavior, when right clicking items on the item tree to add a new child item, I am getting options to insert items of different template ...
3
votes
2answers
109 views

How can I determine when a shared/unshared background process has finished?

In Sitecore (I'm specifically working with version 7.5 right now, but I believe this applies to other versions), when you mark a field as shared or unshared, you receive a popup that a lengthy ...
3
votes
1answer
187 views

Sitecore Solution Documentation Generation - any tools?

Having had to deliver/create documentation on numerous projects now, I know it is the last thing that anyone wants to do manually in Word. I happened to see this tool mentioned: https://zkniebel....