We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [sitecore-api]

For questions related to Sitecore's API, covering questions about how to access, create, update or or delete data, as well as questions about how the Sitecore code-base is or can be used for custom or native logic, etc.

Filter by
Sorted by
Tagged with
8
votes
1answer
242 views

Item statistic “CreatedBy” returning empty string

Im trying to get the creator of an item, but when I access the CreatedBy property, it returns an empty string. When I debugged I could see the all the other fields were populated, but not the ...
2
votes
2answers
417 views

Setting up dynamic content

I have a list of "modules" that I want to load depending on what template the current item is based on. This selection needs to be overridable. So I created a module loader component that has a ...
2
votes
1answer
2k views

How to add Parameters to Sitecore Page url

My Question is How we can add parameters to a Sitecore URL. any help is appreciated example: example.com/insights/blogs/?category=Skaitmeninė%20transformacija
1
vote
1answer
797 views

Creating Media Items using the RESTful ItemService API

Quick background, re-building a "product importer" exe that was written for v7 using the old web API and ideally want to replicate all the old logic to work in the new v8 site using the RESTful ...
2
votes
1answer
55 views

Password recovery Htmlcontent is not working properly

We have customized passwordrecovery pipeline. In the password recovery email, we are not getting the html content, instead we are getting the tags itself. Sample mail content we recieved: Below is ...
2
votes
1answer
411 views

Sitecore search for multiple children with same name and path

I have a "NewsItems" node in sitecore with multiple "News" children nodes with same name, same display name and same item path, only body content of each news item is different. I am displaying all ...
0
votes
1answer
224 views

Custom HTML handler [closed]

I created a custom handler to handle 301 redirect for .html extensions which is working fine. But now my client also wants to serve static html files too. When I deploy those html files into our ...
3
votes
2answers
307 views

Sitecore Tagging

We have requirement where if a Content Item is Tagged with “Espresso” and “Cappuccino” then this content Item will automatically be populated in the page when searched for both types of tags “...
1
vote
1answer
533 views

Using Sitecore PowerShell Extensions to Copy Layout Details from One Device to Another

My website is using the App Center Placeholder device on all of the pages. I would like to use Sitecore PowerShell Extensions (SPE) to deprecate the App Center Placeholder device and move all the ...
5
votes
2answers
393 views

How does one access a Security field programmatically?

Back in Sitecore 5 there used to be a class, Sitecore.SecurityModel.SecurityField. Seems like this class was removed in later versions. So, how does one access a Security field on an item now? ...
0
votes
1answer
394 views

Create users from API

We are trying to build a stand-alone API, which has to meet this requirement. The API gets inputs for "Name" & "Email" and should then create user in any chosen Sitecore instance. As this is a ...
2
votes
1answer
478 views

Best way to Use Sitecore Data for other Application?

I need to create the separate ASP.NET Web API 2 Application for the Native mobiles Apps (Andriod and IOS), that will consume the Sitecore web application data. Currently it’s on the same solution and ...
0
votes
2answers
4k views

Using Sitecore().Field() helper

I have a page in sitecore called SingleField.cshtml. It only has a 1 field from the content item that it's associated to. @Html.Sitecore().Field("Title") What I am searching for is how to ...
4
votes
3answers
1k views

Sitecore Item - Generated HTML

One of client wants to send email using standard .NET SMTP client. I would like to know How I can generate HTML of my Sitecore item which has all layouts and renderings configured and assigned that ...
4
votes
2answers
2k views

How do I get an Item from Sitecore's internal URI protocol?

I have a reference to an item that uses the sitecore: protocol: "sitecore://master/{...GUID HERE...}?lang=en&ver=0" I could attempt to parse this URI manually to look up the item, but I'm pretty ...
9
votes
2answers
5k views

How to get the our local date and time from the sitecore datetime field(raw value format - yyymmddThhmmssZ)?

I have set the date in the sitecore item for some datetime field as below. And its getting saved as below format in the master/web database. 20170401T073000Z When I try to get that value using the ...
3
votes
2answers
2k views

Create an item with a specific ID and Branch

I found an article showing how to create an item using a branch. https://briancaos.wordpress.com/2009/12/01/creating-items-from-branches-in-sitecore/ I found another article showing how to create an ...
2
votes
4answers
2k views

Accessing Tracker.Current.Contact in ApiController

I have a scenario in which I want to return some facet data associated with an xDB contact via an ApiController. However, when i try to access the Tracker.Current.Contact property it is null. What ...
2
votes
1answer
494 views

Item.Versions.AddVersion() - fields not being saved

I am adding a new version of an item in a different language. This works fine. Them I am setting the field values on the new version, but those values are not saved. The code is basically (simplified):...
3
votes
2answers
570 views

“Silently” Create Item - Create Item Without Triggering Indexing or other Events

I know that when I edit items, I can pass true to the EndEdit method to save the item without triggering events/indexing on save. Since I almost always want to edit an item after creating it, it seems ...
9
votes
3answers
4k views

What is the best way to bulk-create items programmatically? [closed]

What is the best way to create many items in bulk under a certain item, using code? What are the things to consider in such scenarios? What are the pros and cons?
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 ...
11
votes
1answer
257 views

How can I write my own custom disabler?

Sitecore ships with a bunch of disablers, like the SecurityDisabler and the EventsDisabler, but what if I want to write my own? I have a bunch of item:saved event handlers that run but when I add a ...
9
votes
1answer
135 views

Field StandardValue vs DefaultValue vs FallbackValue vs InheritValue vs InnerValue

The parameters of the GetValue methods of the Sitecore.Data.Fields.Field class enable developers to restrict the origin of the returned value to the Fields: StandardValue DefaultValue FallbackValue ...