Access File info in attribute type?
Permalink
I need to access the info for the current file in my attribute type controller for a custom file attribute. How do I do this? I can save and reference my own value, but I need the value to be based on certain properties for the file you are attaching it to.
Thanks!
Thanks!
I don't quite follow you here. I'd need more info as this is pretty general, albeit slightly advanced :)
The core supports custom attribute keys, and custom attribute types. Most of the time people deal with keys, which are custom values based on text, textarea, date, etc.
However, it also is possible to create your own types, which give you more flexibility for how data is entered or saved.
The issue I have is in the way that this is flexible. Unfortunately, I really, really need the ID for the file I am trying to attach the attribute to. Because of the way the system is designed, I'm afraid this might be impossible. I'm hoping it isn't, but ... that's why I'm posting :)
I can't think of a better way of adding a new "task" to a file. In this case, I'm trying to generate a still-frame for video files
Does that make a little more sense? Thanks :)
However, it also is possible to create your own types, which give you more flexibility for how data is entered or saved.
The issue I have is in the way that this is flexible. Unfortunately, I really, really need the ID for the file I am trying to attach the attribute to. Because of the way the system is designed, I'm afraid this might be impossible. I'm hoping it isn't, but ... that's why I'm posting :)
I can't think of a better way of adding a new "task" to a file. In this case, I'm trying to generate a still-frame for video files
Does that make a little more sense? Thanks :)
A year and 8 months later: "No, it doesn't."
But this link was highly rated on google so it's obviously getting some hits.
I came to it looking to find the quick answer to the question of how to access a method within a custom attributeType's controller. I realize I can hard code the class::method in the file where I want the answer. But C5 typically does it by requesting the attributeType's controller and then the method. I was looking for that syntax. Have you got that one, elyon? (And - out of shear interest - the answer to your above question?)
:)
But this link was highly rated on google so it's obviously getting some hits.
I came to it looking to find the quick answer to the question of how to access a method within a custom attributeType's controller. I realize I can hard code the class::method in the file where I want the answer. But C5 typically does it by requesting the attributeType's controller and then the method. I was looking for that syntax. Have you got that one, elyon? (And - out of shear interest - the answer to your above question?)
:)
In the end, I abandoned trying to create a custom attribute type, and was able to handle what I needed by hooking into the "edit" option for the file type I was working with.
I am not sure if this API has changed in newer versions of Concrete
I am not sure if this API has changed in newer versions of Concrete