Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4250758
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T04:34:16+00:00 2026-05-21T04:34:16+00:00

I am trying to change the image_list_url of tiny_mce to php file. I changed

  • 0

I am trying to change the image_list_url of tiny_mce to php file.

I changed the url to image_list.php file. It generated the exact output text same as the js file.

But even after giving same output it doesn’t show’s the image list.

I am wondering if the content-type is affecting it or not?

my JS file content:

// This list may be created by a server logic page PHP/ASP/ASPX/JSP in some backend system.
// There images will be displayed as a dropdown in all image dialogs if the "external_link_image_url"
// option is defined in TinyMCE init.

var tinyMCEImageList = new Array(
    // Name, URL
    ["Logo 1", "media/logo.jpg"],
    ["Logo 2 Over", "media/logo_over.jpg"]
);

my PHP COde:

<?php
    require('../../../system/config.php');
    $strPath = APP_ROOT.DS.'sys_uploads/images/';
    $objFileList = dir( $strPath );
    $arrFileList = array();
    while (false !== ($entry = $objFileList->read())) {
        if( is_file( $strPath.$entry) )
            $arrFileList[] = array($entry, ABS_URL.'/sys_uploads/images/'.$entry);
    }
    $objFileList->close();

    header('Content-type: application/x-javascript');
    //header('Content-type: text');
?>
// This list may be created by a server logic page PHP/ASP/ASPX/JSP in some backend system.
// There images will be displayed as a dropdown in all image dialogs if the "external_link_image_url"
// option is defined in TinyMCE init.

var tinyMCEImageList = new Array(
    // Name, URL
 <?php
    if( count( $arrFileList )>0 )
        foreach( $arrFileList as $dataRow ):
 ?>
    ["<?php echo $dataRow[0];?>", "<?php echo $dataRow[1];?>"],
 <?php endforeach; ?>
);

my PHP Output:

// This list may be created by a server logic page PHP/ASP/ASPX/JSP in some backend system.
// There images will be displayed as a dropdown in all image dialogs if the "external_link_image_url"
// option is defined in TinyMCE init.

alert('test working or not');

var tinyMCEImageList = new Array(
    // Name, URL
    ["Logo 1", "media/logo.jpg"],
    ["Logo 2 Over", "media/logo_over.jpg"]
);

Edit:

As per suggestion i even added a popup message too which even didn’t show up.

Solution:

dun know what was error on my code but found good solution from link suggested:

http://tinymce.moxiecode.com/wiki.php/Configuration%3aexternal_image_list_url

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T04:34:16+00:00Added an answer on May 21, 2026 at 4:34 am

    As both the .js and your PHP file outputs are identical, there should be no difference. text/javascript is the most widely supported mime type for JS, so using that might help.

    It would also not hurt to name your dynamically generated JS files using a convention such as XYZ.php.js and using mod_rewrite to parse the php.js files as php.

    Edit:

    Also, per official TinyMCE docs, please make sure that there is no whitespace before the <?php opening tag in the dynamically generated JS, also check for UTF8 BOM which can be a sneaky cause of invisible output.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I changed image of cursor. I am trying to change size of cursor image
hi i am trying to change back ground on the menu i created but
I am trying to change desktop image using below code: NSError *anError = nil;
Im working in WPF and I am trying to change the image of a
I am trying to change the background image of a link when it get
I'm trying to make an image change its rotation between 2 position in an
Please see the attached image. I'm trying to change the color on the segmented
I am trying to click on an image and change it to another image
I am trying to get a WordPress image to change based on which tab
I'm trying change an input mask for textbox when the the check box has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.