Is it possible in Magento 2 to create a new cms block(using widget) with content of an existing block, and admin can change the images, links and text of new block????
Actually, I need a template(widget), and it should be called in different pages. For different pages, I need to change the template's images, text and links. For example, I have a cms block for showing these images on homepage
Now, I need the same block for some other page, but I need options to change images(using image uploader), texts and links... Any help will be appreciated... Thanks
-
Can you please explain/elaborate ?Arun Karnawat– Arun Karnawat2016年09月13日 09:55:41 +00:00Commented Sep 13, 2016 at 9:55
-
@Arun, I have edited my question. Please check...Hima Mohan– Hima Mohan2016年09月13日 12:49:46 +00:00Commented Sep 13, 2016 at 12:49
-
is the content dynamic or static ?Arun Karnawat– Arun Karnawat2016年09月14日 05:12:28 +00:00Commented Sep 14, 2016 at 5:12
-
content is dynamic.Hima Mohan– Hima Mohan2016年09月14日 05:17:47 +00:00Commented Sep 14, 2016 at 5:17
1 Answer 1
You can call a phtml template in you static block and write you logic in the template file
Create a block with content
{{block class="Magento\Framework\View\Element\Template" template="Magento_Theme::html/dynamic-images.phtml"}}
then create a template file dynamic-images.phtml under \app\design\frontend\<Vendor>\<Theme_Name>\Magento_Theme\templates\html
and write you dynamic code in dynamic-images.phtml.
don't forget to clear cache (php bin/magento cache:clean) every time you make changes to dynamic-images.phtml.
I hope you know how to create a widget.