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.

DataObjectManager Module

Discuss the DataObjectManager module, and the related ImageGallery module.

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

basic upload pdfs and display on resource page problem

Go to End

13 Posts   2347 Views


3 June 2009 at 8:01am Community Member, 68 Posts

it is maybe an easy task, but for some reason, i couldnt get it to work. could you help me out with the following.

my objective is:
- create a resource page, where i can upload several pdf's
- the above will allow my client to upload several forms for download,
- the website should display those uploaded pdf's in a table, so its easy for website viewers to download them.

i have DOM installed and have created new page called resources in the CMS. i have uploaded the files to server through the DOM interface.
i have tried to create a template which displayed a table on the website with those pdf's,
but the URL pointing to those, used /wnioski (the actual suffix set in CMS) rather than /assets (which is where the pdf's are located).

could anybody suggest me with the right solution ?
i dont even need categories at the minute TBH.



3 June 2009 at 8:46am 4085 Posts

There's a pretty thorough example of this in the 'DataObjectManager Code Examples" sticky post. Are you following that?


3 June 2009 at 9:35am Community Member, 68 Posts

Indeed i tried.
I have put Resource.php and ResourcePage.php into /mysite and to /themes/mytheme/templates.
I have no possibility of checking this now, but afair page was empty. Why is the template file not called the same as Resource.php - i.e. ?


3 June 2009 at 10:06am 4085 Posts

A resource is not a page, so it doesn't get a template. Resource extends DataObject, not Page, right?

I think I see the problem. Change the name of to, so it matches the PHP file ResourcePage.php. Then run a ?flush=1


3 June 2009 at 8:28pm Community Member, 68 Posts

first congratulations on excellent module and second, thanks for being so patient with me.

your suggestion helped me, but still something remains to be corrected.

I have followed your suggestions and after displaying live site i received this code:

<p>Please find below forms for download</p>

               <h3>First form</h3>
               <p>first description</p>
               <h3>Second form</h3>
               <p>second description</p>
               <h3>Third form</h3>
               <p>third description</p>

First paragraph is taken from CMS, and all three headings are the actual resources names and descriptions.
However there's no link to the file, so i can click on it and display ?

Somebody suggested i should use this:

<% control Resources %> $Attachment.Link <%end_control %>

but this causes the table to be created with wrong path to files (/wnioski/ instead of /assets)

Any further hints available perhaps ?


4 June 2009 at 1:38am 4085 Posts

Can't you just do <a href="$Attachment.URL">Download</a>


4 June 2009 at 1:43am Community Member, 68 Posts

using your suggestions from, i added:

<div id="Content">
   <% control Resources %>
   <% control Attachment %>$Player(640,480)<% end_control %>
   <% end_control %>


Where should I add your suggestion of <a href="$Attachment.URL">Download</a> ?


4 June 2009 at 1:59am Community Member, 68 Posts

I adapted the

<% control Resources %>
      <% control Attachment %><a href="$Attachment.URL">Download</a><% end_control %>
      <% end_control %>

Which gives all the listed resources a "download" option, and all point to my site root.

I guess its the final touch that I need here to get it up and running.

WOuld appreciate any final hints on making sure the template works ok.

Go to Top