Git Product home page Git Product logo

Comments (7)

skerbis avatar skerbis commented on August 17, 2024 1

Getestet und gut

from tricks.

skerbis avatar skerbis commented on August 17, 2024

Gerne.

from tricks.

eaCe avatar eaCe commented on August 17, 2024

@skerbis willst du das vielleicht zunächst gegentesten?

Ich habe ein paar Funktionen erweitert und das ganze etwas aufgehübscht (siehe Screenshot).

Bildschirmfoto am 2021-10-03 um 08 19 40

Zunächst muss Alpinejs eingebunden werden.
Ich habe das einfach über das Project Addon gemacht...

if (rex::isBackend() && rex::getUser()) {
    rex_view::addJSFile('//unpkg.com/alpinejs', [rex_view::JS_DEFERED => true]);
}

Modul Input:
https://gist.github.com/eaCe/38186743b325ca5953cfc7858b47364f

Output zum testen:

<?php
$accordionItems = json_decode(html_entity_decode(REX_VALUE[1]));
echo '<pre>';
var_dump($accordionItems);
echo '</pre>';
?>

from tricks.

skerbis avatar skerbis commented on August 17, 2024

Wie verhält es sich mit Widgets aus REDAXO und ggf. Texteditoren?

from tricks.

eaCe avatar eaCe commented on August 17, 2024

Für Widgets und Texteditoren muss man die Funktionalität natürlich erweitern.
Ich habe das erst mal nicht berücksichtigt.

Wenn alle möglichen Felder genutzt werden sollen benötigt man diverse Helper Funktionen. Ich habe testweise mal ein Link-Feld eingebaut. Hierfür benötige ich eine rex_api_function und ein bisschen jQuery. Leider kann man keine jQuery Events in nativen JS einfangen.

Will sagen - es geht, braucht aber weiteren Code. Wenn man das ganze weiterspinnt wird eher ein Addon draus.
Man könnte z.B. die Felddefinitionen über REX_VARs erstellen, in denen dann auch der Alpinejs Kram steht. Und dann die entsprechenden Ajax Funktionen und co… Aber das wäre dann für mich kein Trick oder Tipp mehr.

Wobei ich zumindest beim Link vielleicht doch auf die Helper verzichten kann... Ich muss noch etwas rumexperimentieren...

from tricks.

skerbis avatar skerbis commented on August 17, 2024

Gut 👍 für den Trick ist’s doch schon super.

from tricks.

eaCe avatar eaCe commented on August 17, 2024

Danke @skerbis

from tricks.

Related Issues (20)

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.