Jump to:

7938 Posts in 1541 Topics by 945 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Creating Hyperlink from a Dataobject

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1
Go to End
Author Topic: 666 Views
  • Hello_electro
    Avatar
    Community Member
    80 Posts

    Creating Hyperlink from a Dataobject Link to this post

    I feel so stupid asking this, but cant for the life of me get a hyperlnk to output properly so that a dataobject (in this case pdf's) can be downloaded.

    Is there something I need to add in my php file??

    <div class="typography">
       <% if Menu(3) %>
          <% include SideBar %>
          <div id="Content">
       <% end_if %>

       <% if Level(2) %>
           <% include BreadCrumbs %>
       <% end_if %>
       
          <h1>$Title</h1>
          $SGFirstParagraph
          
          <h2>Download Current RAD Schedules</h2>
          <ul>      
          <% control SafetyGuidelines %>
          <li><a href="$Link">$SafetyGuidelineTitle</a></li>
          
          <% end_control %>
          </ul>
          
          $Content
          $Form
          $PageComments
       <% if Menu(3) %>
          </div>
       <% end_if %>
    </div>

  • Hello_electro
    Avatar
    Community Member
    80 Posts

    Re: Creating Hyperlink from a Dataobject Link to this post

    I should have mentioned, I am calling the dataobject here:

    <% control SafetyGuidelines %>
    <li><a href="$Link">$SafetyGuidelineTitle</a></li>

    <% end_control %>

  • UncleCheese
    Avatar
    4085 Posts

    Re: Creating Hyperlink from a Dataobject Link to this post

    $YourFileRelation.URL

  • Hello_electro
    Avatar
    Community Member
    80 Posts

    Re: Creating Hyperlink from a Dataobject Link to this post

    doh!!!! Thanks!

    666 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.