2
votes

I am new to Hybris and i want to change the logo of Hybris OOTB (PowerTools). But this i wanna do it through my new created addon. I discover that in this impex file (cm-content_en.impex) i have this

# Site Logo Component
UPDATE SimpleBannerComponent;$contentCV[unique=true];uid[unique=true];$picture[lang=$lang]
;;SiteLogoComponent;/images/default_logo.svg

Now, i wanna add my custom logo svg which is located in

/companystorefrontaddon/acceleratoraddon/web/webroot/_ui/responsive/common/images/new_logo.svg

How can i add the path to my impex file? Thanks

1

1 Answers

2
votes
  1. First, put your image (.svg) under : powertoolsstore\resources\powertoolsstore\import\sampledata\contentCatalogs\powertoolsContentCatalog\images\theme\.

  2. Then, next create a Media with the code my_default_logo.svg using this impex :

## in : cms-content.impex

$contentCatalog=powertoolsContentCatalog
$contentCV=catalogVersion(CatalogVersion.catalog(Catalog.id[default=$contentCatalog]),CatalogVersion.version[default=Staged])[default=$contentCatalog:Staged]
$media=media(code, $contentCV);

$siteResource=jar:de.hybris.platform.powertoolsstore.constants.PowertoolsStoreConstants&/powertoolsstore/import/sampledata/contentCatalogs/$contentCatalog

INSERT_UPDATE Media;$contentCV[unique=true];code[unique=true];realfilename;@media[translator=de.hybris.platform.impex.jalo.media.MediaDataTranslator];mime[default='image/jpeg'];altText;folder(qualifier)[default='images']
;  ;my_default_logo.svg  ;default_logo.svg ;$siteResource/images/theme/default_logo.svg ;image/png; ;

Note : that this variable $siteResource refers to powertoolsstore\resources\powertoolsstore\import\sampledata\contentCatalogs\powertoolsContentCatalog\.

  1. And finally attach the new created Media to the SiteLogoComponent :
## in : cms-content_en.impex

$lang=en
$contentCatalog=powertoolsContentCatalog
$contentCV=catalogVersion(CatalogVersion.catalog(Catalog.id[default=$contentCatalog]),CatalogVersion.version[default=Staged])[default=$contentCatalog:Staged]
$picture=media(code, $contentCV);

INSERT_UPDATE SimpleBannerComponent;$contentCV[unique=true];uid[unique=true];$picture[lang=$lang]
;;SiteLogoComponent; my_default_logo.svg

Note : that you need to update cms-content_fr.impex and cms-content_de.impex and all other languages too.

  1. You should run a Synchronization of the Powertools Content Catalog (from : Staged to Online) otherwise you wont be able to see the changes in the front.