Change logo on Hybris through addon - sap-commerce-cloud

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

First, put your image (.svg) under : powertoolsstore\resources\powertoolsstore\import\sampledata\contentCatalogs\powertoolsContentCatalog\images\theme\.
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\.
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.
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.

Related

How to add another description block outside the tabs in product detail page

I am using Magento 2.2.4. I need to add a block for product detail outside from the main 'Details', 'Review' tabs. I need this block to be separated after the main description of the product. How can I do this? I have started doing this with a custom theme but no idea how to do this.
Enable Path and block hint from magento admin->configuration->developer->debug
then you can see which block is rendering the product review
then you can move the block by
<move element="Your_block_name" destination="where_to_move" />
dont edit core files ,copy files from vendor->magento->magento catalog to
app\design\frontend\your_namespace\your_theme\Magento_Catalog
then do the changes in respective files,
after change
flush,clean cache, reindex and deploy static content

Issue in creating Layout in Liferay DXP

I am trying to create a layout in Liferay DXP using themegenerator by following this link : https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-0/creating-layout-templates-with-the-themes-generator-0.
On successful completion of the steps mentioned in the link, -layouttpl gets generated but .tpl file and .png file are not getting generated. What can be the issue?
I created layout with theme generators, but i found inside 'yourlayoutname/docroot'.
Please make sure you followed all steps, mentioned in - in document you shared link. Once you created layout, you have to define rows and columns of layout. Pls make sure you followed all instructions.

Typo3 FAL show file browser popup in backend module

I have a site which shows a teaser (image+text) on all pages.
This should be editable from admin, so I created a small backend module (a simple form) where the admin should set the image and the text and save them in Typo3's registry db table:
This is how I save the text:
$request = $this->controllerContext->getRequest();
$arguments = $request->getArguments();
$registry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( 't3lib_Registry' );
$extKey = $request->getControllerExtensionKey();
$registry->set( $extKey, 'text', $arguments['settings']['text'] );
but I don't know how to add an "Add image" link to display the file browser and get the url/id of the selected file.
Any ideas?
Thanks.
In order to have a file picker you will need to have a TCA for a FAL field. A TCA is usually connected to a table and I wouldn't know of any implementation with the registry as a "storage backend".
This means you would have to create TCEForms yourself and then intercept the saving process. This is possible but rarely used and rather complicated, see an example here:
https://git.typo3.org/Packages/TYPO3.CMS.git/blob/TYPO3_4-5:/typo3/sysext/version/ws/workspaceforms.php
(for TYPO3 4.x, for 6.x the class names have to be adjusted)
So I would suggest that you extend the table pages with a field for text and a FAL field instead of trying to write an own backend module for this purpose.

register locale css file in master page in SharePoint 2010

How can i register locale css file in master page with using SharePoint Designer in website having different variations.
Like following line render style library folder
masterpage :
render: http://localSP/Style Library/MyFolder/sn.css (Correct)
How can i register css in master page so that it provide following
required render: http://localSP/Style Library/fr-FR/MyFolder/sn.css (if its French varition)
masterpage :
Thanks
I think you have to manually create that css file under french variation. fr-FR is a sub-site, so try to navigate there and put the artifact there.

Need to have separate "complete" Drupal theme for each page on a site

I want to build a Drupal demonstration site where I can create several custom themes and display each on a separate page of the site. Access can be either via links or menu items. The "simpler" the solution the better.
Create a custom block that executes PHP code. The following code snippet should show the current page in the theme set in $custom_theme.
global $custom_theme, $theme;
// If $theme is set, init_theme() will not initialize the custom theme.
unset($theme);
// Set the theme you want to use.
$custom_theme = "garland";
init_theme();
There is also a module that allows you to change the used theme based on some rules (in example, the content type being showed, the URL of the page being viewed, etc): the project page is http://drupal.org/project/themekey.

Resources