No Comments

Magento 2: How to show request variable in Layout file

Count Number of Associated Products Assigned to a Configurable Product
Magento 2 Unable to open CMS Pages

http://localhost/magento2/module/List/Variable

Here Variable is my dynamic value, which would like to show in Breadcrumb & Title via Layout File.

appcodeCustomModuleviewfrontendlayoutmodule_list_index.xml

<?xml version="1.0" encoding="UTF-8"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="page.main.title" display="true">
            <action method="setPageTitle">
                <argument name="title" translate="true" xsi:type="string">e-Trade | List {request var goes here}</argument>
            </action>
        </referenceBlock>
        <referenceBlock name="breadcrumbs">
            <action method="addCrumb">
                <argument name="crumbName" xsi:type="string">Home</argument>
                <argument name="crumbInfo" xsi:type="array">
                    <item name="title" xsi:type="string">List</item>
                    <item name="label" xsi:type="string">List</item>
                    <item name="link" xsi:type="string">{request var goes here}</item>
                </argument>
            </action>
        </referenceBlock>
    </body>
</page>     

Related Posts

  • Magento 2: Use Custom Variable in Layout File (1)
    We can use Magento default variables in layout file using <item name="link" xsi:type="string">{{baseUrl}}</item> I would like to create one variable in Block File & Use it. Like protected function _prepareLayout() { parent::_prepareLayout(); […]
  • Magento 2: Use Custom Variable in Layout File (1)
    We can use Magento default variables in layout file using <item name="link" xsi:type="string">{{baseUrl}}</item> I would like to create one variable in Block File & Use it. Like protected function _prepareLayout() { parent::_prepareLayout(); […]
  • Magento 2: Use Custom Variable in Layout File (1)
    We can use Magento default variables in layout file using <item name="link" xsi:type="string">{{baseUrl}}</item> I would like to create one variable in Block File & Use it. Like protected function _prepareLayout() { parent::_prepareLayout(); […]
  • Dynamic h1 title dependent on adwords or google search term(s) (0)
    http://uitlaat-winkel.nl/katalysator-vervanger-voor-volkswagen-golf-2-golf-3-jetta-2-5ento.html?gclid=CM3vqJj9v8sCFWoz0wodE6cHlg Suppose we have this title: Exhaust for Volkswagen Golf 2 / Golf 3 / Jetta 2 / Vento Is there an easy way to do something like: IF customer used google […]
  • How To Find Product Title title.phtml? (1)
    This file path is listed for the product title on the product details page when I turn on the developer hints: /public_html/vendor/magento/module-theme/view/frontend/templates/html/title.phtml But there is no file under vendor/magento/theme-frontend-blank.... How do you find the […]
  • How do I create a Custom Variable that actually… varies? (0)
    I see when I click Insert Variable, there's a list of System Variables (Base URL, Store Name, etc.), and I see there are places in System where I can define these. Equally, I see that I have some specific variable in my email templates that (I don't think) I can access, such as […]
  • Magento 2: Widget on specific page layout (0)
    I would like to choose my own page layout for a CMS page (Design -> Page Layout -> Layout) and then be able to show a widget on all CMS pages that has this page layout. I've managed to solve the first part by adding my layout file in module-dir/view/frontend/page_layout/ and […]
  • Setting different title and meta title for a page (2)
    I'm creating a simple page in my Magento 2 instance. in the controller for that page I'm trying to set a title for the page and a meta title that should be different. But I'm not able to do that. My layout file for the action is almost empty: <page layout="1column" […]
  • How to utilise the existing LESS variables in my new less file (1)
    As the title says, i want to use LESS variables that are already defined by Magento. for example, there is variable called @color-white defined in following file. ROOT/lib/web/css/source/lib/variables/_colors.less and i want to use that in my own less file that located in my […]
  • Magento 2: Year wise Product Display Layout Change on Category Page (2)
    I have attribute as Year for Product. Would like to display product's on basis of Year. I already created Year Attribute & assign it for Sorting as well. Attached image for reference. How to achieve this? When it clicks on Year or View More it will display all products […]
Count Number of Associated Products Assigned to a Configurable Product
Magento 2 Unable to open CMS Pages

Be the first to post a comment.

Add a comment

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax