How to get all options by Property Name - shopware

i need all options name in twig file and set custom url each options.Get my custom property options in custom twig file.

Related

Hybris language not being encoded in URL

I have created my custom storefront b2c electronics and I found out that the LANG is not being persisted in the URL while I navigate through the page.
This is my local.properties site url config:
hac.webroot=/hac
customstorefront.webroot=
customstorefront.webroot=/custom
storefrontContextRoot=
website.custom.http=http\://custom.local\:9001/
website.custom.https=https\://custom.local\:9002/
This are my url patterns:
(?i)^https?://[^/]+(/[^?]*)?\?(.*\&)?(site=custom)(|\&.*)$
(?i)^https?://custom\.[^/]+(|/.*|\?.*)$
(?i)^https?://api\.hybrisdev\.com(:[\d]+)?/rest/.*$
(?i)^https?://localhost(:[\d]+)?/rest/.*$
Am I missing something?
To have the language as part of the Url, you also need to specify that this parameter is part of the UrlEncodingAttributes on your site. You can do this through an impex, or change it through backoffice
For example, something like this
INSERT_UPDATE CMSSite; uid[unique = true]; urlPatterns ; urlEncodingAttributes
; $siteUid ; (?i)^https?://custom\.[^/]+(|/.*|\?.*)$ ; language
If you also want the storefront to be part of the url, you also need to append it in this property like storefront,language.
Do note that the order in which you place the attributes also determines the order in which they appear in the url

Druplal view in twig is not rendered

new to drupal.
I have created a view called "my_view_2".
Inside my twig templates I use {{ my_view_2}} to render that view but nothing appears on the page.
If I declare the display of the view as page and assign a node to the view, then the view is rendered. But this way the node template is lost.
The above happens only to some views not very view I have and I can not find the differences between those that working and those that does not working.
any help is appreciated.
Looks like you want to create a view with some kind of display then use twig template to style it. If that's the case, then decide which twig template you want override and copy it over to your /theme folder.
Locate the template you wish to override.
Copy the template file from its base location into your theme folder.
(optionally) Rename the template according to the naming conventions in order to target a more specific subset of areas where the template is used.
Modify the template as you want.
With respect to views look at the below location for which template to copy/override :
core/themes/stable/templates/views/views-view.html.twig).
For example, if we want to override "views-view.html.twig" template for our view, the following template names are valid:
views-view--[viewid]--[view-display-id].html.twig
views-view--[viewid]--page.html.twig
views-view--block.html.twig
views-view--[viewid].html.twig
views-view.html.twig
Once you copy a template file into your theme and clear the cache, Drupal will start using your instance of the template file instead of the base version.
Reference:
Documentation:
https://www.drupal.org/docs/8/theming/twig/twig-template-naming-conventions
https://www.drupal.org/docs/8/theming/twig/working-with-twig-templates

Creating a custom url for an static html page

I need to create a page like http://www.example.com/strong and the file to support that are inside my docroot/strong/index.html.
Inside my docroot there are other folders with their index file as well. For example
docroot/site1/index.html
docroot/site2/index.html
docroot/strong/index.html
So when user types in http://www.example.com/strong it should open docroot/strong/index.html without changing the URL. Can I achieve this?

utilLocator.findUtil("com.liferay.portlet.asset.service.AssetEntryLocalServiceUtil") is undefined

I am using the below code in ADT custom template code
<#assign storageEngineUtil = utilLocator.findUtil("com.liferay.portlet.asset.service.AssetEntryLocalServiceUtil") />
But this is giving utilLocator.findUtil("com.liferay.portlet.asset.service.AssetEntryLocalServiceUtil") is undefined
Is there anything I'm missing here?
but
The util class AssetEntryLocalServiceUtil is not accessible from a Freemarker template.
What you're trying to do is to get access to AssetEntryLocalService. Access to Liferay services is restricted in ADT templates.
You can get instance to AssetEntryLocalService through ServiceLocator, but you have to tell Liferay to allow it.
Default configuration restricts access to serviceLocator variable (in portal.properties).
#
# Set a comma delimited list of variables the FreeMarker engine cannot
# have access to. This will affect Dynamic Data List templates, Journal
# templates, and Portlet Display templates.
#
freemarker.engine.restricted.variables=serviceLocator
The setting needs to be overridden to empty value in portal-ext.properties (ie. allow the usage of serviceLocator in templates).
Then you can finally call serviceLocator.findService to get the service.
<#assign assetEntryLocalService = serviceLocator.findService("com.liferay.portlet.asset.service.AssetEntryLocalService") />

Call a string value to create a meta tag?

I need to create meta tags for the seo of my website.
I am using WHMCS and a custom template
Any page is compiled through the header.tpl, footer.php page1.tpl and page1.php pages
What I tried was to add
">
to header.tpl which does add the line of code to the "output source"
and I added
$pgDesc = 'Any custom description';
to the page1.php
Somehow the echo $pgDesc does not call the value correct
Any ideas ?
Just add your metatags to header.tpl. And that's all. You can get your title/desctiption/keywords strings from various sources: whmcs variables, translation strings, and even some db.
See http://docs.whmcs.com/Seo

Resources