Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Matt 308 posts 730 karma points
    Jun 16, 2018 @ 16:17
    Matt
    0

    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

  • Matt 308 posts 730 karma points
    Jun 18, 2018 @ 10:59
    Matt
    0

    Anyone Fluidity geniuses?

    Thanks :)

  • Dave Woestenborghs 3325 posts 11170 karma points MVP 5x admin c-trib
    Jun 18, 2018 @ 11:05
    Dave Woestenborghs
    0

    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

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Jun 18, 2018 @ 11:14
    Tim Geyssens
    0

    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/

  • Matt 308 posts 730 karma points
    Jun 18, 2018 @ 11:38
    Matt
    0

    Hello,

    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

    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:

    Defining a default sort order on https://umco.github.io/umbraco-fluidity/api/collections/

    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

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Jun 18, 2018 @ 11:40
    Tim Geyssens
    0

    Hey Matt, I think if you want to sort you'll need the SetSortProperty method

    collectionConfig.SetSortProperty(p => p.FirstName);

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Jun 18, 2018 @ 11:41
    Tim Geyssens
    0

    and I don't think you can only disable create and leave update and delete available it's all crud or read only

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Jun 18, 2018 @ 11:43
    Tim Geyssens
    0

    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/

  • Matt 308 posts 730 karma points
    Jun 18, 2018 @ 12:02
    Matt
    0

    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

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Jun 18, 2018 @ 12:05
    Tim Geyssens
    0

    Hey Matt, how does your poco model look?

  • Matt 308 posts 730 karma points
    Jun 18, 2018 @ 12:08
    Matt
    0

    Hello Tim,

    Here is my file;

    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; }
        }
    }
    

    The only columns I have in my database are;

    ID Name Email Message

    Thank you

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Jun 18, 2018 @ 12:10
    Tim Geyssens
    0

    Yeah then you'll need to expand your model and table with the new created field

  • Matt 308 posts 730 karma points
    Jun 18, 2018 @ 14:55
    Matt
    0

    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

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Jun 18, 2018 @ 14:57
    Tim Geyssens
    0

    Or you could update the column to allow nulls?

  • 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.

Please Sign in or register to post replies