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

Preview: DataObjectManager module


379 Posts   61704 Views


9 March 2009 at 3:24am 4085 Posts

Interesting. It's a low-level error, so if you turn down your error reporting is should at least allow the script to run. Try this in the meantime

I assume you're using a custom gridLabelField? Add ->XML_val to the return values of the obj() method.

506 public function FileLabel()
507 {
508 if($this->parent->gridLabelField)
509 $label = $this->obj($this->parent->gridLabelField)->XML_val;
510 else if($file = $this->obj($this->parent->fileFieldName))
511 $label = $file->Title->XML_val;
512 else
513 $label = "";
514 return strlen($label) > 30 ? substr($label, 0, 30)."..." : $label;
515 }
517 }

If that works, let me know, then undo all your changes to the class and I'll check in a new version. thanks.


9 March 2009 at 3:52am Community Member, 8 Posts

Hi Unclecheese

This would be very useful for me. However, I cant get the UI to work correctly.

I installed from svn and am running your Resource and ResourcePage classes as a test.

I can create ResourcePages in the cms, but when i open the popup to add resources, there's nothing underneath the "Upload Files from my computer" bar. See screenshot.

I'm running Firefox 3.0.7 under Mac OS X 10.5, latest Flash player installed.

Attached Files

9 March 2009 at 4:13am Community Member, 8 Posts

thanks for your reply

which version would you consider safe to use?

do you expect these issues to be resolved soon?




9 March 2009 at 6:31am Community Member, 20 Posts

Great addition to SS. Can you give us an example of how to use this on the public page side? Say for your Resource example. In the mysite/templates/Layout folder I created a file. And just adding $Resources to the ss file creates a nice UL list of resource items but the link's href is empty. I'm sure I have just missed something.


9 March 2009 at 8:39am Community Member, 215 Posts

That worked :) I'm not using a custom gridLabelField, the ss install is pretty generic. Also, perhaps related, the Title isn't displaying in the grid view of the FileDataObjectManager. I cannot remember if it was displaying before i made the change to FileLabel or not. Attached is what it looks like. The details are all there in the popup :)


Attached Files

9 March 2009 at 9:09am 4085 Posts

@pcbender - All you need is <% control Resources %>. You should read the tutorials on basic DataObject relationships to get started.

@Howard - Try changing this:

511 $label = $file->Title->XML_val;
to this:
511 $label = $file->Title;

Keep track of your changes so i can update the SVN.

@ somaboy - Make sure you can run the demo on this site. I'm running Flash Player 10 on OSX without a problem. Let me know if you figure anything out.


9 March 2009 at 9:20am Community Member, 20 Posts

A simple example of creating a maybe looks like this?

<div class="typography">
   <% if Level(2) %>
       <% include BreadCrumbs %>
   <% end_if %>
      <% if Resources %>
         <% control Resources %>
            <li><a href="$Attachment.URL">Download $Name</a></li>
         <% end_control %>
      <% end_if %>



Thanks for the reply.


9 March 2009 at 9:22am (Last edited: 9 March 2009 9:23am), 4085 Posts

You got it!

Also see $Attachement.Size and $Attachement.Type for more display options.