Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Creating Hyperlink from a Dataobject


Go to End


4 Posts   1049 Views

Avatar
Hello_electro

Community Member, 80 Posts

25 March 2011 at 7:17am

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>

Avatar
Hello_electro

Community Member, 80 Posts

25 March 2011 at 7:18am

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


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

Avatar
UncleCheese

Forum Moderator, 4102 Posts

25 March 2011 at 7:34am

$YourFileRelation.URL

Avatar
Hello_electro

Community Member, 80 Posts

25 March 2011 at 7:58am

doh!!!! Thanks!