Loops & Logic

Beschreibung

Facebook-Gruppe | Website| Dokumentation |offizielles Support-Forum

Loops & Logic ist ein Hilfsmittel, das dir eine umfassende Kontrolle über die Anzeige von WordPress-Inhalten und -Daten im Frontend deiner Website ermöglicht, wenn dein Theme oder Builder nicht die Optionen hat, die du benötigst. Dieses Plugin gibt dir die Möglichkeit, individuelle PHP-Themes und Builder-Module mit einer vereinfachten HTML-ähnlichen Syntax zu entwickeln, die jedem Frontend-Entwickler vertraut sein dürfte.

Support

Hauptfunktionen

  • Nutze HTML-Templates mit dynamischen Schlagwörtern wie Loop, Field und If
  • Verwende Regeln für die Position eines Themes, um individuelle Templates auf Inhaltstypen, Taxonomien und mehr anzuwenden (ähnlich wie bei Beaver Themer oder Elementor Theme Builder)
  • Einfache Einbindung (enqueue) von CSS-Stylesheets und Javascript überall mit einem visuellen Regelersteller für die Positionierung
  • Schreibe dein CSS lückenlos direkt in SASS, ohne dich um die Kompilierung zu kümmern
  • Erstelle Abfragen loops von allen Inhaltarten wie zum Beispiel: Beiträge, Seiten, individuelle Inhaltstypen, Anhänge, Benutzer, Taxonomien und Begriffe
  • Integrierte und individuelle Felder anzeigen
  • Bilde eine Logik, um Dinge basierend auf bestimmten Bedingungen anzuzeigen, z. B.: Ein Menü mit einigen Links nur für eingeloggte Benutzer oder für eine Benutzerrolle erstellen
  • Erstelle individuelle Shortcodes, um alles – von einem individuellen Feld bis hin zu einer kompletten dynamischen, datengesteuerten Webseite – anzuzeigen

Anwendungsbeispiel

Der Kern von L&L ist die Fähigkeit, schnell und elegant durch WordPress-Daten zu laufen, wie in diesem Beispiel, in dem eine Liste von Links zu den drei aktuellsten Beiträgen angezeigt wird

<ul>
  <Loop type=post count=3 orderby=date order=desc>
    <li>
      <a href="{Field url}"><Field title /></a>
    </li>
  </Loop>
</ul>

Dasselbe in PHP zu erreichen, ist wesentlich komplexer:

<?php
$args = array(
    'post_type' => 'post',
    'posts_per_page' => 3,
    'orderby' => 'date',
    'order' => 'DESC',
);
$query = new WP_Query( '$args' ); ?>
<?php if ( $query->have_posts() ) : ?>
  <ul>
    <?php while ( $query->have_posts() ) : $query->the_post(); ?>

      <li>
        <a href="<?php the_permalink(); ?>">
          <?php the_title(); ?>
        </a>
      </li>

    <?php endwhile; ?>
  </ul>
<?php endif; ?>

Es kann schwierig sein, PHP zu deiner Website hinzuzufügen, wenn du kein Backend-Entwickler bist, aber mit L&L ist es ein Kinderspiel, selbst in einem Page-Builder-Layout.

Page-Builder wie Gutenberg, Elementor und Beaver Builder haben oft Defizite in ihren Funktionen, die normalerweise erfordern würden, dass du entweder ein individuelles Add-on entwickelst oder ein aufgeblähtes Add-on-Paket kaufst, nur um das eine Element zu bekommen, das du brauchst. L&L fügt ein Template-Editor-Modul direkt zu jedem Page-Builder hinzu, so dass du einfach beschreiben kannst, was du im L&L-Code anzeigen möchtest und es dann über die Page-Builder-Schnittstelle platzieren kannst. Du kannst sogar deinen L&L-Code zwischen den Page-Buildern kopieren und einfügen, wenn du mit mehr als einem arbeitest! Es ist, als hättest du deine eigene Addon-Fabrik für den Page-Builder.

Plugin- und Theme-Support

Plugin-Support

Loops & Logic funktioniert mit den Inhaltstypen und individuellen Feldern, die von den meisten Plugins hinzugefügt werden, aber Plugins mit speziellen Datenstrukturen, wie z. B. individuelle Tabellen oder Felder mit Datumsformaten, die geparst werden müssen, erfordern eine explizite Unterstützung durch uns.

Gebündelte Integrationen:

✅ Advanced Custom Fields (ACF)

L&L unterstützt die Kern-Feldtypen von Advanced Custom Fields (ACF), so dass du mit den meisten ihrer Feldtypen sofort arbeiten kannst! Wir planen auch, andere WordPress-Plugins für individuelle Felder wie Pods und Metabox in der Zukunft zu unterstützen.

