Adding publish to the contextual menu of Sitecore

June 29, 2017 at 3:51 PMVicent Galiana
How many times have you right-click on an item to publish it to remember that this option is not available? How annoying it is for you, having to go to "Publish" tab, click on publish item, etc... I got fed up while working on LawNow Upgrade and decided to add it. It's a 5 min task and saves "hours" of frustration... Change to the core database Go to: /sitecore/content/Applications/Content Editor/Context Menues/Default Duplicate the item Insert (Or any other of template "/sitecore/templates/System/Menus/Menu item". I recommend copying, as this template is not in the "insert options". Rename the new item as "Publish" Change the field display name to "Publish" Set the Icon field to "Office/16x16/publish.png" Set the Message field to: item:publish(id=$Target) Change the Item icon to "Office/16x16/publish.png" Now, to avoid disappointments, in a scenario where a user may think that can publish, to later found out they can’t, we have to apply security: Add read access at item and descendants level for the Sitecore client publishing role Break inheritance at item and descendants level for the role Sitecore client user   With this settings, only user with the role “Sitecore client Publishing” can see this button. This is the same security as applied to the default button. To be fair, I have to give the credits to Benjamin Vangansewinkel and his post, who gave me the idea. I just added the icons to make it look nicer... That's it, now you should get something like this:   That's it, now run to show it to your experienced Sitecore users and watch their faces of joy!  

Posted in: SiteCore

Tags:

Adding publish item to the contextual menu of Sitecore

June 29, 2017 at 3:51 PMVicent Galiana
How many times have you right-click on an item to publish it to remember that this option is not available? How annoying it is for you, having to go to "Publish" tab, click on publish item, etc... I got fed up while working on LawNow Upgrade and decided to add it. It's a 5 min task and saves "hours" of frustration... Change to the core database Go to: /sitecore/content/Applications/Content Editor/Context Menues/Default Duplicate the item Insert (Or any other of template "/sitecore/templates/System/Menus/Menu item". I recommend copying, as this template is not in the "insert options". Rename the new item as "Publish" Change the field display name to "Publish" Set the Icon field to "Office/16x16/publish.png" Set the Message field to: item:publish(id=$Target) Change the Item icon to "Office/16x16/publish.png" To be fair, I have to give the credits to Benjamin Vangansewinkel and his post, who gave me the idea. I just added the icons to make it look nicer... That's it, now you should get something like this:   That's it, now run to show it to your experienced Sitecore users and watch their faces of joy!

Posted in: SiteCore

Tags:

Adding publish to the contextual menu of Sitecore

June 29, 2017 at 3:51 PMVicent Galiana
How many times have you right-click on an item to publish it to remember that this option is not available? How annoying it is for you, having to go to "Publish" tab, click on publish item, etc... I got fed up while working on LawNow Upgrade and decided to add it. It's a 5 min task and saves "hours" of frustration... Change to the core database Go to: /sitecore/content/Applications/Content Editor/Context Menues/Default Duplicate the item Insert (Or any other of template "/sitecore/templates/System/Menus/Menu item". I recommend copying, as this template is not in the "insert options". Rename the new item as "Publish" Change the field display name to "Publish" Set the Icon field to "Office/16x16/publish.png" Set the Message field to: item:publish(id=$Target) Change the Item icon to "Office/16x16/publish.png" Now, to avoid disappointments, in a scenario where the user may think that they can publish, to later found out they can’t, we have to apply security:   With this settings, only user with the role “Sitecore client Publishing” can see this button. This is the same security as applied to the default button. To be fair, I have to give the credits to Benjamin Vangansewinkel and his post, who gave me the idea. I just added the icons to make it look nicer... That's it, now you should get something like this:   Now run to show it to your experienced Sitecore users and watch their faces of joy!  

Posted in: SiteCore

Tags:

Sitecore and Solr: searching empty fields

