Snippets
An dieser Stelle können von mir im Blog veröffentlichte oder verlinkte Code Snippets zentral gefunden werden.
Drupal CMS: Change user profile title & tab title
Since I needed some time to find out how to change the user profile tabs title and page title, I'd like to share that information with you.
Drupal 7: Decorate / wrap existing form as separate form with individual path
It's not an untypical situation: You'd like to use an existing Drupal CMS form as base for a custom form under a separate URL. In our example case we will decorate the Registration form "user_register_form" and create a separate registration form under a separate URL. This might be a custom alternative to modules like https://www.drupal.org/project/multiple_registration if they don't match your requirements.
Shopware 5 SEO Router (URLs) aus Freitextfeldern / Attributen überschreiben
Heute hatte ich die kleine Herausforderung in Shopware 5 URL's per Freitextfeld-Attribut (z.B. attr20) SEO-URLs diverser Seitentypen manuell zu übersteuern.
Dies erfolgt über die Einstellungen > Grundeinstellungen > SEO/Router-Einstellungen.
Shopware Smarty Plugin URL im Template sauber erstellen mittels Controller (Seiten / Formulare / ...)
Shopware 5 bietet mit einem entsprechenden Smarty Plugin eine gute und sichere Lösung zur URL-Generierung im Template an. Dazu wir die Smarty funktion "url" verwendet, der entsprechende Parameter übergeben werden.
Details dazu finden sich in der Shopware Dokumentation: https://developers.shopware.com/designers-guide/smarty-plugins/#url-plugin
Composer set memory_limit in bash
PHP Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 67108864 bytes) in ...
If you are running into a memory_limit when using composer, there are many ways to solve the problem. Finally I'm hoping for enhancements in composer to require less memory. But until that I've found a quick solution in bash:
Drupal 8 Media: Format file size output / display
If you'd like to output Drupal 8 Media file size (mapper field) output in human-readable format, this snippet may help you!
in MYTHEME.theme file:
- function MYTHEME_preprocess_media(&$variables) {
- /** @var \Drupal\media_entity\MediaInterface $media */
- $media = $variables['elements']['#media'];
Shopware 5 PLZ-Bereich (Umkreis) versandkostenfrei für ausgewählte Kategorien
(IFNULL(us.zipcode,ub.zipcode) IS NOT NULL) AND (IFNULL(us.zipcode,ub.zipcode) IN ('32312', '32310', '12345'))
AND
MIN(SELECT 1 FROM s_articles_categories WHERE articleID=a.id AND categoryID IN (22,56)) AS erlaubtekategorie
Drupal 8: Override views row (views-view-fields.html.twig) in views style plugin
In the last days I developed the ZURB Foundation Views integration module for Drupal 8. To match the markup required by foundation accordion we first had to write a views style plugin in our module.
JTL-Shop4 Exportformat mit Varianteneigenschaften im Artikelnamen (z.B. für Idealo)
Nachfolgend das JTL Shop 4 Exportformat am Beispiel Idealo, wenn ihr Name und Wert der Varianten direkt hinter dem Artikelnamen ausgeben möchtet.
Dieser Trick wird z.B. verwendet, um Klicks auf (Kind-)Artikel zu vermeiden, die nur noch in bestimmten Größen lieferbar sind.
{strip}
{assign var="d" value="|"}
{$Artikel->kArtikel}{$d}
{$Artikel->cDeeplink}{$d}
Snippet: Drupal 8 Commerce: Show SKU in product variation inline entity form table
Today I'd like to share a little snippet with you on how to add or remove fields from the inline entity form line items table in a product edit form.
By default that inline entity form table contains
- Weight
- Product variation title
- Price
- Status
- Operations
What we'd like to do in our example is to
Euch gefällt mein Blog?
Vielleicht hilft mir auch ein Buch, euch zukünftig (noch) bessere Artikel zu bieten? (Amazon Wunschliste)
Gerne bewerte ich auch ab und zu einmal unabhängig ein Produkt.
Ich freue mich über jede Art der Unterstützung in Form von Kommentaren, Lob oder Kritik.
Auf zum Kontaktformular!
Zu meinem Google+ Profil
Julian Pustkuchen, M. Sc. Wirtschaftsinformatik ist passionierter Software- & Webentwickler mit den Schwerpunkten Softwaredesign, Objektorientierung sowie Usability- & Ablaufoptimierung bei webks. Ein weiterer Schwerpunkt ist die Entwicklung im CMS Drupal.
Entwickelt Julian gerade keine Software, fährt er Ski, Mountainbike, spielt Badminton, segelt oder verbringt Zeit mit Freunden.
Dieser Blog dient als sein "öffentlicher Notizblo(ck/g)".
Webbasierte Lösungen? Machen wir!
webks: websolutions kept simple
http://www.webks.de
Dir hat dieser Beitrag viel Zeit und Nerven gespart?
Dann freue ich mich über jede kleine Anerkennung:
Oder du suchst weitere professionelle Unterstützung?
Dann bietet dir unser webks.de Softwareentwickler-Team professionelle Dienstleistungen im Web-Development und der Drupal CMS Entwicklung!