Page 1 of 1

Set default value for hyperlink target frame

Posted: Mon Jun 19, 2023 1:50 am
by abakus
Hi!

For hyperlinks and cross-references you can set the target frame. The first option is "(default)":
2023-06-19 10_49_44-target_frame.jpg ‎- Fotos.png
This leads me to believe that the default value can be preset.
Question: Is it possible to set the behavior for (default) somewhere in MadCap Flare, so that e.g. hyperlinks are opened in a new window/tab by default?

Thank you so much!

Re: Set default value for hyperlink target frame

Posted: Tue Jun 20, 2023 2:00 am
by RStreets
Having looked at the help (e.g. https://help.madcapsoftware.com/flare20 ... %20Default, step 9), I think you're out of luck. I'm pretty certain that the (default) option shown when inserting hyperlinks is the same as the "Page Default" described here (which is what's offered when you insert a cross reference).

I certainly can't think of a way of setting a default behavior for "(default)"! :(

Re: Set default value for hyperlink target frame

Posted: Tue Jun 20, 2023 3:59 am
by VikasSharma088
It is possible to set the behavior for (default) in MadCap Flare, so that hyperlinks are opened in a new window/tab by default. This can be achieved by doing modification inside master page or stylesheet. By adding target-name: "_blank"; property to the appropriate CSS rule in the master page or stylesheet, all hyperlinks in your articles will open in a new window or tab when published.

Re: Set default value for hyperlink target frame

Posted: Tue Jun 20, 2023 7:45 am
by NorthEast
Sorry, but this doesn't sound right for a number of reasons.
VikasSharma088 wrote: Tue Jun 20, 2023 3:59 amThis can be achieved by doing modification inside master page or stylesheet
Not sure how it can be "master page or stylesheet". They're quite different things, and I can't see how making a change to either is going to change the default behaviour required.
VikasSharma088 wrote: Tue Jun 20, 2023 3:59 amBy adding target-name: "_blank"; property to the appropriate CSS rule in the master page or stylesheet, all hyperlinks in your articles will open in a new window or tab when published.
There is a HTML target attribute that you set for individual links, for example target="_blank". But that's a HTML attribute, and not CSS. That also wouldn't set the default behaviour required.


To answer the OP, I don't think you can set a default. In many situations in Flare, the "(default)" label really means "not set".
So in the case of the target frame for links, each option will set the relevant target="xxx" attribute in the HTML code, but setting (default) will remove that target attribute.

Re: Set default value for hyperlink target frame

Posted: Fri Jun 23, 2023 5:41 am
by trent the thief
There's no method to set any "(default)" value settings. That's Flare's placeholder for null.

Re: Set default value for hyperlink target frame

Posted: Mon Jun 26, 2023 12:51 am
by abakus
Thanks for all of your replies!

There is indeed a css property called target-name (https://www.w3schools.com/cssref/css3_p ... t-name.php) which would have the wished behaviour, but it's not supported by browsers.

Then there is a <base> tag (https://www.w3schools.com/tags/tag_base.asp) and

Code: Select all

<head>
<base target="_blank"> 
</head>
would also lead to my expected results but it seems not to work with MadCap Flare :(

At least I found out that I can give external links or links to pdf a different styling:

Code: Select all

a[href$=".pdf"]
{
	target: "_blank";
	background: url('../Icons/PDF.png') no-repeat 100% 0;
	background-size: 30px 14px;
	padding-right: 40px;
}

Re: Set default value for hyperlink target frame

Posted: Mon Jun 26, 2023 2:52 am
by NorthEast
Interesting, I'd never heard of target-name in CSS - it looks like it's just a proposal.

Whilst <base> should work, it looks like you need to specify the href as well as the target. This works for me:

Code: Select all

<base href="https://madcapsoftware.com/" target="_blank" /> 
You'd have to add <base> to the master page (rather than the topic), to get it to be included in the output.