Posted here as a suggested New Feature/enhancement to SOBI2
Problem: The existing URL type of "http" opens the link in a new browser window.
There may be time when you want to display information in the same window of the current web site and not open a new window.
Solution: Add a new URL type (which I have arbitrarily named "anchor") which displays the URL results in the current window.
This is a quick hack, which doesn't use Language files (my web site is in English).
Method:
(1) In the file \administrator\components\com_sobi2\admin.field.class.php
Find the line (around line 379)
$urlTypes[] = mosHTML::makeOption( '4', _SOBI2_FIELD_VIDEO);
Below the line;
$urlTypes[] = mosHTML::makeOption( '4', _SOBI2_FIELD_VIDEO);
Add the line;
$urlTypes[] = mosHTML::makeOption( '5', 'anchor');
(2) In the file \components\com_sobi2\sobi2.php
Find the lines (around line 817 and line 942)
else if($field->isUrl == 3)
below this "else if" statement, and another "else if" statement
else if($field->isUrl == 5) {$data = "<a href='{$field->data}'>{$field->label}</a>";}
(3) In the file \components\com_sobi2\sobi2.class.php
Find the lines (around line 810)
/* url processing */
if(( $field->isUrl == 1 || $field->isUrl == 3 || $field->isUrl == 4)
change the string to
if(( $field->isUrl == 1 || $field->isUrl == 3 || $field->isUrl == 4 || $field->isUrl == 5)
(4) In the file \components\com_sobi2\frontend.class.php
Find the lines (around line 426 and line 683)
else if($field->isUrl == 3)
below this "else if" statement, add another "else if" statement
else if($field->isUrl == 5) {$data = "<a href='{$field->data}'>{$field->label}</a>";
Regards - Mark