This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{# Get the requested entry slug from the URL #} | |
{% set requestedSlug = craft.app.request.segments|last %} | |
{# Fetch the entry with that slug #} | |
{% set entry = craft.entries() | |
.slug(requestedSlug|literal) | |
.anyStatus() | |
.one() %} | |
{% if entry|length %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function smarty_modifier_mediaurl($value, $format = array()) | |
{ | |
if (is_numeric($value)) { | |
$id = (int)$value; | |
$media = Shopware()->Models()->getRepository('Shopware\Models\Media\Media')->findOneBy(['id' => $id]); | |
if ($media) { | |
$path = $media->getPath(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shopware [6.1] sudo bin/build-js.sh | |
Password: | |
readlink: illegal option -- f | |
usage: readlink [-n] [file ...] | |
usage: dirname path | |
usage: dirname path | |
npm ERR! code ENOENT | |
npm ERR! syscall open | |
npm ERR! path /vendor/shopware/administration/Resources/package.json | |
npm ERR! errno -2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form class="profile-form" method="post" accept-charset="UTF-8" enctype="multipart/form-data"> | |
{{ actionInput('users/save-user') }} | |
{{ csrfInput() }} | |
{{ hiddenInput('userId', currentUser.id) }} | |
<input type="hidden" name="fields[qualification]" value=""> | |
{% for item in currentUser.qualification %} | |
<input type="hidden" name="fields[qualification][]" value="{{ item.id }}"> | |
{% endfor %} | |
<input type="hidden" name="fields[qualification][new1][enabled]" value="1"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form method="post" accept-charset="UTF-8" enctype="multipart/form-data"> | |
{{ actionInput('users/save-user') }} | |
{{ csrfInput() }} | |
{{ hiddenInput('userId', currentUser.id) }} | |
<div class="grid-x grid-margin-x"> | |
<div | |
class="cell small-12 large-6 weekdays"> | |
{# Show all days with Monday first #} | |
{% set range = currentUser.openingHours.getRange(1, 0) %} | |
{% for day in range %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Sticky plugin to add a class based on the | |
* scroll position. | |
*/ | |
$.plugin('swStickyElement', { | |
defaults: { | |
/** | |
* The css class for the sticky element. | |
* | |
* @property stickyCls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Creates a new promise that automatically resolves after some timeout: | |
Promise.delay = function (time) { | |
return new Promise((resolve, reject) => { | |
setTimeout(resolve, time) | |
}) | |
} | |
// Throttle this promise to resolve no faster than the specified time: | |
Promise.prototype.takeAtLeast = function (time) { | |
return new Promise((resolve, reject) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Simple script to install Cloud9 on an Ubuntu Server | |
apt-get update && apt-get install build-essential -y | |
apt-get install git -y | |
apt-get install nodejs -y | |
apt-get install npm -y | |
apt-get install python2.7 python-pip -y | |
# cd ~/to/your/directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#id-form button[type=submit]').click(function(e){ | |
e.preventDefault(); | |
$(this).text('Einen moment...'); | |
var form = jQuery(this).parents("form:first"); | |
var dataString = form.serialize(); | |
var formAction = form.attr('action'); | |
$.ajax({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"ace": { | |
.... | |
"custom-types": { | |
"json()": { | |
"tpl": "smarty" | |
} | |
} |
NewerOlder