June 13, 2017 at 7:49 AMVicent Galiana
By default, when we index our content in solr (same for Lucene) Sitecore creates a document per item, and store the value of each (Sitecore) field in its related field in Solr. This is just the basic scenario, and can (And will) become more complex as we introduce other scenarios, but it's enough for our matter. In Solr and Lucene, each document is different. A document can have multiple fields, the same field can be stored several times and a field can not exist for a given document. By default, if our Sitecore field is empty, Sitecore won't create the field in Solr, making it difficult (if possible at all) to search for things like "where myfield is empty". The usual best practice for handling this scenario is to store an "empty" value in our Solr field, to be able to look for it. Thanks to this post I learned that now Sitecore has implemented this best practice, so we can specify the value to be inserted in the index for null values or empty strings, which is great but... The implementation of the field reader for multivalue fields, prevents this mechanism to work. This field reader always returns a list, hence the document builder never uses any of the empty/null values assigned in the configuration. With a few lines of code, o replaced the default reader with my own implementation where I check for empty lists before returning it to the document builder. If the list is empty, I return an empty string instead, "forcing" the document builder to use the configured emptyValue for each field. This is my field reader: public class MultiListFieldReader : global::Sitecore.ContentSearch.FieldReaders.FieldReader     {         public MultiListFieldReader()         {         }         public override object GetFieldValue(IIndexableDataField indexableField)         {                         List<string> strs = base.GetFieldValue(indexableField) as List<string>;                         if (strs == null || !strs.Any())                 return string.Empty;             else                 return strs;                      }     }   And this is how we can replace the default reader for multivalue fields <fieldReaders type="Sitecore.ContentSearch.FieldReaders.FieldReaderMap, Sitecore.ContentSearch">             <mapFieldByTypeName hint="raw:AddFieldReaderByFieldTypeName">               <fieldReader fieldTypeName="checklist|multilist|treelist|treelistex|tree list" fieldNameFormat="{0}" fieldReaderType="ClearPeople.Search.Crawler.FieldReader.MultiListFieldReader, ClearPeople.Search.Crawler" patch:instead="fieldReader[@fieldTypeName='checklist|multilist|treelist|treelistex|tree list']"/>                         </mapFieldByTypeName>           </fieldReaders> And finally, as per the previous blog posts, this is how we can configure the value for empty fields (Please not than even when we only need the emptyString attribute, we need to specify the nullValue, for Sitecore to call the right overload of the configuration method: <fieldMap>             <fieldNames hint="raw:AddFieldByFieldName">               <fieldType fieldName="excludefromsearch"     returnType="string" />               <field returnType="stringCollection" fieldName="sectors" nullValue="none" emptyString="none" />             </fieldNames>           </fieldMap> I have raised a ticker with Sitecore to verify this behaviour and confirm a valid solution, in the meantime, use this with care and always do your test before going live with it.

Posted in: SiteCore | Solr

Tags:

Sitecore consumes all the available memory and restarts

May 28, 2017 at 6:45 PMVicent Galiana
Recently, one of my biggest instances went mad and decided to consume all the available memory on the server, to finally die and restart. No deployment, nor code changes, no editions, nothing... I then noticed that some hours before we had a full site republished, which apparently was completed without errors. As we had some issues before with the event queue and related tables I decided to try a shortcut. I truncated all these tables, restarted the application and voila! Sitecore went back to normal. I always have my magic queries on hand to clean the queues: delete FROM [History] where Created < DATEADD(HOUR, -12, GETDATE()); delete FROM [PublishQueue] where Date < DATEADD(HOUR, -12, GETDATE());  delete FROM [EventQueue] where [Created] < DATEADD(HOUR, -4, GETDATE()); But, as usually these problems are related to too many events queued, I decided to go for the shortest way and run: truncate table [History]; truncate table [PublishQueue];  truncate table [EventQueue];   To note that I was using a low, standard tier of SQL Azure, so the performance of some queries is not really good. Disclaimer: Don't run SQL scripts against a production environment without full understanding of what you are doing and the related risks

Posted in: SiteCore | SQL Azure

Tags:

Using Azure document Db as Mongo provider

December 6, 2016 at 7:23 PMVicent Galiana
Since Document DB started supporting Mongo's protocol I was wondering if we could have Sitecore running on Document DB. And today I managed to get it running. It threw a couple of exceptions the first time, but since then I don't see any error and, apparently, everything is working fine. (Of course, I Haven't tested it thoroughly).  The first step is creating the Database as a service for mongo on Azure Go to the portal and click on New Filter by "mongo" Select Database as a service for MongoDB Fill in your details for name, subscription, resource group and location Create the required databases Select the Resource you've just created. On the overview tab, you can only find the option to add collections. We don't need to create each of the collections, Sitecore will do it for use, but what we have to do is create the database. Go to the "Browse" section. Now you will see the option to "create database" on the top of the new blade. Create 4 new databases: Analytics Tracking_live Tracking_History Tracking_contact   Update the connection strings Get the connection string from Azure. Select the connection string option, from the settings section. Then copy the connection string from the bottom of the new blade   Replace your connection strings  Open your connection string file: ...Website\App_Config\ConnectionStrings.config Replace the connectionString for the connection analytics with the value you just copied from the portal. You will notice that this connection string is missing the database. To include the database, find the text "/?ssl=true" at the end of the string. We have to include the database after the "/". It should look like this: "xxxxxx/analytics?ssl=true"; Do the same for the other 3 databases. Save the file. Sitecore will re-start, but will throw errors like "Unable to connect to server Authentication failed because the remote party has closed the transport stream". This is because the mongo provider is not using configuring SSL correctly. We are lucky, Sitecore gives us the opportunity to set up the driver, before it uses it. Set up mongo provider to use SSL "Properly" You can follow these two links to implement your own solution or you can use mine from here.  Just drop this dll in the bin folder, and this config file in the app_settings/include folder That's it. Now your Sitecore will connect to DocumentDB and will start creating the required collections.  DocumentDB with support for mongo is still in preview, and this provider is not supported by Sitecore, so You shouldn't use it for production environments but if you are "playing" with Sitecore on Azure and you want to keep everything in Azure as Sitecore is doing with 8.2.1 supporting Azure webapps, Azure search, Azure Redis cache, etc.  with this trick, you can now use DocumentDB to store your collection database Please, let me know if you find errors using DocumentDB

Posted in: Azure | SiteCore

Tags: , , ,

Setting up uCommerce on a Content delivery server

February 13, 2016 at 6:36 PMVicent Galiana
Installing uCommerce on a content delivery server is pretty simple, nothing new, just install the package on Sitecore and done. Perfect! everything is up and running, but... what if now you follow the standard procedure of "security hardening" for a CD server? One of the usual steps is to remove any link to the master database. You do it, and nothing happens, it may look lie if it works but... sometimes uCommerce must read items directly from the Sitecore tables and, by default it does it from the master database. One example is the confirmation emails, uCommerce will fail with the error: Could not find configuration node: databases/database[@id='master'] You can control from which database uCommerce reads the items by changing the property "nameofcontentdatabase" of the component "SitecoreContext". By default, this configuration is stored in the configuration file shell.config, but as usual, uCommerce recommends to apply those changes in the custom.config file, instead of modifying any uCommerce file directly. Summary. Copy the following code into custom.config <!-- Services --> <component id="SitecoreContext" service="UCommerce.Sitecore.ISitecoreContext, UCommerce.Sitecore" type="UCommerce.Sitecore.SitecoreContext, UCommerce.Sitecore"> <parameters> <backEndDomainName>sitecore</backEndDomainName> <nameOfContentDatabase>web</nameOfContentDatabase> </parameters> </component> Restart your application In my own opinion, we should always apply this change as our users are expecting to be able to edit in the master database without those changes being applied on the front end, and in scenarios like this one, the email would be generated with the content from master, which is not the expected behaviour. P.S. Credits to uComerce support team for this solution

Posted in: SiteCore | uCommerce

Tags:

Sitecore uCommerce showconfig

February 7, 2016 at 8:25 PMVicent Galiana
Do you want to see all the different configuration files of uCommerce in one place? With this module, you got just that! [More]

Posted in: SiteCore | uCommerce

Tags:

Sitecore News Mover pushed a little further

October 13, 2014 at 10:33 PMVicent Galiana
The good old "news mover" (Or item mover) has been there helping in most of my project, so I thought it´s time to give something back. Supporting multi-source Path property  Until the pull request is accepted (If it´s accepted), you can find here a slightly different version, which supports a new property "roots" per template. This property is optional and accepts one or more item ID´s separated by "|". If this property is used, only descendants of any of these items will be moved. This parameter is useful if you only want items under a specific folder to be moved into folders. <!--             Define a template configuration.               @id: [required] Any item based on the configured template will be ogranized               @sort: [optional] How to configure the sorting of 'folders' and the item  (Ascending, Descending, null)                 DateField: [required] The field on the template where the date is set                 YearTemplate: [required] The template to use for creating year 'folders'                 MonthTemplate: [optional] The template to use for creating month 'folders'                 DayTemplate: [optional] The template to use for creating day 'folders'                 @formatString: [optional] The Year/Month/Day nodes support this attribute.                                            It will control how to format the date for the  name of item.  defaults - yyyy/MM/dd for year, month, day nodes respectivley               @roots: [optional] One or many item id´s separated by | Only descendants  of any of these will be processed             -->                            <template id="user defined/newsarticle" sort="Descending">               <DateField>releasedate</DateField>               <YearTemplate formatString="yyyy">Common/Folder</YearTemplate>               <MonthTemplate formatString="MMMM">Common/Folder</MonthTemplate>               <DayTemplate formatString="dd">Common/Folder</DayTemplate>             <Roots>{83BF7C68-04AF-4316-9B23-5CFA365EFB4A}|{83BF7C68-04AF-4316-9B23-5CFA365EDSD4A}</Roots>             </template>

Posted in: SiteCore

Tags:

Learnt at Sitecore Symposium Barcelona 2014 #symeu From placeholders to the experience database

October 9, 2014 at 10:45 PMVicent Galiana
First conclusion: Sitecore is not a (web) content management system. "What did you drink?" you'll be thinking… but this is one of the key concepts the Sitecore guys managed to convince me of: Sitecore is a marketing platform, which includes a (very good) CMS. If you think about it, it makes sense… Yes, sitecore has been one of the best CMS in the market, since they began, even patenting the concept of "placeholders" in the U.S.A. (I would have never image that, but they show us the documents). When was last time you saw a demo or presentation by sitecore about CMS capabilities? It's always about personalization, about personas, about goals, point, etc. Why DMS? Why "Digital marketing suite" and not just "analytics"? Why ECM (Email campaign manager), integrations with CRMs, integrations with different ecommerce platforms? Why most of these terms are related to marketing and not technology? The answer is easy, because Sitecore abandoned the focus on the CMS years ago, and they changed their focus in transforming the CMS into a complete marketing platform, not only able to deliver content for the web, but to deliver the proper content, at the proper time, in the proper channel, for each user. How has sitecore achieved it? Of course, it has not been easy, but the concept is pretty simple, track every single interaction of the users with the system, and weight it against different goal. The architecture of the system, allowing different topologies and a huge scalability to support heavy loads of usage. CM,CD, different databases, in different servers, etc. The data structure implemented by sitecore was great to support any data structure of the content Storing user interactions with OMS and then DMS, a relation database able to store structured data, per user, content, goal, etc. This was the core of the "personalization engine" as for the different reporting tools. Adding new channels to the suit: Email, ecommerce, social networks, CRM, etc This is Sitecore 6, this is the past and the sitecore most of us know and are comfortable with, but it was not enough to keep up to date with the new demands of the era: so sitecore had to step up to the net level, this is Sitecore 8, this is the future: Even when sitecore already support IaaS with Azure and Amazon, and has specific tools to support PaaS on Azure, sitecore will soon support SaaS, supporting all the different architectures commonly used today. First problem solved: Take it to the cloud. The extremely customizable data model was limiting the capability to manage huge amount of data, so with Sitecore 7 the concept was changed. The data is still stored in databases and tables, but now the focus is to use if from indexes by taking the old and simple implementation of Lucene, to a provider model, with a much more powerful API, supporting not only a newest version of Lucene, but a much more scalable SOLR. Second problem solved: Manage any amount of content. Sitecore 7.2, came as a treat for developers, with some if the feature the community has been demanding, like parallel publish. What problem will sitecore solve next: How to store huge amount of user's interactions and process it quick enough to provide that perfect piece of content, in that right moment. The solution? The experience database coming in Sitecore 7.5: A combination of a mongoDB database, moving from the relational database of DMS, to a NOSQL database where to store massive amount of data, quickly and really fast read access to the original document (yes to the original document no more mappers). This data is queued and processed, with the well known pipelines that we can (must) extend to transform this to a data warehouse for reporting services. We will be able to manage our own experience database, but Sitecore will provide the option to host it for us (Apparently on Azure) The next challenge: make it look good. The desktop, content tree, etc was an amazing UI years ago, but completely out dated nowadays. With sitecore 7, SPEAK came to life, and sitecore 8, has been rebuild on top of it, providing a new fresh, modern UI, with a real API, following the latest patterns and practices, been a real platform to be extended. So there´s no doubt, we need to learn SPEAK and we have to do it now. More? Personalised content is based on predefined rules (for this type of user, use this data), but that means marketers must guest who theirs users are, and explicitly decide what content to show. Now with the Skynet project, sitecore is able to process all that amount of data of the experience database and use the latest Machine learning system and data models to automatically suggest and apply new rules. This means, finally sitecore will decide, on the fly the perfect content for the each user at this specific moment. A/B testing: every time for everything. Testing your content is not trivial anymore. Sitecore is moving towards a culture of testing everything, and learning from the test and from the different editors to predict the results and improve the personalization. Editor will be ranked based on their predictions, not only to make it funnier, but to include these results in the learning models. Do not test for a certain amount of time of visit, now you can test until the system is sure that the results are valid, letting you decide "how much sure". Understanding the actions of your users is vital to guide them toward your goals. The new path analyser implements an event sequence analyser model integrated with Machine learning services to represent graphically the different actions of clients, representing the commons path and their values through the content, helping you to understand you user´s and implementing the necessary changes to guide them towards your goals. Dynamically segmented recipient list for ECM. Forget about sending emails to everybody in a recipient list or having to filter them manually, or with custom code. The next version will use the new power of Sitecore to let you segment your recipient list on the fly. eCommerce integration usually was based on a ecommerce platform having to integrate their API with the Sitecore API, so when you have to implement it and extend it, means you have to use both of them, the better you can. Sitecore has change this, introducing the Sitecore commerce connector. Now sitecore provide a commerce provider definition, which the different ecommerce solutions have to follow to integrate with sitecore, meaning that no matter which solution you use, it will be managed with the same API. Are you not convinced yet Sitecore is not just a CMS? What if I tell you can use all the power described above to track and inject content or functionality into any other website? No matter if it´s a static html, java, php, .net… with the new Federated experience manager and the experience editor, you´ll be able to edit any site, and use it to track users and fill the experience database and learn from them, inject content, inject personalized content, etc. and just with a line of JavaScript. One thing is clear, we´ve a big challenge ahead of us: NoSQL databases, indexes, reporting services, cloud computing, machine learning services, event sequence analysers, data models, MVVM, JavaScript. Are you ready to take it?

Posted in: SiteCore

Tags: , , , ,

ECM Auto Log-In: How to enable accesing secured content from emails with Email campaign manager 1

April 12, 2014 at 7:46 PMVicent Galiana
Are you sending links via email to sections of your site which needs authentication? Do you want to improve the user experience, avoiding having to log-in?
This is your post! [More]

Posted in: SiteCore | SiteCore ECM - Email Campaign manager

Tags:

How to support diacritic search on Sitecore 7 (Search with special characters)

April 6, 2014 at 6:20 PMVicent Galiana
Is your content created on a language with diacritics? Do you need to return the same results if user types the word with or without the diacritic? (a==á?). Have look, it´s easy!
[More]

Posted in: SiteCore

Tags: , , , ,

Managing real Font size (Pixels) on the Rich text editor of Sitecore from the content tree.

April 5, 2014 at 7:49 PMVicent Galiana
Has shown on my previous post "Using real pixels in the rich text editor of sitecore" is it possible to change the relative font size in the RTE drop down, by real pixels, but this solution may not be enough, as this list is only manageable modifying a xml file, so if you want to add a new value, you need to update that file on the server. The file is:sitecore\shell\Controls\Rich Text Editor\ToolsFile.xml As described here you need to add to that file: <root> <tools name="MainToolbar" enabled="true"> <tool name="RealFontSize" /> </tools> <realFontSizes> <item value="8px"></item> <item value="9px"></item> <item value="10px"></item> <item value="11px"></item> <item value="12px"></item> <item value="13px"></item> <item value="14px"></item> <item value="16px"></item> <item value="18px"></item> <item value="20px"></item> <item value="22px"></item> <item value="24px"></item> <item value="26px"></item> <item value="28px"></item> <item value="32px"></item> <item value="48px"></item> <item value="60px"></item> <item value="72px"></item> </realFontSizes> </root>   In order to move the settings back to the profiles folders on the core database, we need to use a custom "EditorConfiguration" class to fill the Real Font Sizes list of the Telerik control as the default one provided by Sitecore only fills the seconds list of relative font sizes. I´ve created a simple sample, which reads the real font sizes from it´s own folder of the profile. You can download a working package from here, or get the full code from GitHub  

Posted in: SiteCore

Tags: , , ,

Using anchor links on ecm

April 2, 2014 at 10:26 PMVicent Galiana
Is ECM breaking your links to anchors? Find out how to fix them. [More]

Posted in: SiteCore | SiteCore ECM - Email Campaign manager

Tags: , , , ,

Sitecore Azure Error Startup task ended with error 532462766

March 29, 2014 at 8:46 PMVicent Galiana
How to fix the error 532462766 [More]

Posted in: Azure | SiteCore

Tags: , , , , , ,