Hello, I search the forum, someone suggested that creating links in Website/Content and checking the option “Open in new window” will do the trick. But either I don't know how to add this link to menu or it does not work. If I put the link in a block, it works, but creating a custom menu does not give the option to add the specified link. If I write the url, also the link will be _self and not _blank.
Any suggestions?
Hello.
the easiest way to do this ( for me )
- open and edit ( schemas\static_data\schema.php )
change this code :
'A' => array( // menu items<br />
'param' => 'url',<br />
'tooltip' => 'tts_link_text',<br />
'descr' => 'link_text',<br />
'add_title' => 'new_items',<br />
'add_button' => 'add_item',<br />
'edit_title' => 'editing_item',<br />
'mainbox_title' => 'menu_items',<br />
'additional_params' => array(<br />
array(<br />
'title' => 'activate_menu_tab_for',<br />
'tooltip' => 'tts_activate_menu_tab_for',<br />
'type' => 'input',<br />
'name' => 'param_2'<br />
),<br />
array(<br />
'title' => 'generate_submenu',<br />
'tooltip' => 'tts_generate_submenu',<br />
'type' => 'megabox', // <img src="upload://rA9Qa8gnUPZzRZRdI8kt3dpjkrs.png" class="bbc_emoticon" alt=":)"><br />
'name' => 'param_3'<br />
),<br />
),
```<br />
<br />
to this code :<br />
<br />
```php
'A' => array( // menu items<br />
'param' => 'url',<br />
'tooltip' => 'tts_link_text',<br />
'descr' => 'link_text',<br />
'add_title' => 'new_items',<br />
'add_button' => 'add_item',<br />
'edit_title' => 'editing_item',<br />
'mainbox_title' => 'menu_items',<br />
'additional_params' => array(<br />
array(<br />
'title' => 'new_window',<br />
'tooltip' => 'tts_open_new_window',<br />
'type' => 'checkbox', // <img src="upload://rA9Qa8gnUPZzRZRdI8kt3dpjkrs.png" class="bbc_emoticon" alt=":)"><br />
'default_value' => 'N',<br />
'name' => 'param_4'<br />
),<br />
array(<br />
'title' => 'activate_menu_tab_for',<br />
'tooltip' => 'tts_activate_menu_tab_for',<br />
'type' => 'input',<br />
'name' => 'param_2'<br />
),<br />
array(<br />
'title' => 'generate_submenu',<br />
'tooltip' => 'tts_generate_submenu',<br />
'type' => 'megabox', // <img src="upload://rA9Qa8gnUPZzRZRdI8kt3dpjkrs.png" class="bbc_emoticon" alt=":)"><br />
'name' => 'param_3'<br />
),<br />
),
```<br />
<br />
check the different so you will find the idea.<br />
code above will give you a New Window check box everytime you create a menu item.<br />
<br />
2. open and edit skins\TEMPLATE_NAME\customers\blocks\topmenu_dropdown.tpl<br />
and add this code in every <a> tag<br />
<br />
```php
{if $item1.param_4== "Y"} target ="_blank" {/if}
```<br />
<br />
example :<br />
<br />
```php
<a{if $item1_url} href="{$item1_url}"{/if}{if $item1.param_4== "Y"} target ="_blank" {/if}{if $item1.$childs} class="drop"{/if}>{$item1.$name}</a>
```<br />
<br />
Dont forget to save and clear cache to see the result.<br />
Hope this solve your problem.<br />
<br />
Cheers<br />
Dwyn
Anyone know how to fix this issue in 4.0.3? Seems very odd that this is not a simple thing built into the back end…
Hi @jacson
I have the add-on for v4.x ready done, please send a quote on hungryweb.net and you will receive it
Regards,
—
Valentin
[color=#808080][size=2]part of hungryweb.net[/size][/color]
I am rather surprised that CS Cart has not implemented this yet! However, for anyone else reading this thread, dwyn's method works perfectly, even in 4.3. (Thanks!)
in version 4+ the file locations are just slightly different than the original instructions:
app/schemas/static/data/schema.php
design/themes/responsive/templates/blocks/topmenu_dropdown.tpl
I hope this helps someone! Cast your votes at CS Cart uservoice and maybe they will finally implement this simple change! Dwyn already did the work and it is only a few lines of code, so they could implement this immediately if they really wanted to.
how can we do this using "my changes" addon with hooks?
Thank you