-
Notifications
You must be signed in to change notification settings - Fork 7
Maked table depending on blueprint values #8
Conversation
I'll take a look at this soon.. thanks. |
I like this but i want to investigate a bit more to make it a handle the sort option a bit better. |
Yes, I actually wrote it for my custom data collection, not the default of your plugin. |
Yah i like the idea of making the list more blueprint-driven. However, I think we can actually put custom fields in the blueprint YAML that the list can use. Ie, the 'sortable', 'searchable', 'width' options etc. |
We could do even like so: fields:
published:
type: toggle
label: Published
highlight: 1
default: 1
options:
1: PLUGIN_ADMIN.YES
0: PLUGIN_ADMIN.NO
validate:
type: bool
required: true
# We could add
column:
type: editable # Just for example
width: 18
# And so on... |
I've done the same in my feature branch, though I didn't store this information in the form part but into a separate configuration. |
👍 |
I'm going to make a few changes.. :) |
yes - this is just a sketch ;) |
@Piterden I think you like the changes I made. It's still pretty much work in progress, but I have a branch that added support for multiple directories. It also added new I reverted your changes in the original file -- I'm now using new folder structure, which allows easier customization. To test this out, just add following code to title: Clients
description: Client list.
type: flex-directory
config:
admin:
list:
fields:
name:
link: edit
company:
email:
phone:
width: 15
zip:
width: 10
data:
storage: user://data/directory/clients.yaml
form:
validation: loose
fields:
id:
type: text
label: Id
validate:
required: true
name:
type: text
label: Full Name
validate:
required: true
company:
type: text
label: Company
email:
type: email
label: Email Address
validate:
required: true
phone:
type: text
label: Phone Number
zip:
type: text
label: Zip Code
ip:
type: text
label: IP Address After that just edit directories:
- blueprints://flex-directory/clients.yaml For frontend you need
And also template file {% set directory = grav.flex_directory.directory(type) %}
{% set data = directory.collection.getData().toArray() %}
<div id="flex-directory">
<ul class="list">
{% for entry in data %}
<li>
<div class="entry-details">
<h3>{{ entry.name }} <small><{{ entry.email }}></small></h3>
<p>Company: {{ entry.company }}</p>
<p>ZIP: {{ entry.zip }}</p>
</div>
</li>
{% endfor %}
</ul>
</div> If you add multiple types, both admin and site will have types list as landing page. :) Happy testing. PS. This only works in my |
I have one not a bad example in Vue. For the inspiration. |
Hello! I am using the Flex Directory plugin with the modifications to create multiple entries, I found AMAZING, I was interested in this option. Much obliged! But now you have an old problem with the image field again. It gives the following error: I'm using: Form Yaml thumbnail: |
No description provided.