Is there a way to get a list of defined languages in the project using ContentDelivery API in Kentico-Cloud? - kentico-kontent

I need to get a list of available languages for given project. It would like to use content delivery api to achieve this. Is that possible ?

No, right now there is no direct support in the Delivery API, however, there are some options.
At first, you can utilize the Content Management API to list variants of the item or content type.
Secondly, you can create content type (and item) where you can list and maintain your languages and then request this item in your app.
At last, you can find Kentico Roadmap here and suggest/upvote requested feature(s).

Related

Controlling custom code usage in camunda modeller

I intend to use Camunda for my product. While all camunda abilities match with my needs, i have a concern about camunda modeler controlled usage. Following are my needs in modeller
Is it possible to create custom domain specific tasks which i can simply drag-drop during modeling. It should be possible to define custom properties needed by this custom state
Can I somehow control/prevent use of custom java code/scripts by person modeling process. I want to restrict use of only my custom tasks, so that we don't end up with lot of scattered code across processes.
Can experts share views to achieve these targets?
Recently Camunda Modeler (I am using release 1.4.0, published on October 2016) has been extended to allow json template installation, which can meets all of your needs (if I understand them correctly), or at least the most of them.
You may find documentation for templates build here. The documentation is in progress, but what is already published I think it is quite clear. Briefly you have to
list all the elements you want to customise (user tasks, general tasks, service tasks, listeners, links and so on)
find out the json representation (explained in the short documentation) of each element
insert all the jsoned elements in a file (for example: myElements.json)
put the file in a specific modeler folder (see below)
close and restart the modeler
For example if you have installed the modeler in C:\Tools\camunda-modeler\, the folder to publish the file into will be C:\Tools\camunda-modeler\resources\element-templates (note that resources will be already present, but element-templates will not; it will have to be created).
If all will be right the modeler will start without any error and you will find a new dropdown list selector on the right panel (as stated in the documentation) for all the elements for which a template has been defined. Generally you have to classify each templates as either a user task, or a service task, or generic task and so on, so that when you want to use it you have to start from the generic element. For example, if you prepare in the json file 2 templates of kind of user task, say userTask1 and userTask2, if you want to insert in your new process userTask1 you have to
pick up an empty userTask
and choose from the element template selector on the right the voice userTask1, so that the empty user task becomes quickly the userTask1 (with all my custom properties with my default values)
that's it
To sum up, you may build templates with custom id and name (editable), with custom properties (editable or not, or even hidden), with eventual input/output parameters. So you may have default values properties and also tasks with simplified selections or without any selections at all.
You may find good starting examples to build your own templates at this GIT repository.
Hope that is enough to understand.

List of News Articles In Sitecore (Best Approach?)

I am creating a Sitecore MVC site for a client and I need to create page that will list news articles for the company.
So far, I have created items that use a shared data template called “Article,” and I also have a sublayout (a view rendering) called “Article” that will display these items.
For the list itself, my plan was to create another component (a sublayout) call “News_List”, and to put a placeholder in it called “List”.
My question is this: can I allow the author to insert articles (e.g., N items of type “Article”) into this placeholder via the page editor?
Will SC allow you to insert multiple instances of the same component into a placeholder? Will this break anything?
I believe this is a pretty common question but I have not found a definitive answer. Thanks in advance…!
You can insert as many components (of the same type) in your placeholder as you want.. Just make sure to put the placeholder settings correctly and give it a decent name (not just "list" ;))
But are you sure you want to do this? Your editors will manually need to create a list of components for each article they want to add on the page. Doesn't sound to be very user (editor) friendly.. Maybe you should consider creating a list component that can get a list of articles as a datasource and show those. Or even select them automatically (but that might be not according to your business case)..
Yes, authors can add multiple instances of the same component into a single placeholder.
Assuming that the code of the component doesn't do any stupid things it's absolutely ok to do this.

Master/Detail Dilema: Wildcard items vs Sitecore Pipeline for Virtual Items or any better idea?

