You are not logged in.
Pages: 1
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
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
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
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
{else}
{$entry|escape|datadetector:true|nl2br}<br />
{/if}
Offline
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
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
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
Pages: 1