Hi,
I would like to create my own Tab that shows on the Left handside of the CMS - similar to Forms, Settings etc.
What I would like to do is to display data in table form from a SQL table in the main screen when someone clicks on this new tab.
Is this possible? Any ideas how I go about doing such a thing?
The first one by Markus Johansson is really good, its a step by step tutorial on how to create your own Umbraco application, almost from start to finish. And his tutorial is very close to what you are trying to build.
If it turns out great you might want to package it like your own package and share it in the community.
Best of luck to you, let me know if there is anything else i can help with!
Wow, this package looks awesome Tim! currently working in a project where I need something like this, with about 10.000 items. How is it with lots of data?
Yeah it should handle that amount of data pretty well, only downside is that you'll have a lot of page numbers and maybe want to handle the pagination numbers a little differently (but since it's open source you can :) )
{
[UIOMaticAttribute("People", "icon-users", "icon-user", RenderType = UIOMaticRenderType.List)]
[TableName("People")]
public class Person : IUIOMaticModel
{
public Person() { }
[UIOMaticIgnoreField]
[PrimaryKeyColumn(AutoIncrement = true)]
public int Id { get; set; }
[UIOMaticField("First name", "Enter the persons first name")]
public string FirstName { get; set; }
[UIOMaticField("Last name", "Enter the persons last name")]
public string LastName { get; set; }
[UIOMaticField("Picture", "Select a picture", View = "file")]
public string Picture { get; set; }
public override string ToString()
{
return FirstName + " " + LastName;
}
public IEnumerable<Exception> Validate()
{
var exs = new List<Exception>();
if (string.IsNullOrEmpty(FirstName))
exs.Add(new Exception("Please provide a value for first name"));
if (string.IsNullOrEmpty(LastName))
exs.Add(new Exception("Please provide a value for last name"));
return exs;
}
IEnumerable<Exception> IUIOMaticModel.Validate()
{
throw new NotImplementedException();
}
}
Think the error is coming because you didn't implement the Validate Method (so you are hitting that not implemented exception) , just return an empty list will get rid of the error.... or you could of course add custom validation rules
Extending Umbraco
Hi, I would like to create my own Tab that shows on the Left handside of the CMS - similar to Forms, Settings etc. What I would like to do is to display data in table form from a SQL table in the main screen when someone clicks on this new tab.
Is this possible? Any ideas how I go about doing such a thing?
Thanks Jon
Hi Jonathan.
This is very much possible, by creating you very own Custom Section / Application.
Here are some great tutorials about how to go about this:
http://www.enkelmedia.se/blogg/2013/11/22/creating-custom-sections-in-umbraco-7-part-1.aspx
http://jondjones.com/how-to-create-a-custom-section-in-umbraco-7/
https://www.linkedin.com/pulse/20141112132834-65892830-creating-a-custom-umbraco-dashboard-section
The first one by Markus Johansson is really good, its a step by step tutorial on how to create your own Umbraco application, almost from start to finish. And his tutorial is very close to what you are trying to build.
If it turns out great you might want to package it like your own package and share it in the community.
Best of luck to you, let me know if there is anything else i can help with!
Comment author was deleted
If it's simply for crud operations on a db table you might want to check out https://our.umbraco.org/projects/developer-tools/ui-o-matic/ , that will auto generate a user interface for you based on a poco and some attributes
Wow, this package looks awesome Tim! currently working in a project where I need something like this, with about 10.000 items. How is it with lots of data?
Comment author was deleted
Yeah it should handle that amount of data pretty well, only downside is that you'll have a lot of page numbers and maybe want to handle the pagination numbers a little differently (but since it's open source you can :) )
Thank you Tim. That should be fine! I'll give it ago when we reach that point in the project! Seems like a great package! :)
hi, Tim - that looks great - I started to implement a simple Person into the CMS to test it. When I add a new person I get a http://umbracosearch.stimulize.co.uk/umbraco/backoffice/UIOMatic/Object/PostCreate 500 (Internal Server Error).
I have set a Primary Key in the DB. Is there anything else I need to do?
im using Umbraco 7.4.2.
Jon
Comment author was deleted
Hey Jon, mind sharing your poco? Did you implement the interface? And the validate method
Hi, This is the Person Class:
}
What do you need from the Poco?
Jon
Comment author was deleted
Think the error is coming because you didn't implement the Validate Method (so you are hitting that not implemented exception) , just return an empty list will get rid of the error.... or you could of course add custom validation rules
Comment author was deleted
Ow you did implement the validate but could you drop the bit
That might be causing some strange results, also when you inspect with dev tools what is the actual error that it throws?
Hi, Thanks for updating - I removed that last bit and Im getting this error:
angular.js?cdv=809639659:10419 POST http://umbracosearch.stimulize.co.uk/umbraco/backoffice/UIOMatic/Object/Validate 500 (Internal Server Error)
Im using version 1.7.0 if that helps :)
Thanks for all your help with this, Jon
Comment author was deleted
Yeah defo has something todo with the validation, could you see what it does if you just return an empty list instead of the rules in that method
Hi, That did the trick - it is now saving :)
Many thanks
Jon
Comment author was deleted
Ok that's something :) will check why it's happening since you do want validation to happen :)
Great stuff - thanks. Can I ask? I have noticed if using Visual Studio 2015 you can install your version 2.2 - is this a stable version?
Thanks
Jon
Comment author was deleted
Sure shoot away :) 2.2 version of which package?
Of UIOMatic.
Comment author was deleted
That version doesn't exist :) https://www.nuget.org/packages/Nibble.Umbraco.UIOMatic/1.7.0 latest is 1.7.0... so not sure what vs is doing....
Hi Tim,
I find this in Nuget in Visual Studio
Thanks Paul - that's what I see too.
Jon
Comment author was deleted
Hmm that's strange I don't have that when I manage my packages in nuget
So I have no idea why vs is adding a 2 there...
Comment author was deleted
So would recommend installing 1.7.0 not that 2
I think I will remove 2.2 dll and go for the good old fashion version 1.7.0 :)
Thanks again for all your help.
Jon
Is there a way to give the List view Headers a nice name for example First Name as opposed to FirstName?
Thanks Jon
Comment author was deleted
Currently not but it has been requested a couple of times so will add that in in a next version (when time permits since I'm pretty busy atm)
Hi Tim, Have you ever got a Rich Text Editior working on the UI-O-MATIC project?
I have tried following some online examples but being a bit new to AngularJs I never got them working.
Thanks again for all your help, Jon
Comment author was deleted
Hey Jonathan, nope haven't done that but you should be able to follow these instructions http://www.enkelmedia.se/blogg/2013/12/4/umbraco-7-use-the-rich-text-editor-tinymce-in-a-custom-section.aspx
Hi, No problem. Thanks for all your help. Have a great week,
Jon
Hi Tim, Sorry to bother you again but I was hoping you may know the answer to this question.
I have copied the example in the link above but the data isn't saving to the Database. This is my control:
and this is my controller:
In your edit controller.js file under Save() The RTE control's Value is unchanged.
(I haven't copied the code exactly as the Properties loop which is wrapped in the example causes loads of issues).
Any ideas?
Thanks, jon
Comment author was deleted
Hmm nope not sure :( would have to test it myself to get a better understanding of the issue
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.