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
1
vote
2answers
988 views

loading partial view from jquery

I am trying to swap partial views on my home page layout via jquery. I have 3 tabs which when clicked, would load their respective partial view into a placeholder on the main layout. In my ...
1
vote
1answer
475 views

Advantages of servicesapicontroller over api controller

I've been looking for best way to expose a api that returns data in Sitecore and I found some implementation which use ServicesApiContorller, what are the advantages of using this controller over ...
1
vote
1answer
46 views

Updating xDB on async mode on Sitecore 8.2 update 4

We are pushing the customer details into xDB when they login. The problem is we may have times where more than 5k customers could be accessing the site at the same time, So I don't want updating xDB ...
-2
votes
1answer
557 views

Looping through items in bucketed folder [duplicate]

For a project I am working on, I am attempting to figure out how to loop through a bucketed folder programmatically using C#. In viewing the bucketed folder structure, the bucket folder nests the ...
0
votes
1answer
168 views

'Unable to connect to SQL Server database.' - webAPI

using: VS-2017(as admin), sitecore-8.1.2 and SQL - 2012. I created a ASP.Net web application - WebAPI to read content from my local sitecore instance. In the "ValuesController.cs" I am using the ...
0
votes
1answer
56 views

CD site setup for one country / subset of languages

Planning to setup 2 new CD servers which contain only French and English language pages. All other language versions should not exist in new web db. I took the existing web db backup and setup site ...
2
votes
2answers
545 views

ItemWebService not working

So I need to retrieve an item using the sitecore API. So firstly, I need to log in, Im following what this site states: https://doc.sitecore.net/sitecore_experience_platform/developing/...
0
votes
1answer
261 views

Finding siblings in buckets

We've a folder item which stores all new artciles. This item is bucketable. But after turning into a bucket, we are not able to find previous and next sibling of an item under bucket. The below code ...
0
votes
0answers
695 views

How to automatically escape item paths for use in Sitecore query

Is there some API utility method which can automatically escape an item path for use in a Sitecore query? I am building a query string in code which uses an item path. If the item path contains a ...
1
vote
0answers
233 views

Sitecore Commerce Categories children is not being populated. “GetNavigationViewModel”

I have setup Sitecore 8.2 + Commerce Server + SOLR I have created Catalog under departments. "Commerce Catalog Manager" [Commerce Catalog Manager] ABC (category) ZYX (sub Category) ZZZ (sub ...
1
vote
2answers
173 views

Context.Site is null within LinkProvider code triggered from FileSystemWatcher callback

Scenario in our Sitecore 8.1 instance is that, we have a .NET FileSystemWatcher object that is initialized in Application_BeginRequest of global.asax. When a file is dropped in the watched folder, ...
3
votes
1answer
584 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 ...
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 ...
2
votes
3answers
228 views

One CD server site goes down-Notification

Using 3 CD server to host my sitecore site. Using load balancer navigating the traffic on servers. Some time one of the CD server site goes down how we can get notification. Is there any way run some ...
1
vote
0answers
139 views

Restricting user from forcing manual submit to the Sitecore Url

Looking for the best practices to tackle a user behavior in my Sitecore 7.5 application. Basically there is an action method decorated with the [HttpPost] attribute. This action is invoked through ...
2
votes
1answer
329 views

Intermittent issues with the Sitecore Ajax Post request while invoking a MVC Action [closed]

I have an application running on Sitecore 7.5 where my code is invoking an MVC Action at client side. The action method is decorated with the [HttpPost] attribute. https://www.XYZ.com/api/sitecore/...
0
votes
2answers
421 views

Store media item in Sitecore somewhere else instead of Media Library

Is this possible to store Media items in some other Content tree node in place of Media Library?
5
votes
1answer
149 views

Creating friendly imageurl in scheduled job

I am using a scheduled job to import some content into Sitecore. Hereby I am inserting inline images into a rich text editor field. I determine the src of the img tags by using: string url = ...
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 ...
2
votes
0answers
100 views

Updating Sitecore renderings programmatically [duplicate]

I am trying to update the renderings (more than 12) programmatically. I have around 1000+ items and each item as multiple languages (8+). I have developed the tool to see which all items as renderings ...
2
votes
1answer
948 views

Sitecore field.GetItems() returns no items on Non English version

We have an item which is having a multilist field in it. This field has selected value and the below code is working fine on English version. Other language versions are returning empty result. We ...
0
votes
1answer
644 views

solr Sitecore full text indexing ifilter

I'm attempting to index the content of pdf's with Solr 6.6.2 and Sitecore 8.2 Update 6. I've got my solr indexes working correctly, and I'm able to search text from pages (content items) and I'm able ...
0
votes
1answer
229 views

Is there a way to use a rich text field as meta tags?

Is there a way to use a rich text field as meta tags? I'm picking up where someone left off and they are trying to use a Html.Partial to load a cshtml file that pulls from a rich text field. This is ...
1
vote
1answer
69 views

WebApi queries on nonexistent resource returns 200

I am using the Sitecore 7.2 Item Web API to retrieve some items. Using fast queries I am not able get a "404" in case an item doesn't exist (even if i don't use fast queries, i still don't get 404). ...
1
vote
0answers
90 views

How to get input value from textbox and store that in content tree in Sitecore?

I have created a textbox and button in a View Rendering. Now I want to know that how to store the input value from this textbox by clicking button and store that in content tree. How would I do that?...
3
votes
1answer
1k views

Object reference not set to an instance of an object in Experience Profile (SC9 & SQL xDB) [duplicate]

I’ve successfully installed SC9 and have been able to push contacts into xDB via xConnect without any problems. I can see the contacts in the SQL database and that bit is working fine. Something ...
10
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 ...
1
vote
1answer
403 views

Get Sitecore page content dynamically

I'm trying to get a page's content dynamically so I can open in a modal. What's the best way of getting the html from a page given an ID/page url?
2
votes
3answers
207 views

Data re-writing from Sitecore 7.2 with SPE

So I need to re-create some content from Sitecore 7.2 to a new Sitecore 8 instance. What we had in mind is to create a script using PowerShell in the new Sitecore 8 instance to fetch the needed data ...
4
votes
1answer
433 views

Change field type from Droplist to Droplink

I have content items with Droplist field. I want to change this field to Droplink field type. What is the best solution/practice to change it without losing already existing data?
4
votes
1answer
791 views

Receiving 404 error when accessing Item Web Api with Sitecore 7.2

Im trying to use the item web api in sitecore 7.2 to retrieve https://[hostname]/-/item/v1/sitecore/content/ in postman, but it returns a 404 not found error (the whole 404 not found html page of ...
2
votes
1answer
1k 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
2k 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
372 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
637 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
628 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
369 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
765 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
304 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
779 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
165 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
591 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
425 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
965 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
56 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
322 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
220 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
532 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 ...
2
votes
2answers
536 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
3k 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