I've installed Fluidty and have been messing around with the different settings the past couple of days, I have a few questions which I hope someone will be able to help and point me in the right direction;
1) I know you can make the collection read only, which disables the CRUD settings, is it possible to only remove the create button, but keep the other edit,delete buttons?
2) How customisable is Fluidity?
3) Is there way I can display the list by date order?
The MakeReadOnly setting disables all CRUD settings, I'm just wondering can I remove the create button but keep all the other settings like, delete, edit ect.
Fluidity has great docs so you can probably find your answers there,
for the list order check out the part:
But for some reason it doesn't understand "DateCreated" being the noob that I am, do I need to create a new column in my database called "DateCreated" but not sure how I would generate a date.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Umbraco.Core.Persistence;
using Umbraco.Core.Persistence.DatabaseAnnotations;
namespace UmbracoFluidityExample.Fluidity.Models
{
[TableName("Contact")]
public class Contact
{
[PrimaryKeyColumn]
public int Id { get; set; }
public string Name { get; set; }
public string Email { get; set; }
public string Message { get; set; }
}
}
Thanks I've now made all the changes and it sort of works, well it does work. But the issue is when I click create and fill in my details I get the following error;
Cannot insert the value NULL into column 'DateCreated', table 'UmbracoMatt.dbo.Contact'; column does not allow nulls. INSERT fails. The statement has been terminated.
but I've set the table up so everytime a new row is added, it will get the time stamp. Is there a way for when using the "create" button to ignore the DateCreated filled? I tried to make it read only but didn't resolve it.
Few questions about fluidity
Hello all,
I've installed Fluidty and have been messing around with the different settings the past couple of days, I have a few questions which I hope someone will be able to help and point me in the right direction;
1) I know you can make the collection read only, which disables the CRUD settings, is it possible to only remove the create button, but keep the other edit,delete buttons?
2) How customisable is Fluidity?
3) Is there way I can display the list by date order?
Thanks in advance, Matt
Anyone Fluidity geniuses?
Thanks :)
Hi Matt,
I see there is a MakeReadOnly method on the collection : https://umco.github.io/umbraco-fluidity/api/collections/
Maybe that solves your issue ?
Dave
Comment author was deleted
Fluidity has great docs so you can probably find your answers there, for the list order check out the part:
Defining a default sort order on https://umco.github.io/umbraco-fluidity/api/collections/
Hello,
The MakeReadOnly setting disables all CRUD settings, I'm just wondering can I remove the create button but keep all the other settings like, delete, edit ect.
Hello Tim,
Thanks I did look through the API collections and have the setting;
collectionConfig.SetDateCreatedProperty(p => p.DateCreated);
But for a noobie it doesnt really make it clear how to use it, just wondering if there was anymore information about setting it up.
Thanks for the help :)
Matt
Comment author was deleted
Hey Matt, I think if you want to sort you'll need the SetSortProperty method
collectionConfig.SetSortProperty(p => p.FirstName);
Comment author was deleted
and I don't think you can only disable create and leave update and delete available it's all crud or read only
Comment author was deleted
You could however look at a backoffice tweak to get rid of the create, but that will most likely break on future upgrades (since it's a hack)
https://24days.in/umbraco-cms/2015/umbraco-7-back-office-tweaks/
Hello Tim,
Thanks for the response, with regards to the create. Its not too much of an issue but just would of been nice to hide that feature.
I'm looking at using the following so I can show the latest entries 1st.
collectionConfig.SetDateCreatedProperty(p => p.DateCreated);
But for some reason it doesn't understand "DateCreated" being the noob that I am, do I need to create a new column in my database called "DateCreated" but not sure how I would generate a date.
Thanks in advance, Matt
Comment author was deleted
Hey Matt, how does your poco model look?
Hello Tim,
Here is my file;
The only columns I have in my database are;
ID Name Email Message
Thank you
Comment author was deleted
Yeah then you'll need to expand your model and table with the new created field
Hello Tim,
Thanks I've now made all the changes and it sort of works, well it does work. But the issue is when I click create and fill in my details I get the following error;
Cannot insert the value NULL into column 'DateCreated', table 'UmbracoMatt.dbo.Contact'; column does not allow nulls. INSERT fails. The statement has been terminated.
but I've set the table up so everytime a new row is added, it will get the time stamp. Is there a way for when using the "create" button to ignore the DateCreated filled? I tried to make it read only but didn't resolve it.
Thanks in advance,
Matt
Comment author was deleted
Or you could update the column to allow nulls?
is working on a reply...