I used to implement listing/detail scenarios using wildcard items, meaning that, for the sake of URL, I create a regular item to display the list and then under that node, I create a wildcard item to represent all possible detail pages, like:
/news/*
(i generate a friendly name by code to replace wildcard and produce the full URL such as: mywebsite.com/news/the-meeting-press-release)
Then I create a folder or a bucket of content items somewhere else as my repository. Then I assign same datasource to listing node and wildcard node to give them same repository of content items.
Main reason I want to do this is to use datasources and make navigational nodes (which generate actual pages and URLs) to be separate from Content folder structure. In other words, separation of concerns: navigational items as presentation nodes and content items as my data repository.
This is an easy way to work around master/detail requirements but I always feel guilty about this, it feels like this technique breaks integrity (sitecore links table on database) and design pattern in Sitecore back-end.
For example when I look at Analytics, I get * as name of items, clearly the it feels like aliens to back-end system.
I know this is not a new topic. I have seen threads like this or ideas like Sitecore Pipeline Processor for Virtual Items to implement such requirements.
Is there any best practice about this? Have anyone good example of what is most sitecore-friendly way to implement such pipeline processor? How do you address this issue with wildcards on Analytics?
I'm going to go a different way to Martin here. I have successfully used Wildcards many times for the exact purpose you are suggesting (For an example have a look at http://www.atpworldtour.com/news - all news articles are items in a bucket with a wildcard to resolve the url).
There are 2 options to enabling the page editor.
The news article item becomes the page. In this way, you need a new processor in the httpRequestBegin pipeline that resolves the url to the item and then sets Sitecore.Context.Item to the current item. IIRC you do this by setting one of the pipeline argument properties. This will work fine in the page editor as the context item - the one being edited - is the news article. And then other renderings on the page can just use data sources as needed.
The news article resolves to a Datasource. I have also tried this method. To do this, you need a custom Datasource resolver. I sill used a processor in the httpRequestBegin pipeline so that I didn't have to resolve the Url multiple times for each rendering that needed the datasource. But then in the RenderRendering pipeline I had a processor that detected if I wanted a wildcard Datasource and used the item that had been resolved in the httpRequestBegin processor.
There are pros & cons for each method.
Option 1 is nice and simple. It means that you could use a single wildcard to resolve different "types" of page item as the presentation is on the page item and not the wildcard item, also each item can have its own custom presentation, so Datasources set in the page editor would be unique to an article. That is also a disadvantage in someways. A/B testing becomes more difficult with main article text etc... You are limited to testing article versions.
Option 2 is more flexible in the testing area - you can easily test/personalize parts of the article by changing the Datasource. But you are more limited as the presentation must be set on the wildcard. So renderings that are not part of the main article will have the same content/settings across all news articles.
I was previously in the same boat as you are. The are few issues with wildcard items, like resolving datasources or disability to run a page in Page(Experience) Editor or nested wildcards. Regardless of that, I have used wildcard few times and they do their job.
I've managed to resolve datasources properly, based on URL (see blog post: Automatically resolving correct Datasources for wildcard items based on URL), still did not sort the rest others.
Update: Richard suggests the way of implementing Page Editor below, you may find this helpful
Thus, my answer would be:
I would recommend you to keep classical approach of having a page item for each news item, rather than using wildcards. Content authors would use habitual approach (and page editor) rather that editing datasources somewhere on the content tree in Content Editor. If you configure that properly with templates and standard values - there would minimal hassle to create new news article.
In case if you worry about potential raise of number of news articles - use Buckets along with it (or suggest manual strategy to group them into folders).

Sitecore publishing restrictions by language

In Sitecore, the publishing restrictions access via the dialog are stored under the inherited Publish base template - for example, the Item-level Publishable checkbox is stored under __Never publish.
I had expected to be able to restrict publishing by language, but the fields above are shared between languages so apply to all.
Obviously I could unshare the fields, but I'm not sure what other implications there may be. Has anyone tried this or implemented another solution?
You can restrict the publishing of an item by language, but it is also by version. These are stored in the Lifetime field section, rather than the Publishing section.
This will allow you to mark a specific version in a specific language as unpublishable, however it won't affect all versions in that language.
Other than that, an option would be to add a new field to a base template that is Unversioned, perhaps "Publishable In Language". You could then look into adding a new step into the publishItem pipeline that takes this into account when determining whether a version is to be published - this would possibly take place just after the DetermineAction step, where Sitecore uses its own logic to determine if an item is to be published. Unfortunately that class isn't easily overridable and uses private methods, so it's not a great candidate for extension itself.

Search tags/facets in Sitecore Item Buckets

I'm looking to use the Sitecore Item Buckets package from Shared Source since I needed faceted search functionality and it makes sense to use the built in functionality rather than writing by own Lucene.Net search.
Sitecore Item Buckets
I'm having trouble with the search, or maybe I am reading the documentation wrong.
According to the documentation in section 2.2.3 & 3.1.3 I just need to mark a field as "Is Facet" and my filter will show in the search results.
I've also defined a tag field on the template and changed the Tag Parent field in "/sitecore/system/Modules/Item Buckets/Item Buckets Settings" to point to correct folder. This is working correctly, I can apply a set of tags to an item and search from the Bucket UI using "tag:CSharp" and it brings back the correct results, but again there is no filter shown in the list. I've rebuilt the bucket indexes in all cases.
Am I missing something? Should these show up in the list automatically, do I need to change some settings or provide my own implementation?
Screenshot
This is all within the Buckets Client UI, I haven't started writing any code yet, and on a clean install of Sitecore 6.5 (update-5/rev. 120706).
I'm not sure the documentation wording around this is entirely clear at the points I've mentioned. If you read further down the document though, section 4.3:
Item Buckets ships with 5 different types of faceting.
Templates
Fields
Dates
Locations
Authors
If you would like to introduce your own faceting categories then you only need to implement the IFacet interface.
There is an example of IFacet implementation in the documentation, or use dotPeek to look at the implementations of the existing Facets.
You also need to add an item to Sitecore: /sitecore/system/Modules/Item Buckets/Facets