0

I need to add ttl="3600" to a referenceBloc, I would override the whole catalogsearch_result_index.xml but there are some third parties modules that crash if I override the whole file.

so I tried this inside VENDOR/MODULE/view/frontend/layout/catalogsearch_result_index.xml

<referenceBlock name="search.result">
            <arguments>
                <argument name="attributes" xsi:type="array">
                        <item name="ttl" xsi:type="string">3600</item>
                </argument> 
            </arguments>
        </referenceBlock>

but I don't know if it's working in this way.

If I directly add ttl="3600" in the block declaration of the file on vendor/magento/module-catalog-search/view/frontend/layout/catalogsearch_result_index.xml

It seems that works, but this is a ReferenceBlock and I don't know how to do it this way.

Thanks and greetings!

1 Answer 1

0

Simply use as below.

No need to pass ttl as argument.

<referenceBlock name="search.result" ttl="3600" />
1
  • no it does not work like this, I tried it and the error message was "no ttl is supporte on referenceBlock", also on Magento 2 documentation it says there are only 2 attributes for referenceBlock, remove and display. Apr 5, 2022 at 13:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.