• Resolved halukaydogan

    (@halukaydogan)


    Hi I want my admin panel a menu and when I click on it , I want it to open a iframe page .. How can I do that.. Thanks

Viewing 10 replies - 1 through 10 (of 10 total)
  • Hi halukaydogan,

    As per my understanding your requirement is to add a custom link in admin section which when click would render a admin page with IFrame.

    Considering this, I would suggest you to attach a custom function to ‘admin_menu’ hook. And register a new admin page using ‘add_menu_page’ method.

    please add following code in "functions.php" file of your active template.
    
    add_action( 'admin_menu', 'register_external_link_menu_page' );
    
    function register_external_link_menu_page(){
    	add_menu_page( 'External Link', 'External Link', 'manage_options', 'external_link', 'external_link_menu_page', '', 80 );
    }
    
    function external_link_menu_page(){
    	echo "<h2>External Link Page</h2>";
            echo '<iframe src="https://codex.www.ads-software.com" width="100%" height="550"></iframe>';
    }

    Hope this solution is what you are looking for.

    Thanks

    Thread Starter halukaydogan

    (@halukaydogan)

    Thanks very much=) one more question: if I want 2 or more external link?

    If in case you require more external links then I would suggest you use add_subpage_menu() method.

    I have modified the code for your reference, please check the code snippet-

    add_action( 'admin_menu', 'register_external_link_menu_page' );
    
    function register_external_link_menu_page(){
        add_menu_page( 'External Link', 'External Link', 'manage_options', 'external_link', 'external_link_menu_page', '', 80 );
        add_submenu_page( 'external_link', 'External Link 2', 'External Link 2', 'manage_options', 'external_link_menu_page', 'external_link_submenu_page2');
    }
    
    function external_link_menu_page(){
    	echo "<h2>External Link Page</h2>";
            echo '<iframe src="https://codex.www.ads-software.com" width="100%" height="550"></iframe>';
    }
    
    function external_link_submenu_page2(){
    	echo "<h2>External Link2 Page</h2>";
            echo '<iframe src="https://codex.www.ads-software.com" width="100%" height="550"></iframe>';
    }

    Thanks.

    Thread Starter halukaydogan

    (@halukaydogan)

    Yeah that is and everything perfect just except when I click the link in admin menu it tells ” the server refuse to connection” ..

    Thread Starter halukaydogan

    (@halukaydogan)

    also thanks very much for your time this was a big problem for me…

    Thread Starter halukaydogan

    (@halukaydogan)

    }
    add_action( ‘admin_menu’, ‘register_external_link_menu_page’ );

    function register_external_link_menu_page(){
    add_menu_page( ‘External Link’, ‘External Link’, ‘manage_options’, ‘external_link’, ‘external_link_menu_page’, ”, 80 );
    add_submenu_page( ‘external_link’, ‘External Link 2’, ‘External Link 2’, ‘manage_options’, ‘external_link_menu_page’, ‘external_link_submenu_page2’);
    }

    function external_link_menu_page(){
    echo “<h2>External Link Page</h2>”;
    echo ‘<iframe src=”https://dashboard.tawk.to&#8221; scrolling=”no” frameborder=”0″ align=”center” height = “800px” width = “100%” name=”Tawk.To”, border=”0″>
    </iframe>’;
    }

    function external_link_submenu_page2(){
    echo “<h2>External Link2 Page</h2>”;
    echo ‘<iframe src=”https://mail.godiamond.org/Mondo/lang/sys/Login.aspx&#8221; scrolling=”no” frameborder=”0″ align=”center” height = “800px” width = “100%” name=”Tawk.To”, border=”0″>
    </iframe>’;
    }

    Thread Starter halukaydogan

    (@halukaydogan)

    with this code it is done thank?s very very very much again.. I hope you go to heaven for that,=)

    Thread Starter halukaydogan

    (@halukaydogan)

    it is not a overreact =) just spending my time for 2 days and in 1 hour it is done.. I feel very happy=)

    Thread Starter halukaydogan

    (@halukaydogan)

    add_action( ‘admin_menu’, ‘register_external_link_menu_page’ );

    function register_external_link_menu_page(){
    add_menu_page( ‘External Link’, ‘External Link’, ‘manage_options’, ‘external_link’, ‘external_link_menu_page’, ”, 80 );
    add_submenu_page( ‘external_link’, ‘External Link 2’, ‘External Link 2’, ‘manage_options’, ‘external_link_menu_page’, ‘external_link_submenu_page2’);
    add_submenu_page( ‘external_link’, ‘External Link 2’, ‘External Link 2’, ‘manage_options’, ‘external_link_menu_page’, ‘external_link_submenu_page3’);
    }

    function external_link_menu_page(){
    echo ‘<iframe src=”https://dashboard.tawk.to&#8221; scrolling=”no” frameborder=”0″ align=”center” height = “800px” width = “100%” name=”Tawk.To”, border=”0″>
    </iframe>’;
    }

    function external_link_submenu_page2(){
    echo ‘<iframe src=”https://mail.godiamond.org/Mondo/lang/sys/Login.aspx&#8221; scrolling=”no” frameborder=”0″ align=”center” height = “800px” width = “100%” name=”Tawk.To”, border=”0″>
    </iframe>’;
    }

    function external_link_submenu_page3(){
    echo ‘<iframe src=”https://neden.godiamond.org&#8221; scrolling=”no” frameborder=”0″ align=”center” height = “800px” width = “100%” name=”Tawk.To”, border=”0″>
    </iframe>’;
    }

    Thread Starter halukaydogan

    (@halukaydogan)

    in that code , subdomains links open in same windows.. there is 2 link but 2 of them in same area.. where is the wrong?

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘I want to add my admin panel "a menu" and inside it a iframe page’ is closed to new replies.