HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Default Links to target="_blank"

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#102898 (In Topic #20151)
Avatar

Well-settled

I just noticed as I was posting a link on this forum that target="_blank" is set to default.  How do you do this?

Russ Teicheira
http://vvarmachine.com or http://vvarnc.com - OCPortal Install
http://www.russteicheira.net
 - Profile Site that needs updating
http://projectxfire.com - Tech Blog that I need to get back to
Back to the top
 
Posted
Rating:
#102899
Avatar

I don't think it's anything fancy. The Comcode 'url' tag puts in a default target of '_blank' for non-local URLs. It can be overridden with a target attribute, and won't apply to HTML <a> tags (unless HTML to Comcode conversion is enabled).


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#103253
Avatar

Well-settled

So, I've been looking into this, and it doesn't seem to be working correctly.  I don't think it is detecting external links correctly.

Here is the code for the COMCODE_URL.tpl:

Code

<a {+START,IF,{$IN_STR,{CAPTION},<img}}class="link_exempt" {+END}{+START,IF_NON_EMPTY,{TITLE}}title="{+START,IF_NON_EMPTY,{$TRIM,{$STRIP_TAGS,{CAPTION}}}}{$STRIP_TAGS,{CAPTION}}: {+END}{TITLE*}" {+END}target="{TARGET*}" {+START,IF,{$EQ,{TARGET,_blank}}}rel="external" {+END}href="{$STRIP_TAGS,{URL*}}" rel="{REL*}">{$TRIM,{CAPTION}}</a>


Russ Teicheira
http://vvarmachine.com or http://vvarnc.com - OCPortal Install
http://www.russteicheira.net
 - Profile Site that needs updating
http://projectxfire.com - Tech Blog that I need to get back to
Back to the top
 
Posted
Rating:
#103255
Avatar

Works for me on latest v9.

But just to be clear about exactly what you are asking…

Are you saying you want non-local links to open in a new window/tab, but currently they do not?

Are you completely sure that non-local URLs are what you are testing?

Note I did not say "non-relative", as ocPortal detects links on the same domain and considers these local.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#103256
Avatar

Well-settled

Yes, non-local (External) address.  Another of my admins posted this: StarCitizen Multi-Organization Functionality is Now Live! - VVarMachine

Russ Teicheira
http://vvarmachine.com or http://vvarnc.com - OCPortal Install
http://www.russteicheira.net
 - Profile Site that needs updating
http://projectxfire.com - Tech Blog that I need to get back to
Back to the top
 
Posted
Rating:
#103261
Avatar

Ah sorry I was thinking along the wrong lines. What we have here is a Comcode feature, this user of yours is using WYSIWYG (i.e. HTML).

It would be up to them to explicitly specify if a link goes to a new window, as the HTML default is not to, and HTML doesn't have an auto feature like ocPortal does with Comcode (actually it would be kind of cool if you could do <base target="auto" /> in the HTML).

If HTML to Comcode conversion was on it probably would 'fix' it, but that causes many other problems and I don't recommend it.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: