Developers

Developer Blogs

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Developer Blogs

Partner Enablement
Partner Enablement

Several Search G2 updates have come out recently that I wanted to draw attention to.

CORS Headers

The Search G2 servers now respond correctly with CORS headers. 

Historically, the Search G2 servers in the cluster have not responded to CORS pre-flight requests, which has made using AJAX technologies in the browser to interact with Search G2 very difficult.

The Search G2 Javascript SDK resolved this problem by using JSONP. This approach has been adequate for some time, but it does have some security concerns and is not a technique that is in widespread use.

Note: this update to the Search G2 servers does not impact any existing code; it does enable developers who want to use AJAX technologies typical in modern single-page apps (React/VueJS/Angular etc.).

Random Sort Order

The ability to have search results returned in random order has also been deployed and is now generally available. 

Most search results are presented with some natural order (most recent, most relevant, etc.), but there are use cases where you might want to have a random order. One such use case is if you have a collection of related articles that you want to present to users and rather than having the same ones appear over and over, you can use random order to help visitors discover new content.

This feature is accessed by adding a "dynamic" field to the sort parameter in the format random_{seed}. The placeholder {seed} can be replaced with a random number seed but doesn't need to be replaced or updated on each call.

Example:

 

https://searchg2.crownpeak.net/cpuk-training-stage/select?q=*&wt=json&sort=random_1234%20desc

 

Demo

You can view a demo of these new features. You can also take a look at the underlying code by clicking the "Change View" button in the top right and picking "Editor View".

Read more
0 0 157
Partner Enablement
Partner Enablement

Branching is a fundamental operation in the CMS and one that all content creators and managers should be familiar with. The goal of branching is that it allows content creators to work with a clone of an asset, one that is in production for example, to make changes in the CMS and preview those changes either in the CMS or in different published environments without impacting the production content.

A similar facility exists, and for the same reason, when it comes to your CMS implementation code. Project branching allows you to:

  • make a clone of the entire project folder
  • make changes in either branch;
  • compare and merge between branches; and
  • specify which branch of the code to use for each workflow state (which more often than not corresponds to a published environment).

This feature is critical for phased implementations or that are looking to make significant changes with content already in production.

There are a couple of different strategies you can use when it comes to project branch.

Trunk-based Development

This strategy has all active development happen in the original project folder. In Crownpeak DXM, this is a shared resource as all implementation code is managed directly in the CMS rather than in external or local developer environments.

When development has reached a significant point, a stable feature release for example, create a project branch and label it. No changes, other than urgent fixes/patches should be made to the branch.

trunk-based development.png

 

I find that this strategy is the easiest to work with, but your experience may differ (let me know in the comments).

You can read more about this general strategy here: trunk-based development.

Branch-based Development

This strategy has all active development happen in the latest, tip or leaf, branch. When the implementation has reached a significant point, create a project branch, which will be the new tip/leaf where ongoing development towards the next release happens. Both the previous and the new tip branch are labelled appropriately. As with trunk-based development, only make urgent fixes/patches to the release branch.

A common approach when using this strategy is to name the branch with a suffix indicating which is the tip: something like 1.0-DRAFT. When the release is finalised and the new tip branch is made, the branch is renamed to 1.0 and the -DRAFT suffix is moved to the next branch.

branch-based development.png

Branch targeting

 

Once you have more than one branch of a project, the «Site Root» properties panel is where you can set the project branch, if any, to use for each workflow state. The workflow states presented in the panel are derived from looking at the workflow(s) in use by assets under the site root.

Screenshot 2020-01-15 at 16.21.11.png

 

Whichever branching strategy you use, when a release point comes up, you can go to the the «Site Root» properties panel again and update the project branch references.

NOTE: Doing this will not make any changes visible in any published environments, you will need to trigger publishing either through workflow events or by using the republish command on the site root folder.

Branching with Component Library

Component Library has a configuration asset located at «{project_root}/Component Library/Component Library Config». This asset specifies the various folders that Component Library should use and reference, including the Library folder.

The Component Library is deliberately installed under the project root folder so that when you branch a project, you get a clone of the Component Library definitions as well as the generated Component Library artefacts such as C# source files and templates.

Although component library definitions are cloned into each project branch, the branch compare and merge tools only operate against the Library, Template and Model folders. This limitation makes it very difficult to reconcile changes to the definitions files across branches. For this reason, I strongly recommend that you:

  1. Use a trunk-based branching strategy; and
  2. Only permit changes to component library definitions  in the trunk.

If you find you need to make changes to a release branch that includes changes to the component library definitions, the approach would make the changes in trunk and then either:

  1. Manually copy the changed library classes to the release branch; or
  2. Use project merging to create a sub-release project branch.

 

Read more
1 0 352
Crownpeak Employee
Crownpeak Employee

In this post, I’m going to show you how to create a simple React application that leverages Bootstrap. Then, I’m going to show you how to import it into Crownpeak DXM to allow non-technical practitioners to manage the content within the CMS, which will deploy as JSON into the same environment as the React App, for consumption at runtime.

Read more...

Read more
3 2 829
Crownpeak Employee
Crownpeak Employee

You can create dashboards in Crownpeak DXM that consume analytical data from almost any source.  This example shows you how to achieve this using Google Analytics; however, the same process can be applied for almost any provider.

Read more...

Read more
1 0 697
Partner Enablement
Partner Enablement

Content aggregation — sourcing content from several disparate sources, normalising the content, and then making it available to downstream consumers — is often pitched as a key benefit of headless content management. In this article we take a look at content aggregation and how this can be accomplished using DXM.

Read more...

Read more
1 0 656
Partner

Demonstrate steps to create an experience in Crownpeak DXM, for marketers & content managers, to build and deploy Salesforce Marketing Cloud (formerly known as ExactTarget) forms without going through a development cycle. On submit, these forms in-turn create a subscriber inside ExactTarget (ET) and saves the same data to a Salesforce data extension.

Read more...

Read more
2 0 702
Partner Enablement
Partner Enablement

This is part of series of articles that is looking at “headless” content delivery. Before we take a look at the use cases where headless is considered to be a very good fit, I wanted to look at the two key pieces in most, if not all, headless content delivery: non-web content; and pulling content.

Read more...

Read more
1 0 849
Partner Enablement
Partner Enablement

In this first of a serious of articles on headless content delivery, I look at what headless means, where it shines and why it appears to be surging in popularity.

Read more...

Read more
1 0 847
Partner Enablement
Partner Enablement

This article will provide you with a step-by-step guide to publish content from the CMS to your website and on publish, post a link on a Facebook Page.

Read more...

Read more
0 0 828