Third Light Developer Exchange

Code and templating community forum for developers and software integrators

You are not logged in.

Announcement

If you wish to join the Developer Exchange, please contact your account manager - this is to avoid unnecessary spam in the forums. Many thanks for your understanding.

#1 2013-09-03 14:33:52

ericnewsome
Member
Registered: 2013-09-02
Posts: 4

Custom URL link

Our assets are vintage photographs.  We scan the front and back of each photo, because in most cases the information about the image is located on the back.  Since we do not want to use TL IMS for the backs, we created a custom metadata field for the back URL (housed on our web servers).  It is working great--it is automatically recognized as a URL so it allows the end user to click to view the back.  Is there a way to include the "target=_blank" tag so that it automatically invokes a new window?  I tried to just add it to the end of the data but since it is a text field it just sees "target=_blank" as a new word.

Offline

#2 2013-09-03 14:46:34

ben
Third Light Staff
From: Third Light
Registered: 2013-06-06
Posts: 79

Re: Custom URL link

Hi,

As it happens there's a very trivial way to do this if you are comfortable editing your templates.

In the templates section of your theme find the metapanel template (found under the "Child Templates" section).
In this template, around line 59, is some Smarty that looks like this:

{$entry|escape|datadetector|nl2br}<br />

Change the above to:

{$entry|escape|datadetector:true|nl2br}<br />

(The extra "true" parameter to the datadetector modifier causes URLs to open new pages.)

hth
Ben

Offline

#3 2013-09-03 17:32:12

ericnewsome
Member
Registered: 2013-09-02
Posts: 4

Re: Custom URL link

Thanks Ben--I made the change but it didn't work.  I tried on IE and Firefox, and logged out/in.  Is a reboot or some other step required?  Thanks again.

Offline

#4 2013-09-06 21:20:57

ben
Third Light Staff
From: Third Light
Registered: 2013-06-06
Posts: 79

Re: Custom URL link

Hi Eric, Sorry for delay in replying... it should work as soon as the change is saved. Please could you post here the line that you've changed?

Offline

#5 2013-09-20 12:21:36

ericnewsome
Member
Registered: 2013-09-02
Posts: 4

Re: Custom URL link

{else}
                                {$entry|escape|datadetector:true|nl2br}<br />
                            {/if}

Offline

#6 2013-09-20 12:33:03

ben
Third Light Staff
From: Third Light
Registered: 2013-06-06
Posts: 79

Re: Custom URL link

Hi Eric, that does look correct. Next check would be looking at the source. If possible, please could you paste in the html source for a page where the feature isn't working. All I'd be looking for is whether the target="_blank" attribute is being added correctly. If it is then it would be down to browser behaviour - it might depend on your settings as to whether new windows or tabs are allowed to be created.

Thanks,
Ben

Offline

#7 2013-09-20 17:47:00

ericnewsome
Member
Registered: 2013-09-02
Posts: 4

Re: Custom URL link

Here is the area of html dealing with the link:
<td class="fieldName">Back Image URL</td>
                    <td class="fieldData"><a href="http://images.historicimages.com/nea/nea39011b.jpg"  class="detectedLink">http://images.historicimages.com/nea/nea39011b.jpg</a><br /></td>

So it looks as though the template isn't generating the attribute?

Offline

#8 2013-10-03 23:57:20

ben
Third Light Staff
From: Third Light
Registered: 2013-06-06
Posts: 79

Re: Custom URL link

Hi Eric,
Apologies again for missing your reply.
I've been looking at the IMS code some more and have seen a problem with it. I don't understand how it ever worked in the first place (I'm sure I tested it before replying to your post initially). I can only assume that it never worked in the first place and I've just gone a bit senile.

Sorry it's taken so long to work this out. We'll have a fix out in the next Release Candidate.

Best wishes
Ben

Offline

Board footer