I have a custom tab under Content in Umbraco CMS that will display a list of strings. The owner of the site will be able to insert or remove strings from that list. I'm using asp.net user control to render the page.
My question is, how would I store these items in the Umbraco db? Would I be able to create a document type and somehow use it for data storage for the page? If so, how would I accomplish that?
Hmm, not exactly. The thing is that I'm creating a custom tab for Content which has a .net user control that will display a list of strings, which can be modified. My concern is how I would store the list of strings, e.g. using the Umbraco database.
I read somewhere that it's possible to create document type and use that to store the data, but I guess that only works if I'm creating a page. Any ideas?
I can't store it to XML since I won't have any write access on the server.
Hmm if you don't have any write access on the server won't this give a lot of other problems for Umbraco? I thought you need write access for example because otherwise the umbraco.config can't be updated. I could be wrong, but have you tested Umbraco on the server?
Yeah, I'll check it out, I think I'm having trouble making user control having write access, un-sure though.
But is it possible to use document type in an user control? Let's say I'm creating a new section in Umbraco where I simply have a list of strings and can add/remove one. Where should that list be saved and could I use document type for that?
I don't see why you couldn't use the uComponents MultipleTextString datatype for that (as Jeroen has suggested), but maybe we don't get your idea of a custom tab? I guess you've just added an extra tab and want to add your user control onto that tab? If so, you're better off creating your own datatype (because you just can't add a user control onto a custom tab) if the uComponents' one doesn't fit your needs.
Check out umbraco.tv, it has some vids on creating custom datatypes.
Anyway, you can use any umbraco api method in your user control, assuming you're working in the umbraco context.
Let's just ignore the fact I'm writing custom tab. I'm writing a new section under umbraco CMS where I am rendering my user control. This string list will only be available there.
So let's say I use this uComponent MultipleTextString, how would I create instance of it inside my user control, add strings to it and save? (Not really asking for a code how it's done, but more of an overview of how its done).
Sorry about my confusing question, I hope this clears it out :-)
Save custom data in Umbraco database
I have a custom tab under Content in Umbraco CMS that will display a list of strings. The owner of the site will be able to insert or remove strings from that list. I'm using asp.net user control to render the page.
My question is, how would I store these items in the Umbraco db? Would I be able to create a document type and somehow use it for data storage for the page? If so, how would I accomplish that?
Thanks! :-)
Hmm before I explain how to do that isn't this what you're looking for? http://ucomponents.codeplex.com/wikipage?title=MultipleTextstring&referringTitle=Documentation
Jeroen
Hmm, not exactly. The thing is that I'm creating a custom tab for Content which has a .net user control that will display a list of strings, which can be modified. My concern is how I would store the list of strings, e.g. using the Umbraco database.
I read somewhere that it's possible to create document type and use that to store the data, but I guess that only works if I'm creating a page. Any ideas?
I can't store it to XML since I won't have any write access on the server.
Hmm if you don't have any write access on the server won't this give a lot of other problems for Umbraco? I thought you need write access for example because otherwise the umbraco.config can't be updated. I could be wrong, but have you tested Umbraco on the server?
Yeah, I'll check it out, I think I'm having trouble making user control having write access, un-sure though.
But is it possible to use document type in an user control? Let's say I'm creating a new section in Umbraco where I simply have a list of strings and can add/remove one. Where should that list be saved and could I use document type for that?
Hi Troska,
I don't see why you couldn't use the uComponents MultipleTextString datatype for that (as Jeroen has suggested), but maybe we don't get your idea of a custom tab? I guess you've just added an extra tab and want to add your user control onto that tab? If so, you're better off creating your own datatype (because you just can't add a user control onto a custom tab) if the uComponents' one doesn't fit your needs.
Check out umbraco.tv, it has some vids on creating custom datatypes.
Anyway, you can use any umbraco api method in your user control, assuming you're working in the umbraco context.
Cheers,
/Dirk
Let's just ignore the fact I'm writing custom tab. I'm writing a new section under umbraco CMS where I am rendering my user control. This string list will only be available there.
So let's say I use this uComponent MultipleTextString, how would I create instance of it inside my user control, add strings to it and save? (Not really asking for a code how it's done, but more of an overview of how its done).
Sorry about my confusing question, I hope this clears it out :-)
Here is some info on how to create datatypes in a custom section:
http://our.umbraco.org/wiki/reference/code-snippets/use-mntp-on-a-usercontrol
http://our.umbraco.org/forum/developers/extending-umbraco/6863-Datatype-on-normal-page-or-UserControl
You might have to look at the source of Multiple Textstring to see what's required to use it in a custom section.
Jeroen
is working on a reply...