Enhance DAM Connector for retrieving additional information to an asset in Sitecore

We all know the situation: Some images are restricted and we have to display their copyright and source in the image caption. Editors want to save this information only once. So, if you use the Content Hub they want to do it there.

The work in Content Hub itself is simple, just add two string-properties to the M.Asset-schema and you can edit them for the assets. But how do you get this information in Sitecore? The DAM Connector just comes with a few properties like asset ID, public link and the property you configured to use for alt text.

This blog post gives an idea of enhancing the connector for retrieving the additional properties you need.

Left: Content Hub Asset with Copyright and Source. Right: Preview in Sitecore, Teaser with rendered Copyright and Source.

Continue reading “Enhance DAM Connector for retrieving additional information to an asset in Sitecore”

What about Image Resizing via QueryString Parameter when using Public Links from Content Hub?

In Sitecore we know that there is the possibility to add params like “mw” for maximum width and “mh” for maximum height. But what if we use Public Links from Content Hub? Spoiler: There is such funcitionality! In this blogpost we’ll have a short look into the hub and its possibilities.

Continue reading “What about Image Resizing via QueryString Parameter when using Public Links from Content Hub?”

Content Hub: Find asset for public link

When using the assets from Content Hub there is currently no way ootb to find the asset for a public link.
But this is a feature, which could be very senseful, so I tried to find out what we can do in Content Hub for achieving the goal. We can’t configure it in the search component used on the assets page for example. So I tried the way with a new page and an external page component and here is what I found out:

Continue reading “Content Hub: Find asset for public link”

Content Hub: Get public link for asset from Web SDK Client

Today our topic is getting the public link(s) for an asset in the Content Hub via Web SDK Client. Therefore we first need the configuration and client. Keep in mind, that the user you use must be a superuser.

// Your Sitecore Content Hub endpoint to connect to
Uri endpoint = new Uri("https://yourcontenthuburl");

// Enter your credentials here         
OAuthPasswordGrant oauth = new OAuthPasswordGrant         
{             
  ClientId = "yourclientid",             
  ClientSecret = "yourclientsecret",             
  UserName = "yoursuperusername",             
  Password = "youruserpassword"         };         

// Create the Web SDK client         
IWebMClient client = MClientFactory.CreateMClient(endpoint, oauth);         client.TestConnectionAsync().Wait();

Continue reading “Content Hub: Get public link for asset from Web SDK Client”

Plain Sitecore – Add Edit Context Item Button to the Experience Editor ribbon

After we added the two custom experience buttons to our renderings, we came up with the idea, to offer the editors the possibility to even edit all fields of the context item – sometimes not shown in HTML directly such as meta title, meta description and so on – without switching back to the Content Editor. Therefore we implemented the “Edit context item” button I will describe in the following.

Continue reading “Plain Sitecore – Add Edit Context Item Button to the Experience Editor ribbon”

Plain Sitecore – Custom Experience Button dynamically loading the rendering’s properties

Some time ago I described how to implement an “Edit Fields” Button without defining all fields. Now we have a look at the implementation for the rendering properties. For this we also implement a command, but need one step more.

Continue reading “Plain Sitecore – Custom Experience Button dynamically loading the rendering’s properties”

Plain Sitecore – Custom Experience Button dynamically loading the Item’s fields

We all have the same challenge: Make everything editable via Experience Editor. Sitecore itself has the EditFrame implemented and the default way is to add custom experience buttons to the rendering, but then you have to create a lot of new button items in the core database for the fields you want the editor to be able to edit.

You could use the GlassEditFrame from GlassMapper, just call the Helper function in the View and GlassMapper does everything. You can just pass the model, special fields or a path to your custom buttons.

You also could do an own implementation of an editframe wrapper and write your logic to do everything.

The last time we came to this point we decided to use the Sitecore editframe and just implement one “Edit fields” button and add it to every rendering item which has a datasource.

Continue reading “Plain Sitecore – Custom Experience Button dynamically loading the Item’s fields”