McClausky’s fix on this link fixed it for me.
http://modxcms.com/forums/index.php/topic,45675.0.html
- snip -
Sorry there’s a typo in the last chunk of code (a double quotation mark). The correct line should be: Code:
var oOption = document.createElement("OPTION") ;
I just tested this on a new installation of Evo 1.0 and 1.0.2 and if works fine.
- snip -
I can now browse to the image folder, for linking.
Thanks, McClausky!
Peter
Quote from: amazon3d at Mar 25, 2009, 02:50 AM
I am having this same issue. I can’t link to images. Anyone find a workaround for the newer versions?
Here’s the solution:
Open manager\media\browser\mcpuk\frmresourcetype.html. In order to enable the Resource Browser to display all File Types (images, files, media, etc), comment line 46 and 47:
/* McCommented if ( !bHasType || aTypes[i][0] == oConnector.ResourceType ) AddSelectOption( cmbTypeObj, aTypes[i][1], aTypes[i][0] ) ; */
And add the following lines after it:
/*McAdded */ /* http://modxcms.com/forums/index.php/topic,13450.msg181280.html#msg181280 */ // IF type is the same, we have to make the option ""selected"" if ( !bHasType || aTypes[i][0] == oConnector.ResourceType) { AddSelectOptionSelected( cmbTypeObj, aTypes[i][1],aTypes[i][0] ) ; } else // IF not, only add this option { AddSelectOption( cmbTypeObj, aTypes[i][1],aTypes[i][0] ) ; } /* END McAdded */
Then, open manager\media\browser\mcpuk\js\common.js, and to enable the Resource Browser to display all File Types, the following function has to be added at the beginning of everything:
/* McAdded */ /* http://modxcms.com/forums/index.php/topic,13450.msg181280.html#msg181280 */ function AddSelectOptionSelected( selectElement, optionText, optionValue, optionSelected ) { var oOption = document.createElement("OPTION") ; oOption.text = optionText ; oOption.value = optionValue ; oOption.setAttribute('selected', 'selected'); selectElement.options.add(oOption) ; return oOption ; } /* End McAdded */
Hope it helps.
Mc
I tried it in MODx 1.0.3 but it still don´t work for me. Is there an other solution?
What could I have done wrong?
I already tried it without success. Tried it on other browsers also no success
var oOption = document.createElement("OPTION") ;