Hi All,
Iam developing a project in M 2.3.5. I have 2 external extensions say ex-A and ex-B. I want to use a block of code of ex-A into ex-B (preferably a button with functionality). How can I call or use it.
I tried below code in ex-B and added template file too, but didn't work,
<referenceContainer name="content"> <block class="class-of-ex-A" name="sl-login-button" before="-" template="template-file-of ex-A"/> </referenceContainer>
Please suggest!
Solved! Go to Solution.
Hi @rekharajas68ab ,
Can you try below way
1. Create the plugin b xml in custom theme.
Example if xml in which you are editing is exampleB_index_index.xml
Create the same in custom theme and add below code
<body> <referenceBlock name="exampleb-block-name"> !-- add block example A code here --! </referenceBlock> </body>
Hope this helps you!
Problem Solved! Click Kudos & Accept as Solution!
Hi @rekharajas68ab,
try to add only below code in ex-B
Example:
<block class = “class of ex-B->
<block class="class-of-ex-A" name="sl-login-button" before="-" template="template-file-of ex-A"/>
</block>
Flush cache and check the changes.
Hope this helps you!
Problem Solved! Click Kudos & Accept as Solution!
Thanks!
Will try the same.
@Nishu Jindal adding block didnt worked for me..is there any other way to get it?
Hi @rekharajas68ab ,
Can you try below way
1. Create the plugin b xml in custom theme.
Example if xml in which you are editing is exampleB_index_index.xml
Create the same in custom theme and add below code
<body> <referenceBlock name="exampleb-block-name"> !-- add block example A code here --! </referenceBlock> </body>
Hope this helps you!
Problem Solved! Click Kudos & Accept as Solution!