<Loop acf_flexible=field_name>
  <If field=layout value=layout_1>

    Layout 1
    <img src="{Field acf_image=field_name field=url}" />
    <Field acf_editor=field_name />

  <Else if field=layout value=layout_2 />

    Layout 2
    <Field acf_editor=field_name />
    <img src="{Field acf_image=field_name field=url}" />

  </If>
</Loop>

✅ Elementor

Loops & Logic bietet ein Elementor-Widget, mit dem man entweder L&L-Code direkt in das Page-Builder-Widget schreiben oder aus einem bereits vorhandenen, gespeicherten Template auswählen kann.

✅ Gutenberg

Loops & Logic bietet einen Gutenberg-Block, mit dem man entweder L&L-Code direkt in den Block-Builder-Block schreiben oder aus einem bereits vorhandenen, gespeicherten Template auswählen kann.

✅ Beaver Builder

Loops & Logic bietet ein Beaver-Builder-Modul, mit dem man entweder L&L-Code direkt in das Page-Builder-Modul schreiben oder aus einem bereits vorhandenen, gespeicherten Template auswählen kann.

✅ WP Grid Builder

Loops & Logic bietet einen WP-Grid-Builder-Block, mit dem man aus einem bereits vorhandenen, gespeicherten Template auswählen kann, um es in WP Grid Builder zu laden.

✅ WP Fusion

Die kostenlose WP-Fusion-Integration ermöglicht es dir, bedingte Logik zu verwenden, um verschiedene Inhalte basierend auf den Schlagwörtern eines Benutzers zu schützen oder anzuzeigen.

<If user_field=wp_fusion_tags includes value="123">
  User has tag ID 123
<Else />
  User does not have tag.
</If>

In den kommenden Monaten werden wir Premium-Add-ons für beliebte Plugins auf den Markt bringen. Schau also auf unserer Website nach, um zu sehen, was verfügbar ist!

Premium-Add-ons, die bald veröffentlicht werden:

  • WooCommerce
  • Easy Digital Downloads
  • Modern Tribe Events Calendar
  • Gravity Forms
  • LearnDash
  • LifterLMS

Theme-Support

Es funktioniert mit allen Themes, die nach den WordPress-Standards erstellt wurden.

Blöcke

Dieses Plugin unterstützt 1 Block.

  • Loops & Logic

Installation

  1. Installieren und aktivieren im Adminbereich: Plugins -> Installieren -> Plugin hochladen

Rezensionen

22. Oktober 2023
As I am not a programmer, I was struggling really hard for a long time to output the images from an ACF gallery field as a slider on a single custom post template. I can't believe it took me so long to find this plugin and it took me only an hour to create what I wanted using an external slider script (splide). Absolutely amazing tool. I am excited to dive deeper into the possibilities! Thank you for this genius plugin!
3. Oktober 2023
I needed help when swapping Custom Content Shortcode for Loops and logic. With outstanding support, I got the swap done in no time, and with an improved result! This must be one of the very best plugins out there, with very dedicated people behind it. THANK YOU!
26. August 2023
I've only just scratched the surface of what this fantastic plugin can do. I'm really excited to add this to my standard go-to toolbox for WordPress development and lean more about the extensive functionality over time. Thanks a lot for all the efforts making this plugin happen!
12. August 2023
This plugin is just brilliant. Can't believe I only found this now. I went through dozens of ways to display dynamic content on my site, but this just blows them all away. It's super flexible, incredibly extensive and works intuitive. Really excited to see where this project will go in the future. Keep up the good work! 😀
24. Juli 2023
So compatible with Divi Builder. Simple and great tool joins dinamics ACF.
Alle 38 Rezensionen lesen

Mitwirkende & Entwickler

„Loops & Logic“ ist Open-Source-Software. Folgende Menschen haben an diesem Plugin mitgewirkt:

Mitwirkende

„Loops & Logic“ wurde in 2 Sprachen übersetzt. Danke an die Übersetzerinnen und Übersetzer für ihre Mitwirkung.

Übersetze „Loops & Logic“ in deine Sprache.

Interessiert an der Entwicklung?

Durchstöbere den Code, sieh dir das SVN Repository an oder abonniere das Entwicklungsprotokoll per RSS.

Änderungsprotokoll

4.1.3

Release Date: 2024-03-22

  • ACF Date/Time field: Add tests for field comparison with timestamps
  • Base loop: Improve casting query parameter to array when non-string value is passed
  • Beaver integration: Ensure Template module restores current post in context
  • Taxonomy term loop: Handle case when include/exclude is given as integer ID
  • Template save and format slugify: Use remove_accents() to convert all accent characters to ASCII characters, before creating slug with sanitize_title_with_dashes()

4.1.2

