Jump to:

1384 Posts in 493 Topics by 522 members

Themes

SilverStripe Forums » Themes » problem with template outputting hyper link

Discuss SilverStripe Themes.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 978 Views
  • kuenkuen82
    Avatar
    Community Member
    41 Posts

    problem with template outputting hyper link Link to this post

    I have a page object that has a field which contains a hyperlink, which is similar to 'http://www.website.com/publication.file.pdf'

    This can be seen file inside the backend, but in the frontend it doesn't show up $hyperlink, I've also try $hyperlink.XML

  • Willr
    Avatar
    Forum Moderator
    5508 Posts

    Re: problem with template outputting hyper link Link to this post

    Could you publish your code just to make sure people can fully understand the issue.

    If you have a HyperLink in the $db array then you should just be able use $HyperLink in the template. If you link to a file object (eg attach it to a page) then you have to use $HyperLink.Link

  • kuenkuen82
    Avatar
    Community Member
    41 Posts

    Re: problem with template outputting hyper link Link to this post

    I've try that be it doesn't work

       static $db = array(
           'Date' => 'Date',

          'ArticleTitle' => 'Text',
          'Hyperlink' => 'Text',
          'PublicationName' => 'Text',
          'Vol_Issue' => 'Text',
          'PublicationOrigin' => 'Text',
          'Language' => 'Text',
          'ArticleType' => 'Text',
          'ProjectAward' => 'Text',
          'RelatedOffice' => 'Text',
          'ProjectCity' => 'Text',
          'Person' => 'Text',
          'ClientPerson' => 'Text',
          'ThirdParty' => 'Text',
          'ExternalHyperlink' => 'Varchar(255)',
          'Filename' => 'Varchar(255)',
       );

    <strong><a class="tooltip" href="$ExternalHyperlink" rel="#note_$ID">$Title.XML</a></strong>

    As you can see I have two links, the Hyperlink works fine, but when I use ExternalHyperlink nothing is output. All the other fields work fine too

    978 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.