Giter Site home page Giter Site logo

grav-plugin-flex-directory's People

Contributors

rhukster avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grav-plugin-flex-directory's Issues

File uploads are not saving

I've added a file upload field to FlexDirectory, but the file I upload is not being saved. There is no error, and FlexDirectory says "Successfully saved". I am using the latest FlexDirectory version.

Here is my new entires.yaml:

title: Flex Directory
form:
  validation: loose

  fields:
    published:
      type: toggle
      label: Published
      highlight: 1
      default: 1
      options:
        1: PLUGIN_ADMIN.YES
        0: PLUGIN_ADMIN.NO
      validate:
        type: bool
        required: true
    last_name:
      type: text
      label: Last Name
      validate:
        required: true
    first_name:
      type: text
      label: First Name
    email:
      type: email
      label: Email
      validate:
        required: true
    website:
      type: text
      label: Website
    item_image:
      type: file
      label: Item Image
      random_name: true
      destination: 'user/data/flex-directory/files'
      multiple: true
    tags:
      type: selectize
      size: large
      label: Tags
      classes: fancy
      validate:
        type: commalist

    # Don't mess with this stuff below unless you know what you are doing
    tools_section:
      type: section
      field_classes: overlay bottom

      fields:
        _post_entries_save:
          label: PLUGIN_FLEX_DIRECTORY.AFTER_SAVE
          type: save-redirect
          default: create-new

Access for groups

Would it be possible to include configuration that tells which group(s) that should have access to this plugin?

How to setup flex-directory for multiple collections of entries

Hello,

This may be outside the scope of your plugin, but I was wondering if you have established a pattern for using flex-directory to manage several entries collections.

For instance, I would like to use flex-directory to manage both a collection of users like in your example, and a set of real estate properties.

After reading the source it seems like flex-directory can only manage one collection at a time. Would you recommend forking the plugin and installing a modified version of it for every collection I want to manage?

Thanks,
Austin

improve workflow

once we add our data, and click on save - page opens up and we see that it's Successfully saved.
In that point there should be Add+ button present again !

So that whole experience of creating runs more smoothly.

Conflict with Email plugin

Hello,
Grav beginner here. Thanks for making this awesome platform.

I ran into a problem with the e-mail plugin that appears to be caused by flex-directory. On a fresh Grav install I

  • Configured the e-mail plugin
  • Sent a test e-mail with bin/plugin email test-email: no problem
  • Installed the flex-directory plugin
  • test-email now fails with the message [Pimple\Exception\UnknownIdentifierException] Identifier "flex-entries" is not defined.
  • Disabled flex-directory; test-email works fine again

File uploads incompatible with avoid_overwriting: true

This is kind of follow on from issue 11
It is also not working properly with form setting of avoid_overwriting: true

I have that setting working fine for a frontend form where the file name gets prefixed with some other string and the original file which had the same name does not get overwritten, also output from the form references the new file name correctly.

However with flex directory, the file is overwritten and the name stays the same. Even if you assume not t support avoid_overwriting: true this breaks down since if you add a file that has the same file, OK. The big problem comes if you try to fix it and delete the file (via flex-directory) then the other directory entries that referenced the file do not have the entry removed and they point to a file that does not exist anymore. This then has flow on effects in the front end display of the directory entries as well

Hoping is can be updated to support avoid_overwriting: true

Editor doesn't work properly

I have

Grav v1.5.5
Admin v1.8.14
Flex-Directory v2.0.1

When I add a new entry and I have a field as editor, the editor doesn't work properly. There is an "x" from nowhere shown in the editor, if you type something the content has a gray background. Here is a screenshot.

screenshot_2018-11-30 flexdirectory bots n bards 2

These problems don't happen to the editor for Grav pages or to any other places in Admin area.

Here is the content of my user/data/flex-directory/entries.yaml

title: Flex Directory
form:
  validation: loose

  fields:
    bookinfo:
        type: section
        title: Book Info
        underline: true
        fields:
            description:
                type: markdown
                label: description
                validate:
                    type: textarea
                autofocus: true

Retrive file link after file upload

Hi, I have added the FIle Upload in the blueprint to allow the uploading of images in Flex Directory
like this:

item_image:
  type: file
  label: Item Image
  random_name: true
  destination: 'user/data/flex-directory/files'
  multiple: true

in the site.html.twig i've tried using

{{ entry.item_image }}
or
{{ entry.item_image.0.path }}
but didn't work, how can I retrieve the uploaded image file link to insert it in a src in image tag?

entry example below:

"jjlwytrypa3u65cw": {
    "date_entered": "18-11-2017 15:52",
    "published": true,
    "highlighted": false,
    "description": "Awesome Villa!",
    "price": 432000,
    "listing_type": true,
    "website": "www.myawesomevilla.com",
    "comforts": [
        "olive garden",
        "barbecue",
        "garage"
    ],
    "tags": [
        "luxury",
        "signature architecture"
    ],
    "item_image": {
        "user\/data\/flex-directory\/files\/TeGoV4IDpJgMwbP.png": {
            "name": "TeGoV4IDpJgMwbP.png",
            "type": "image\/png",
            "size": 1424409,
            "path": "user\/data\/flex-directory\/files\/TeGoV4IDpJgMwbP.png"
        }
    }
}

Thanks
Best

some gantry5 links for editing settings cause Server Error

