Can i force links into boxes to open in a new tab

More
4 months 2 days ago #201693 by ritapas
Hello,
i like the new boxes in the homepage a lot.
I've also found a way to tweak the fa icons to have more by changing the db table.

Two of my boxes point to web resources and I would like those to open in a new browser tab.

I believe this could be done in the admin theme but I see it's not straighforward to change its code like it is in survey themes.

Has anybody already done that?

Thank you.

Please Log in to join the conversation.

LimeSurvey Partners
More
4 months 2 days ago #201709 by tpartner
What LS version? In 3.22.19, creating a box with an external link does open in a new tab.


Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
Attachments:
The following user(s) said Thank You: DenisChenu, ritapas

Please Log in to join the conversation.

More
4 months 2 days ago #201715 by ritapas
You are right.
My version is 4.2.1 but if i use an absolute link then I get the same icon and it works the way you say.
My links, tough, point to resources inside a single survey so they have got relative links.
So, unless there is a better way, I'll have to point to the internal resource via an absolute link.
Thank you.

Please Log in to join the conversation.

More
4 months 2 days ago #201719 by tpartner
If using a custom admin theme, add something like this to your custom.js file (adjusting "panel-7" as necessary for different boxes):

$(document).on('ready pjax:scriptcomplete',function(){
 
    if($('.ls-panelboxes').length > 0) {
 
		$('#panel-7').attr('data-target', '_blank');
		$('#panel-7 .panel-body-link').append('&nbsp;<i class="fa fa-external-link"></i>');
    }
});

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
The following user(s) said Thank You: ritapas

Please Log in to join the conversation.

More
3 months 3 weeks ago #202241 by ritapas
thank you a lot

Please Log in to join the conversation.

More
3 months 2 weeks ago #202446 by ritapas
Hello,
I've created a custom.js file with your code and put it inside a js directory inside the custom admin theme.

Its config.xml states as follows:
<files>
        <css>
            <filename>lime-admin-colors.css</filename>
            <filename>statistics.css</filename>
        </css>
 
        <js>custom.js</js>
...

anyway the custom.js script file is not loaded.

Any hint?

Thank you again.

Please Log in to join the conversation.

More
3 months 2 weeks ago #202454 by tpartner

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com

Please Log in to join the conversation.

More
3 months 2 weeks ago - 3 months 2 weeks ago #202464 by ritapas

tpartner wrote: Your XML is invalid.

- manual.limesurvey.org/Custom_Admin_Theme...nto_a_custom_theme_2

you mean incomplete?
I just reported the relevant part.
Or is there something else?

Edit: indeed, the js is not loaded in the page
Last edit: 3 months 2 weeks ago by ritapas.

Please Log in to join the conversation.

More
3 months 2 weeks ago #202472 by tpartner
Did you look at the XML in the link?

You have not included the <filename> tag.


Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
Attachments:
The following user(s) said Thank You: ritapas

Please Log in to join the conversation.

More
3 months 2 weeks ago #202474 by ritapas
Oh my, you are right. Sorry!

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now