How to make links i...
 
Notifications
Clear all

How to make links in a post to open in new window

12 Posts
3 Users
2 Reactions
1,864 Views
(@paolo)
Posts: 9
Active Member
Topic starter
 
[#123]

Hello.

Users post urls of their sites/services and those open in the same window. I have solved that problem in the custom urls (editing one core file) but not with links posted within richedit plugin (TinyMCE).

No matter what i tried, i can't figure this out.

thanks


 
Posted : September 6, 2019 13:18
Editor
(@editor)
Posts: 551
Honorable Member Admin
 

Hello and welcome.

So you mean to make urls in the body of the ad, posted using richedit plugin ?

Isn't that fixed if you change something in the code of Osclass core ? Not sure what you mean.

 


 
Posted : September 6, 2019 13:33
(@paolo)
Posts: 9
Active Member
Topic starter
 

ok. I have created a url field in Listings Custom fields. As URL type.

That i fixed.

If the BODY contains a url, i can't make it open to a new window.

Thanks


 
Posted : September 6, 2019 13:41
Editor
(@editor)
Posts: 551
Honorable Member Admin
 

Go to your richedit plugin folder and change the rich_edit.js file to this:

 

tinyMCE.init({
mode : "none",
theme : richedit.theme,
skin: richedit.skin,
width: richedit.width,
height: richedit.height,
skin_variant : richedit.skin_variant,
theme_advanced_buttons1 : richedit.theme_advanced_buttons1,
theme_advanced_buttons2 : richedit.theme_advanced_buttons2,
theme_advanced_buttons3 : richedit.theme_advanced_buttons3,
theme_advanced_toolbar_align : "left",
theme_advanced_toolbar_location : "top",
extended_valid_elements : "a[href|target=_blank|rel=nofollow]",
plugins : richedit.plugins
});

$(document).ready(function () {
$("textarea[id^=description]").each(function(){
tinyMCE.execCommand("mceAddControl", true, this.id);
});
});

 

and let me know if it works for you.


 
Posted : September 6, 2019 14:31
Taron reacted
(@paolo)
Posts: 9
Active Member
Topic starter
 

Yes that works very well, how did you find that solution ?

Anyways, thanks !!!


 
Posted : September 6, 2019 17:39
(@taron)
Posts: 8
Active Member
 

Hello.

Do you know if we can implement the same in Osclass 4.4 from Osclasspoint and how?

Thanks


 
Posted : June 19, 2021 20:11
Editor
(@editor)
Posts: 551
Honorable Member Admin
 

@taron Sure, the configuration in 4.4 is in oc-includes/osclass/functions.php.

Search for function osc_tinymce_item_script() and change it accordingly. Like this:

 

min_height: 350,
      max_height: 600,
      entity_encoding : "raw",
      theme_advanced_buttons1_add : "forecolorpicker,fontsizeselect",
      theme_advanced_buttons2_add: "media",
      theme_advanced_buttons3: "",
      theme_advanced_disable : "styleselect,anchor",
      extended_valid_elements : "a[href|target=_blank|rel=nofollow]",
	  relative_urls : false,
      remove_script_host : false,
      convert_urls : false,
      setup : function(editor) {

 
Posted : June 19, 2021 20:22
Taron reacted
Page 1 / 2