Posts

docker elastic

 docker network create elastic docker pull docker.elastic.co/elasticsearch/elasticsearch:8.13.3 docker run --name elasticsearch --net elastic -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -t docker.elastic.co/elasticsearch/elasticsearch:8.13.3 https://www.elastic.co/guide/en/elasticsearch/reference/current/run-elasticsearch-locally.html  docker network create elastic docker pull docker.elastic.co/elasticsearch/elasticsearch:8.13.3 docker run --name elasticsearch --net elastic -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -e "ELASTIC_PASSWORD=123456" -t docker.elastic.co/elasticsearch/elasticsearch:8.13.3

Sitecore usefull admin sites

Most of the time we require sitecore admin sites, so they are the most common I usually use:   Remove without restrictions /sitecore/admin/dbbrowser.aspx SHOW CONFIG http://<sitename>/sitecore/admin/showconfig.aspx Services /sitecore/admin/showservicesConfig.aspx Publish queue /sitecore/admin/PublishQueueStats.aspx /sitecore/admin/PublishQueueStats.aspx?refresh=30 (update page each 30 seconds) related info

Scriban GeneralLink Extension

 https://sitecore.stackexchange.com/questions/24908/accessing-link-field-values-in-a-scriban-template This will be a basic scriban example. But we will get TEXT and URL from a General Link using a Scriban extension First Add a "Rendering Variants"  a "Variants", with the same name as the Render; Add a "Variant Definition" as "Default" Add Scriban as "Scriban" as Name HTML <div class="hub-svelte-module" data-component="h131-generate-onbase-upgrade-code"> <script class="svelte-module__data" type="application/json"> { "title" : "{{ i_datasource | sc_field "Title" }}", "description" : "{{ i_datasource | sc_field "Description" }}", "subtitle" : "{{ i_datasource | sc_field "Subtitle" }}", "placeholder...

Docker improve download speed

Image
 This are a few advices to improve the images download. When we try to build or up a current Sitecore project (maybe other project works fine), we have the problem that it takes a lot to download images that docker requires to build what is needed.  First we need to use a good internet connection, and use a Ethernet cable CAT 6 or superior (CAT 5E is better than nothing). So that will assure that internet connection is good(ethernet cable is better than any Wi-Fi). Use some kind of parallel option to download images, to make it quicklier. For current docker version 4.25.2 or superior, we need to modify the "docker engine" to allow to download concurrent images at the same time. In older docker version we needed to add a parallel option on build/up command, but that is not working anymore in the latest docker version. This solution works for the docker version: 4.25.2 or superior Review doc and  https://stackoverflow.com/questions/43479614/docker-parallel-operations-limit ...

Get net framework version from DLL library

Image
 $path = "C:\bin\Connector9.dll" [Reflection.Assembly]::ReflectionOnlyLoadFrom($path).CustomAttributes | Where-Object {$_.AttributeType.Name -eq "TargetFrameworkAttribute" } |  Select-Object -ExpandProperty ConstructorArguments |  Select-Object -ExpandProperty value got from: https://stackoverflow.com/questions/3460982/determine-net-framework-version-for-dll

Sitecore JSS - Nextjs - Redirect problem using "router.push" with url that contains query

 This wont be a solution for a problem, but will be a inner discussion about some things that doest work. If I found a proper solution, I will update the post and add the solution once I found it. I will add the resources found that I think are usefull. To understand the problem. router . push ({ pathname : props . fields . viewInternalCta . value . href }); Not sure if it is the best implementation we can get. But when try to use a Url that contains paramenters like /Search/Blogs/result?types=news&q= The main problem with this implementation is the URL came from a Sitecore GeneralLink as a External link. The nextjss "router.push" allow to call URL query, but it must be implemented in that way. The problem with "General Link" contains a link to an object internal or external. In case we use a external link we can put there any link we want. In this example I use a link like: /Search/Blogs/result?types=news&structure= But when router.push tries to resolve t...

Sitecore JSS Common problems - Visual Studio Code - "JSX element implicitly has type 'any' "

 Sometimes we got some strange errors for VisualStudio and Visual Studio Code. I got the  "JSX element implicitly has type 'any' " , an error that make a RED underline over all the code into the component we are developing. It appears to be related to a change into the components dependency  for the current NodeJSS project. The solution it appears to be easy. It is reloading VSCode. You can do it following the next steps: Ctrl + Shift + P  - or -  ⌘ + shift + P And type: Developer: Reload Window Probably will work closing VSCode and open the project again too. The original solution was found in Stackoverflow: https://stackoverflow.com/questions/37674017/how-to-solve-jsx-element-implicitly-has-type-any-error