"require": {
"craftcms/cms": "^3.0.0"
},
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
{% set variantParam = 'variant' %} | |
{# set product #} | |
{% set product = craft.products.id(productId).one() %} | |
{# set variant #} | |
{% set variant = product.defaultVariant %} | |
{# overvrite default variant with url param #} | |
{% if product.variants|filter(v => v.id == craft.app.request.getParam(variantParam)) is not empty %} |
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 | |
namespace modules; | |
use Craft; | |
use craft\controllers\EntriesController; | |
use craft\controllers\UsersController; | |
use yii\base\ActionEvent; | |
use yii\base\Event; | |
use yii\base\Module; | |
use yii\web\ForbiddenHttpException; |
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 | |
/** | |
* Sample Craft Pest tests. | |
* | |
* @copyright Copyright (c) PutYourLightsOn | |
*/ | |
use markhuot\craftpest\factories\Entry; | |
use markhuot\craftpest\factories\User; |
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
<!DOCTYPE html> | |
<html lang="en-GB"> | |
<head> | |
<title>Spark Demo</title> | |
<meta charset="utf-8"/> | |
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/full.min.css" rel="stylesheet" type="text/css"/> | |
<script src="https://cdn.tailwindcss.com"></script> | |
</head> | |
<body> | |
{# https://tailwindcss.com/docs/container #} |
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
import { AttributeContext, AttributePlugin } from '../types' | |
export const HistoryPlugin: AttributePlugin = { | |
prefix: 'history', | |
mustHaveEmptyKey: true, | |
mustNotEmptyExpression: true, | |
onLoad: (ctx: AttributeContext) => { | |
const { el, expressionFn, store } = ctx | |
const storeNames: string[] = expressionFn(ctx) |