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,865 Views
(@taron)
Posts: 8
Active Member
 

@editor You seem to know everything ! Works great, many thanks.


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

@editor You seem to know everything ! Works great, many thanks.

I don't know everything. I just know how and where to search.

 


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

For webmasters that use Osclass 5.x or later, the same applies.

Open oc-includes/osclass/functions.php and find

<script>
tinyMCE.init({
mode: 'none',
theme_advanced_toolbar_align: 'left',
theme_advanced_toolbar_location: 'top',
theme_advanced_buttons1_add: 'forecolorpicker,fontsizeselect',
theme_advanced_buttons2_add: 'media',
plugins: 'advlist autolink lists link charmap preview anchor searchreplace visualblocks code fullscreen table paste'
});
$(function () {
$('textarea[id^=description]').each(function () {
tinyMCE.execCommand('mceAddEditor', true, this.id);
});
});
</script>

 

and change it to

 

<script>
tinyMCE.init({
mode: 'none',
theme_advanced_toolbar_align: 'left',
theme_advanced_toolbar_location: 'top',
theme_advanced_buttons1_add: 'forecolorpicker,fontsizeselect',
theme_advanced_buttons2_add: 'media',
extended_valid_elements : "a[href|target=_blank|rel=nofollow]",
plugins: 'advlist autolink lists link charmap preview anchor searchreplace visualblocks code fullscreen table paste'
});
$(function () {
$('textarea[id^=description]').each(function () {
tinyMCE.execCommand('mceAddEditor', true, this.id);
});
});
</script>

 


 
Posted : September 29, 2021 16:16
(@paolo)
Posts: 9
Active Member
Topic starter
 

I wonder if there is an other and easier way to do this. Because in each update, you will have to make those changes.

If there a way to open any link in posts and custom fields in a new window and of cource make them nofollow?


 
Posted : September 29, 2021 16:24
Editor
(@editor)
Posts: 551
Honorable Member Admin
 
Posted by: @paolo

I wonder if there is an other and easier way to do this. Because in each update, you will have to make those changes.

If there a way to open any link in posts and custom fields in a new window and of cource make them nofollow?

Probably there is, but we are not developers here. So we can't help with this.


 
Posted : September 29, 2021 18:52
Page 2 / 2