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
2
votes
1answer
791 views

Error: “Invalid URI: The format of the URI could not be determined.”

After Installing Sitecore 9 XP1 I am getting this error while "Invalid URI: The format of the URI could not be determined". The XP1 installation was properly done without any error and I am able to ...
6
votes
2answers
1k views

Get Items by template id in a scheduled task

Scenario: I have over 10,000 items in my sitecore/content tree. Nearly 2,000 of them are thrived from the Article template. Inside of the Article items, there are two important fields: Is Featured - ...
1
vote
2answers
315 views

Cannot get current item from custom GetAllowedRenderings pipelines processor

I am writing a custom GetAllowedRenderings processor, but I cannot see how to obtain the current item that I'm editing in the experience editor. There doesn't seem to be a property on the ...
0
votes
2answers
560 views

How to create lucene indexes seperate for each template and map fieldNames under each template

I am creating lucene indexes using Sitecore 7.2 and I have Title field name common in Article's template as well as Author's template. Is there any way to write separate field mapping as per ...
0
votes
1answer
577 views

Can I use Sitecore Item Web API to insert items into bucket list from different application

I am in the need to expose a restful api which eventually will insert items to bucket list available in sitecore. This api will be cosnumed by another MVC application to push records into sitecore ...
3
votes
1answer
320 views

Change WFFM file upload button text

I created a WFFM form with File upload field to upload the files and using it in russian website. But the file upload button text and placeholder are displaying in English and I did not find any ...
1
vote
1answer
637 views

How to rebuild Lucene Index using API?

We have to rebuild Lucene index on our CD server. Is there any Sitecore API to rebuild Lucene index? or rebuild a portion of tree items?
0
votes
2answers
240 views

How to edit/create the Sitecore item on behalf of the specific user using Sitecore API?

We are creating and updating items in the sitecore tree, we are using SecurityDisabler to perform the operation. The system considers the operation is performed by an anonymous user but we need to ...
5
votes
1answer
666 views

How to invoke Workflow on the particular item using Sitecore API?

We have the list of items in the Sitecore tree and all the items will be in a workflow. we are updating these items programmatically and based on some condition, we have to assign the state of the ...
0
votes
2answers
138 views

Getting Null exception in Crawling Page Component DataSource on Lucene Index

We are using Lucene Index for our site search, our objective is to add all the content which is associated with Page Item. Here we have added Two custom index field for 1) "PageContent" and 2 )"...
2
votes
1answer
511 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):...
2
votes
1answer
409 views

Service based architecture in sitecore

I am analysing on the possibility of creating a web application using Sitecore where the web application is pure thin client using js based framework (knockout or angular) which can consume the ...
5
votes
1answer
831 views

Get List of Contacts in a ListManager and associate one more contact to it

I have a requirement to get Contact data from a Registration page and save that data into a List Manager in Sitecore. I followed the below approach. //Create ListManager Object var listManager = (...
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
274 views

Send mail is not encoding HTML properly

I am trying to send mail in Sitecore using Sitecore.MainUtil.SendMail(message). I have made message.IsBodyHtml = true. I debugged the code and found that in the body of message the string is encoded (...
4
votes
1answer
209 views

Sitecore's Publishing setting vs. a Custom field

I'm using Sitecore 8.2 - update 2. Scenario: I like to list all of the articles sorted by a Publish Date. Which is the best practice/approach? Sitecore's Publishing Setting: Use Sitecore's OOTB ...
2
votes
1answer
422 views

Sitecore Context Database during computeField index

When I call Sitecore.Context.Database inside of an IComputedIndexField, it returns Core. I can't use this to call the GetItem() function. Thus, I wrote the following as a workaround. var ...
8
votes
1answer
252 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
430 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
2
votes
1answer
425 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 ...
3
votes
2answers
323 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 “...
0
votes
1answer
228 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 ...
1
vote
1answer
557 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 ...
9
votes
1answer
137 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 ...
11
votes
1answer
261 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 ...
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 ...
3
votes
2answers
589 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 ...
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 ...
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 ...
0
votes
1answer
402 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 ...
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 ...
5
votes
2answers
400 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? ...