Multiple themes in plone.app.theming - themes

I am trying to apply a different html (theme) to my front-page (index.html) while all my other pages will have the same theme (index_in.html). I am trying it this way and was wondering why it is not working:
excerpted from my rules.xml:
...
<theme href="index_in.html" css:if-content="#visual-portal-wrapper" />
<rules css:if-content="#visual-portal-wrapper">
<theme href="index.html" if-path="front-page"/>
<theme href="index_in.html" />
...
Thank You

Try...
<rules css:if-content="#visual-portal-wrapper">
<theme href="index.html" if-path="front-page" />
<theme href="index_in.html" />
...
</rules>

If the front page has #visual-portal-wrapper, then the first will match that too and be used. Conditional themes are tried in the order they appear and the first one to match is used.

Related

Changing from magento plugin does not make effect , but changing from magento\vendor shows effect

I am pretty new to Magento and using Magento 2.2.6 to develop a plugin. I need to edit the search bar. So I added a file to my plugin folder
Plugin \view \frontend \ templates \ form.mini.phtml
This does not making any changes in my website. But when I put that same file into Magento \vendor \magento \module-search \view \frontend \templates\ form.mini.phtml . Now I want not to any files from that vendor folder. What can I do now ? Thank you.
Block form.mini.phtml define in Vendor\magento\module-search\view\frontend\layout\default.xml
<!--Vendor\magento\module-search\view\frontend\layout\default.xml -->
<referenceContainer name="header-wrapper">
<block class="Magento\Framework\View\Element\Template" name="top.search" as="topSearch" template="Magento_Search::form.mini.phtml" />
</referenceContainer>
Overwrite using layout in your module app\code\VendorName\view\frontend\layout\default.xml
edit file form.mini.phtml and put it to app\code\VendorName\view\frontend\templates\form.mini.phtml
<!-- app\code\VendorName\view\frontend\layout\default.xml -->
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="header-wrapper">
<block class="Magento\Framework\View\Element\Template" name="top.search" as="topSearch" template="VendorName_ModuleName::form.mini.phtml" />
</referenceContainer>
</body>
</page>
You can also overwrite the file in the theme without the layout file
edit file form.mini.phtml and put it to app\design\frontend\Vendor\ThemeName\Magento_Search\templates\form.mini.phtml

How to enable custom system configuration in Magento 2.3.*?

I am currently working on a Magento project where I have to add a custom system configuration to manage my hosts.
I followed an old configuration I have used in an old project which uses the Magento version 2.2.
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
<system>
<section id="catalog" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
<group id="config" translate="label" type="text" sortOrder="90" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Setup</label>
<field id="host" translate="label" type="text" sortOrder="67" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Host</label>
</field>
</group>
</section>
</system>
</config>
But starting from Magento 2.3 this solution doesn't work anymore.
Do I have to enable the configuration manually in order to see it in the admin configuration panel?
I tried your snippet and it works fine with me.
Maybe there is a confusion between the Catalog Tab (blue underline), and the 'Catalog Section' (yellow highlight) ?
Tell me if so, i'll give you the snippet that you need.
Inside the section, you are missing the following nodes:
<section ...>
<tab>$TAB</tab>
<label>$LABEL</label>
<resource>$RESOURCE</resource>
</section>

Change Version in Package.appxmanifest in Xamarin UWP

I want to change the value for Identity Version in below code
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" >
<Identity Name="Sample.Product " Publisher="CN=1234" Version="1.0.0.0" />
<mp:PhoneIdentity PhoneProductId="456" PhonePublisherId="0" />
</Package>
I tried changing using following XmlPoke code.
<XmlPoke XmlInputPath="Package.appxmanifest" Namespaces="<Namespace Prefix='n' Uri='http://schemas.microsoft.com/developer/vsx-schema/2011' Name='N' />" Query="/n:Package/n:Identity/#Version" Value="$(Version)" />
the line doesn't change the version.
Whats going wrong in above code?
Identity, which you're looking for, is in the default namespace of Package, so in your XmlPoke you'll need to use that namespace. To do that, change the URI of your XmlPoke to be http://schemas.microsoft.com/appx/manifest/foundation/windows10, like so:
<XmlPoke XmlInputPath="Package.appxmanifest" Namespaces="<Namespace Prefix='n' Uri='http://schemas.microsoft.com/appx/manifest/foundation/windows10' />" Query="/n:Package/n:Identity/#Version" Value="$(Version)" />