Release Date: 2024-03-15

  • ACF integration
    • Date field types: Ensure unformatted value is passed to date conditions
    • Group, Flexible Content, Repeater: Correctly set up subfield loop after change to List loop type to support extended parameters such as offset/count/sort/filter
  • Post loop: Handle case when extended query parameter for post/user/category/tag slug is not array
  • Sass module: Revert to SCSS-PHP 1.11.1 to keep compatibility with PHP 7.4
  • Taxonomy term loop: Correctly pass post object IDs to query

4.1.0

Release Date: 2024-03-12

  • ACF integration
    • Breaking change: Date field types now get their default formatting from the field setting for Return Format. Previously the defaults were from site setting (Date field), „Y-m-d H:i:s“ (Date/Time), and „H:i:s“ (Time). Now they use the selected format in each field’s settings, or ACF’s default return format: „d/m/Y“ (Date), „d/m/Y g:i a“ (Date/Time), and „g:i a“ (Time).
    • Improve handling of „format“ and „locale“ attributes
  • Editor
    • Formatter
    • Add keyboard shortcuts to support formatting by entire document or selected lines
    • Start a fork of Prettier HTML formatter to customize based on template language definition
    • Linter: Improve HTML linter rule for unique ID so it applies only to static tags
    • Update CodeMirror modules and Prettier
  • HTML module
    • Add comprehensive HTML test suite with test files from Parse5, Prettier, and Unified
    • Refactor to improve performance: ~3% faster
  • Loop types
    • Consolidate everywhere that accepts a list to support comma-separated list and JSON array
    • Improve sort by field using „field_compare“
    • List, Map, Map Keys: Support query parameters for base loop, such as offset, count, sort, filter, pagination
    • List: Use field name „value“, like „sort_field=value“
    • Map keys: Use field name „key“ or „value“. Keep default order of keys as defined, unless „sort_field=key“ is applied – previously was sorted alphabetically.
  • Gutenberg integration: Template block: Remember previously selected template when switching tabs
  • Sass module: Upgrade Sass compiler (scssphp) to 1.12.1, and CodeMirror Sass language support
  • Taxonomy term loop: Ensure „post“ attribute accepts list variable
  • Template post types: Ensure templates always have a universal ID assigned, during post save and before exporting. This improves how duplicate templates are handled during import.
  • Template tag/shortcode: Ensure no post matches if attribute „name“ is an empty string – See WP_Query matches any post when query parameter „name“ is an empty string

4.0.2

Release Date: 2024-01-18

  • ACF integration: For relational fields, apply loop query parameters such as sort, order, paged, and exclude
  • Editor: Change key map to expand Emmet abbreviation to Shift+TAB, to prevent conflict with TAB to select autocomplete suggestion
  • Framework: Improve plugin settings page styles
  • Paginator: Improve how AJAX script is loaded
  • Post loop: Support use of exclude and include together, which is not natively supported by WP_Query

4.0.1

Release Date: 2024-01-04

  • Fix issues related to code reorganization: Mobile Detect and WP Fusion; Add integration tests to ensure no regression

4.0.0

Release Date: 2024-01-03

  • Documentation: Reference pages for developers and contributors, with technical details of how the codebase is organized.
  • Editor: New code editor based on CodeMirror 6 is enabled by default for template post types, Gutenberg, and ACF Template field. The old editor is still used for Elementor and Beaver Builder until integration is complete.
  • Framework and Modules: Features have been organized into modules which can be independently built, documented, tested, and optionally published. This replaces the previous Plugin Framework and Interface module.
  • GitHub repository: New home of the Template System source code and project, with better developer experience and social collaboration. Welcome to start new issues, pull requests, and discussions.
  • Testing: Improve coverage of unit tests, and prepare foundation for end-to-end tests with headless browser and WordPress environment in Docker. This is an on-going effort to exercise and verify all features of the plugin.

Other improvements:

  • ACF integration: Add Field tag attribute „acf_textarea“ to apply formatting based on field settings
  • Archive screen: Add bulk action to move selected posts to trash
  • Assets edit screen: Improve documentation
  • Atomic CSS: Generate CSS utility classes on demand.
    Similar to Tailwind, this feature uses a style engine called UnoCSS to generate CSS rules from utility classes found in an HTML template, every time it is saved. On the frontend, the generated styles are minified together, removing any redundant rules. Enable in plugin settings.
  • Edit screen: Add Preview pane with auto-refresh
  • Editor: Hyperlink extension – Add clickable link icon next to a valid URL; Improve color picker
  • Import/Export
    • Add export rule to include/exclude template categories
    • Update PNG Compressor with better support for Firefox
    • Use compressed format (PNG) by default
  • Show admin menu, edit screens, and template editor (Gutenberg, Elementor, Beaver) only to admins with unfiltered_html capability. On multisite installs, by default only network admins have this capability, not subsite admins.
  • Update included libraries
    • HJSON, Select2, Chart.js, Mermaid, ..
    • Prism: Update library to 1.29.0 – Replace Clipboard.js with browser-native navigator.clipboard