I want to change to override a block's template with my custom template. But it does not have a "name", it only has a "as".
The one I want to override is:
<block class="Magento\Sales\Block\Adminhtml\Order\View\Items\Renderer\DefaultRenderer"
as="default"
template="order/view/items/renderer/default.phtml"/>
Best Answer
This answer is a possible example, you can follow this to override ALIAS template.
I have created two example modules,
Vendor_Module
has layout with alias template, We are overriding this alias byVendortwo_Moduletwo
module.Assume you know the steps to create module, i am not posting entire module creation.
Module 1
\app\code\Vendor\Module\etc\frontend\routes.xml
\app\code\Vendor\Module\view\frontend\layout\module_test_test.xml
Module 2
\app\code\Vendortwo\Moduletwo\etc\frontend\routes.xml
\app\code\Vendortwo\Moduletwo\view\frontend\layout\default.xml
After removing cache, i run http://localhost/magento210/module/test/test
The alias template is override by
Vendortwo_Moduletwo
two/twoalias.phtml