- Posts: 212
- Thank you received: 38
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Can i force links into boxes to open in a new tab
- ritapas
- Topic Author
- Away
- Elite Member
Less
More
3 years 9 months ago #201693
by ritapas
Can i force links into boxes to open in a new tab was created 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.
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.
The topic has been locked.
- tpartner
- Away
- LimeSurvey Community Team
Less
More
- Posts: 10633
- Thank you received: 3697
3 years 9 months ago #201709
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Can i force links into boxes to open in a new tab
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
The following user(s) said Thank You: DenisChenu, ritapas
The topic has been locked.
- ritapas
- Topic Author
- Away
- Elite Member
Less
More
- Posts: 212
- Thank you received: 38
3 years 9 months ago #201715
by ritapas
Replied by ritapas on topic Can i force links into boxes to open in a new tab
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.
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.
The topic has been locked.
- tpartner
- Away
- LimeSurvey Community Team
Less
More
- Posts: 10633
- Thank you received: 3697
3 years 9 months ago #201719
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Can i force links into boxes to open in a new tab
If using a custom admin theme, add something like this to your custom.js file (adjusting "panel-7" as necessary for different boxes):
Code:
$(document).on('ready pjax:scriptcomplete',function(){ if($('.ls-panelboxes').length > 0) { $('#panel-7').attr('data-bs-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.
The following user(s) said Thank You: ritapas
The topic has been locked.
- ritapas
- Topic Author
- Away
- Elite Member
Less
More
- Posts: 212
- Thank you received: 38
3 years 8 months ago #202241
by ritapas
Replied by ritapas on topic Can i force links into boxes to open in a new tab
thank you a lot
The topic has been locked.
- ritapas
- Topic Author
- Away
- Elite Member
Less
More
- Posts: 212
- Thank you received: 38
3 years 8 months ago #202446
by ritapas
Replied by ritapas on topic Can i force links into boxes to open in a new tab
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:
anyway the custom.js script file is not loaded.
Any hint?
Thank you again.
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:
Code:
<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.
The topic has been locked.
- tpartner
- Away
- LimeSurvey Community Team
Less
More
- Posts: 10633
- Thank you received: 3697
3 years 8 months ago #202454
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Can i force links into boxes to open in a new tab
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- ritapas
- Topic Author
- Away
- Elite Member
Less
More
- Posts: 212
- Thank you received: 38
3 years 8 months ago - 3 years 8 months ago #202464
by ritapas
I just reported the relevant part.
Or is there something else?
Edit: indeed, the js is not loaded in the page
Replied by ritapas on topic Can i force links into boxes to open in a new tab
you mean incomplete?tpartner wrote: Your XML is invalid.
- manual.limesurvey.org/Custom_Admin_Theme...nto_a_custom_theme_2
I just reported the relevant part.
Or is there something else?
Edit: indeed, the js is not loaded in the page
Last edit: 3 years 8 months ago by ritapas.
The topic has been locked.
- tpartner
- Away
- LimeSurvey Community Team
Less
More
- Posts: 10633
- Thank you received: 3697
3 years 8 months ago #202472
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Can i force links into boxes to open in a new tab
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: ritapas
The topic has been locked.
- ritapas
- Topic Author
- Away
- Elite Member
Less
More
- Posts: 212
- Thank you received: 38
3 years 8 months ago #202474
by ritapas
Replied by ritapas on topic Can i force links into boxes to open in a new tab
Oh my, you are right. Sorry!
The topic has been locked.