Jump to:

7939 Posts in 1472 Topics by 944 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Preview: DataObjectManager module

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
Go to End
Author Topic: 58445 Views
  • UncleCheese
    Avatar
    4085 Posts

    Re: Preview: DataObjectManager module Link to this post

    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 }
    516
    517 }
    518

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

  • somaboy
    Avatar
    Community Member
    8 Posts

    Re: Preview: DataObjectManager module Link to this post

    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
  • somaboy
    Avatar
    Community Member
    8 Posts

    Re: Preview: DataObjectManager module Link to this post

    thanks for your reply

    which version would you consider safe to use?

    do you expect these issues to be resolved soon?

    thanks!

    soma

  • pcbender
    Avatar
    Community Member
    20 Posts

    Re: Preview: DataObjectManager module Link to this post

    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 ResourcePage.ss 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.

  • Howard
    Avatar
    Community Member
    215 Posts

    Re: Preview: DataObjectManager module Link to this post

    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

    Thanks!

    Attached Files
  • UncleCheese
    Avatar
    4085 Posts

    Re: Preview: DataObjectManager module Link to this post

    @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. http://demo.swfupload.org/v220beta5/applicationdemo/index.php. I'm running Flash Player 10 on OSX without a problem. Let me know if you figure anything out.

  • pcbender
    Avatar
    Community Member
    20 Posts

    Re: Preview: DataObjectManager module Link to this post

    A simple example of creating a ResourcePage.ss maybe looks like this?

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

          $Form
          $PageComments

    </div>

    Thanks for the reply.

  • UncleCheese
    Avatar
    4085 Posts

    Re: Preview: DataObjectManager module Link to this post

    You got it!

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

    58445 Views
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
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.