when I try to edit any Gantry5 setting which should be opened in modal it causes an error.
e.g., I want to add javascript in Gantry5 -> Global Page Settings -> Assets -> Javascript -> + (or edit existing by pressing button with modal link http://mysite/admin/gantry/configurations/default/page/assets/javascript/0?nonce=7fdb388bc6150675040ee00595ecf506)

Server Error
Sorry, something went terribly wrong!
0 - Cannot unset string offsets

[2017-07-17 13:53:19] grav.CRITICAL: Cannot unset string offsets - Trace: 
#0 /var/www/rainhelps/user/plugins/flex-directory/classes/SimpleController.php(34): Grav\Plugin\Admin\AdminBaseController->getPost('{"name":"headro...') 
#1 /var/www/rainhelps/user/plugins/flex-directory/flex-directory.php(56): Grav\Plugin\FlexDirectory\SimpleController->__construct(Object(Grav\Plugin\FlexDirectoryPlugin)) 
#2 [internal function]: Grav\Plugin\FlexDirectoryPlugin->onPluginsInitialized(Object(RocketTheme\Toolbox\Event\Event), 'onPluginsInitia...', Object(RocketTheme\Toolbox\Event\EventDispatcher)) 
#3 /var/www/rainhelps/vendor/symfony/event-dispatcher/EventDispatcher.php(184): call_user_func(Array, Object(RocketTheme\Toolbox\Event\Event), 'onPluginsInitia...', Object(RocketTheme\Toolbox\Event\EventDispatcher)) 
#4 /var/www/rainhelps/vendor/symfony/event-dispatcher/EventDispatcher.php(46): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'onPluginsInitia...', Object(RocketTheme\Toolbox\Event\Event)) 
#5 /var/www/rainhelps/vendor/rockettheme/toolbox/Event/src/EventDispatcher.php(23): Symfony\Component\EventDispatcher\EventDispatcher->dispatch('onPluginsInitia...', Object(RocketTheme\Toolbox\Event\Event)) 
#6 /var/www/rainhelps/system/src/Grav/Common/Grav.php(277): RocketTheme\Toolbox\Event\EventDispatcher->dispatch('onPluginsInitia...', Object(RocketTheme\Toolbox\Event\Event)) 
#7 /var/www/rainhelps/system/src/Grav/Common/Processors/PluginsProcessor.php(19): Grav\Common\Grav->fireEvent('onPluginsInitia...') 
#8 /var/www/rainhelps/system/src/Grav/Common/Grav.php(126): Grav\Common\Processors\PluginsProcessor->process() 
#9 /var/www/rainhelps/system/src/Grav/Common/Grav.php(368): Grav\Common\Grav->Grav\Common\{closure}() 
#10 [internal function]: Grav\Common\Grav::Grav\Common\{closure}('plugins', 'Plugins', Object(Closure)) 
#11 /var/www/rainhelps/system/src/Grav/Common/Grav.php(344): call_user_func_array(Object(Closure), Array) 
#12 /var/www/rainhelps/system/src/Grav/Common/Grav.php(127): Grav\Common\Grav->__call('measureTime', Array) 
#13 /var/www/rainhelps/index.php(52): Grav\Common\Grav->process() 
#14 {main} [] []

screen

Flex directory - File Field vs json file

Hi Andy,
Thanks for this nice pluging.

Quick question:
I added the flex-directory with a custom file field (ok). I'm trying to fixe the data display into : entries-list.html.twig, but how to access to the file name of the picture if the custom_file index is the url of the picture ("user/data/flex-directory/assets/crane-small.png" in my case)?
=>this value is different for each file uploaded, how can replace by "file" and than access to : {{ entry.custom_file["file"].name}}
Do you have a bypass?

**My generated Json **
{ "jbytisllmzxu63rq": { "published": true, "last_name": "cab", "first_name": "gui", "email": "[email protected]", "website": "www.sli.fr", "adress": "rue de gex, 01210 Ferney Voltaire", "tags": [ "3DPrinting" ], "custom_file": { "user\/data\/flex-directory\/assets\/crane-small.png": { "name": "crane-small.png", "type": "image\/png", "size": 176974, "path": "user\/data\/flex-directory\/assets\/crane-small.png" } } }, }

My template
{{ entry.custom_file["user\/data\/flex-directory\/assets\/crane-small.png"].name}}
=> did work: {{ entry.custom_file[0].name}}
Result
Flex-directory/File colunm display: crane-small.png
(it can be also if you need, the url to display the picture...)
Thanks by advance for your help
Regards

Delete entry issues

When clicking `Delete Entry' button:

Delete Studio

Are you sure you want to permanenatly delete the studio? 
  1. Rename: Studio to Entry (2 instances)
  2. Typo: permanenatly
  3. Runtime error
`RuntimeException (400)
Template "partials/entries/gbsfg2tvnvbvstdi-list.html.twig" is not defined in "flex-directory.html.twig" at line 39.`

Custom form with textarea editor field

we can't display correctly an textarea editot field to the flex-directory form.

#entries.yaml
 title: My title
form:
  validation: loose
  fields:
    decription:
        type: editor
        label: Description
        autofocus: true
        codemirror:
            mode: 'yaml'
            indentUnit: 4
            autofocus: true
            indentWithTabs: false
            lineNumbers: true
            styleActiveLine: true
            gutters: ['CodeMirror-lint-markers']
            lint: true

...

when we do, the textarea be something weird

capture du 2017-10-25 16-18-42

we found how to work around the problem by displaying a textarea field and read the text in markdown in the .twig page

#entries.yaml

...
decription:
        type: textarea
        label: Description
        validate:
          type: textarea

...

#target_page.html.twig

...
<div class="entry-content">
    {{data.decription|markdown}}
</div>

...

But i think it will be better if we found a way to display a textarea editor field

Two instances of grav-plugin-flex-directory

Would it be possible to have two different instances of grav-plugin-flex-directory on the same site?
I would really like to be able to use it for both listing members (people) and events.
Two different formats for data content, and two different templates for presentation

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.