1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-17 02:24:05 +02:00

feat(admin-panel): add RTL url support #62

This commit is contained in:
Awilum
2020-02-17 19:04:28 +03:00
parent 38718ac4a5
commit 2338162f11
3 changed files with 17 additions and 5 deletions

View File

@@ -214,7 +214,11 @@ class EntriesController extends Controller
}
// Set new Entry ID
$id = $parent_entry_id . '/' . $this->slugify->slugify($data['id']);
if ($this->registry->get('plugins.admin.entries.slugify') == true) {
$id = $parent_entry_id . '/' . $this->slugify->slugify($data['id']);
} else {
$id = $parent_entry_id . '/' . $data['id'];
}
// Check if entry exists then try to create
if (!$this->entries->has($id)) {

View File

@@ -7,6 +7,7 @@ route: admin
# entries settings
entries:
items_view_default: list
slugify: true
media:
upload_images_quality: 70
upload_images_width: 1600

View File

@@ -1,6 +1,13 @@
<script>
$("#title").on("keyup change", function () {
var slug = getSlug($("#title").val());
$("#id").val(slug);
});
{% if (registry.plugins.admin.entries.slugify == false) and (is_current_path('admin.entries.add') or is_current_path('admin.entries.rename')) %}
$("#title").on("keyup change", function () {
var slug = $("#title").val();
$("#id").val(slug);
});
{% else %}
$("#title").on("keyup change", function () {
var slug = getSlug($("#title").val());
$("#id").val(slug);
});
{% endif %}
</script>