2

I want the users who download and install my extension from the marketplace to go through a registration/login flow. Since the normal system.xml file supports only static pages and doing the entire thing using FE models is too complicated, I'm wondering if I can instead show everything in an iframe?

Showing everything in an iframe gives me lot of advantages like -

  • Flexibility over design. Magento buttons/elements are ugly.
  • Being able to use the same iframe my other eCommerce offerings
  • Much much less engineering time since our team is much more comfortable with JavaScript/CSS than PHP/XML etc

So my question is how to implement the iframe and are there any disadvantages that I'm missing?

I see its possible for Magento 1

Prince Patel
23.1k10 gold badges102 silver badges124 bronze badges
asked May 4, 2017 at 22:12
2

2 Answers 2

1
+50

You need to create custom type in form

$fieldset->addType('map', '\Vendor\Module\Block\Adminhtml\Youblock\Renderer\Map');
$fieldset->addField(
 'file',
 'map',
 [
 'name' => 'map',
 'label' => __('Map'),
 'title' => __('Map'),
 ]
);

app/code/Vendor/Module/Block/Adminhtml/Yourblock/Renderer/Map.php

<?php
namespace Vendor\Module\Block\Adminhtml\Yourblock\Renderer;
use Magento\Framework\DataObject;
class Map extends \Magento\Framework\Data\Form\Element\AbstractElement
{
 public function getElementHtml()
 {
 $iframe = "<iframe>Your iframe Here</iframe>";
 return $iframe;
 }
}
answered May 14, 2017 at 18:57
0

As with frontend, you can implement a custom backend theme. As part of your custom theme, you can define and include a .phtml template which can include arbitrary HTML, CSS, Javascript, and PHP -- i.e. you can include an iframe via a template.

If you are not yet familiar with adding a template to your theme, I would get started with the DevDocs Frontend Developer Guide: Templates overview.

answered May 11, 2017 at 13:57

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.