cancel
Showing results for 
Search instead for 
Did you mean: 

Get template script partially working on CMS page

Get template script partially working on CMS page

If i using sinlge script it is working,

 

{{block class="Amasty\Storelocator\Block\Location" name="location.block" template="Zero_Storelocator::home-page-mobile1.phtml" }}

If i add two more script it is not working,

 

{{block class="Amasty\Storelocator\Block\Location" name="location.block" template="Zero_Storelocator::home-page-mobile1.phtml" }}
{{block class="Amasty\Storelocator\Block\Location" name="location.block" template="Zero_Storelocator::home-page-mobile2.phtml" }}
{{block class="Amasty\Storelocator\Block\Location" name="location.block" template="Zero_Storelocator::home-page-mobile3.phtml" }}

Each script working when i call individually, if i call all the script at the same time first line of the script only working, the remaining script not working.

2 REPLIES 2

Re: Get template script partially working on CMS page

The problem here is block names used for all the scripts.
Block names should be unique (you added for all the blocks name="location.block").

So all the previous blocks will overridden by the last block that is why you are not able to see all three blocks at a time.
Try with below code

{{block class="Amasty\Storelocator\Block\Location" name="location.block1" template="Zero_Storelocator::home-page-mobile1.phtml" }}
{{block class="Amasty\Storelocator\Block\Location" name="location.block2" template="Zero_Storelocator::home-page-mobile2.phtml" }}
{{block class="Amasty\Storelocator\Block\Location" name="location.block3" template="Zero_Storelocator::home-page-mobile3.phtml" }}

 

Re: Get template script partially working on CMS page

Still not getting the value,

 

if i use it individually it is working,

 

if i add 3 script at the same time its not working.