1

Topic: Allow target to be overridden by base target html

I'm working on something that loads in an iframe, and am using the base target attribute in the html template to make links load in the parent doc. It looks like tinymce is explicitly overriding it with target="_self" but I don't see that anywhere in my valid elements in textareas.js. In extended_valid_arguments I can see a[name|href|target=_blank which is allowable as a choice. I would rather just not set the target attribute here and set it as a base target in the html, but if I have to set it here, would I just put a target=_parent in valid elements?
And if anyone can tell me how to lose the target=_self override, I would be grateful, that would be a better solution, cause I would only have to change it in one easy place if I wanted to change it!
Thanks,
Wendy

2

Re: Allow target to be overridden by base target html

Maybe you can share some code? Not really sure where the override is happening...

3

Re: Allow target to be overridden by base target html

I think it was selected in the admin, if admins can select "open in the same window" when they create a link, it will write target="self". Is there an easy way I can lose that option for now? I've changed the default to target=_parent but would like to lose the option.
<code>
  theme : "advanced",
    theme_advanced_toolbar_location : "top",
    theme_advanced_toolbar_align : "left",
        theme_advanced_buttons1 : "fullscreen,separator,preview,separator,bold,italic,underline,strikethrough,separator,bullist,numlist,outdent,indent,separator,undo,redo,separator,link,unlink,anchor,separator,image,cleanup,help,separator,code",
    theme_advanced_buttons2 : "",
    theme_advanced_buttons3 : "",
    auto_cleanup_word : true,
    valid_elements : "@[id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|"
+ "onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|"
+ "onkeydown|onkeyup],a[rel|rev|charset|hreflang|tabindex|accesskey|type|"
+ "name|href|target|title|class|onfocus|onblur],b/strong,i/em,strike,u,"
+ "#p,-ol[type|compact],-ul[type|compact],-li,br,img[longdesc|usemap|"
+ "src|border|alt=|title|hspace|vspace|width|height|align],-sub,-sup,"
+ "-blockquote,-table[border=0|cellspacing|cellpadding|width|frame|rules|"
+ "height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|"
+ "height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,"
+ "#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor"
+ "|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,-div,"
+ "-span,-code,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],-font[face"
+ "|size|color],dd,dl,dt,cite,abbr,acronym,del[datetime|cite],ins[datetime|cite],"
+ "object[classid|width|height|codebase|*],param[name|value|_value],embed[type|width"
+ "|height|src|*],script[src|type],map[name],area[shape|coords|href|alt|target],bdo,"
+ "button,col[align|char|charoff|span|valign|width],colgroup[align|char|charoff|span|"
+ "valign|width],dfn,fieldset,form[action|accept|accept-charset|enctype|method],"
+ "input[accept|alt|checked|disabled|maxlength|name|readonly|size|src|type|value],"
+ "kbd,label[for],legend,noscript,optgroup[label|disabled],option[disabled|label|selected|value],"
+ "q[cite],samp,select[disabled|multiple|name|size],small,"
+ "textarea[cols|rows|disabled|name|readonly],tt,var,big",

    extended_valid_elements : "a[name|href|target=_parent|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]"

});
</code>

4

Re: Allow target to be overridden by base target html

I see I can comment line 145 in link.js out for now, to lose target=_self

lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_same'), '_self');

I'll have to remember to find it and do it when I upgrade. If anyone has a better solution, let me know. I can't trust that admins will remember that they can't use this option.
Thanks!