Error validating a simple FHIR resource based on profile

I am currently trying to build some examples for using profiles with complex extensions, but they all fail to validate on SIMPLIFIER and my local HAPI-FHIR server.
I got a simple profile https://simplifier.net/Velferd-test-og-lek/test-flag/~overview
This one has two timestamps, and one of them is mandatory.
When I try to implement it like this (https://simplifier.net/Velferd-test-og-lek/Flag-example-2/~xml):
<Flag>
<meta>
<profile value="http://ehelse.no/fhir/vft/STU3/StructureDefinition/test-flag" />
</meta>
<extension url="kodeverdi">
<extension url="http://ehelse.no/fhir/vft/STU3/StructureDefinition/vft-timestamp">
<valueDateTime value="2017-05-09T10:00:00.936+02:00" />
</extension>
</extension>
<extension url="kodeverdi-obligatorisk">
<extension url="http://ehelse.no/fhir/vft/STU3/StructureDefinition/vft-timestamp">
<valueDateTime value="2017-05-09T11:00:00.936+02:00" />
</extension>
</extension>
<identifier>
<value value="test-id" />
</identifier>
<status value="active" />
<code>
<text value="Bruker utenfor Geofence" />
</code>
<subject>
<identifier>
<system value="http://ehelse.no/fhir/identifiertypes/FNR" />
<value value="05073500186" />
</identifier>
</subject>
</Flag>
The example fails to validate because it supposedly don't contain a "kodeverdi-obligatorisk" element.
ERROR on SIMPLIFIER: Instance count for 'Flag.extension:kodeverdi-obligatorisk' is 0, which is not within the specified cardinality of 1..1
I guess there is some problem related to naming the "kodeverdi-obligatorisk" element so that the validator recognize it, but I have tried different approaches and they all fail somehow.
Any help is appreciated.
Thomas
The outer URL needs to be a full URL. The inner URL can be just a string if you're dealing with a complex extension.
i.e. This might be legal:
<extension url="http://ehelse.no/fhir/vft/STU3/StructureDefinition/kodeverdi">
<extension url="http://ehelse.no/fhir/vft/STU3/StructureDefinition/vft-timestamp">
<valueDateTime value="2017-05-09T10:00:00.936+02:00" />
</extension>
</extension>
or this
<extension url="http://ehelse.no/fhir/vft/STU3/StructureDefinition/vft-timestamp">
<valueDateTime value="2017-05-09T10:00:00.936+02:00" />
</extension>
Exactly what's legal depends on the StructureDefinition that defines your extensions

Change 'command' in a binding using xbl:inherits

I'm making an application that runs in XULRunner on Windows.
There I created the browser-toolbar binding that will be used in different places. While the binding needs to look the same it should execute different commands on button clicks.
I'm trying to accomplish it like this (code is simplified, namespaces are dropped):
<binding id="custom-browser-type-a">
<content>
<commandset>
<command id="TypeA:Home" oncommand="home()"/>
<command id="TypeA:Back" oncommand="back()"/>
</commandset>
<browser-toolbar cmd_home="TypeA:Home" cmd_back="TypeA:Back" ... />
<browser/>
</content>
<implementation>
...
</implementation>
</binding>
<binding id="browser-toolbar">
<content>
<toolbar>
<toolbarbutton label="Home" xbl:inherits="command=cmd_home"/>
<toolbarbutton label="Back" xbl:inherits="command=cmd_back"/>
...
</toolbar>
</content>
</binding>
Once clicked a toolbarbutton execute an assigned command just fine. The problem is when I disable a command it doesn't affect the disabled state of a corresponding toolbarbutton, it stays enabled. Does anyone have any idea why that is not working?
Thank you!

Resources