trilbymedia / grav-plugin-flex-directory Goto Github PK
View Code? Open in Web Editor NEWFlexible plugin that allows CRUD functionality on complex data types
License: MIT License
Flexible plugin that allows CRUD functionality on complex data types
License: MIT License
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.
When I try to make a form field as an editor it renders incorrectly in the admin of flex directory and it doesn't parse the content as markdown.
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
bin/plugin email test-email
: no problemtest-email
now fails with the message [Pimple\Exception\UnknownIdentifierException] Identifier "flex-entries" is not defined.
test-email
works fine againHi, 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
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
In readme, it references flex-directory-cols.html.twig
, but the file is named site.html.twig
in the flex-directory
and not in partials
. Which one should it be?
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
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.
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
When clicking `Delete Entry' button:
Delete Studio
Are you sure you want to permanenatly delete the studio?
Studio
to Entry
(2 instances)permanenatly
`RuntimeException (400)
Template "partials/entries/gbsfg2tvnvbvstdi-list.html.twig" is not defined in "flex-directory.html.twig" at line 39.`
Would it be possible to include configuration that tells which group(s) that should have access to this plugin?
I got it, so never mind any more. ;)
https://discourse.getgrav.org/t/grav-flex-directory/5054/7
Hej guys!
I wonder how it's possible to get the data from different fields within multiple fields of the list formfield and show the contents in the directory-table in the backend. I tried various combinations of loops but always no output at all. Is flex-directory capable of doing this?
Christian
:)
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
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} [] []
error when a field is named "task" and is required. It says that the field is invalid.
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
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
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
Adding action not work when param_sep is set to ; (for Apache running on Windows).
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
In admin, clicking the Website header toggles the asc/desc indicator but no sort is performed.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.