stem-press / stem Goto Github PK
View Code? Open in Web Editor NEWApplication framework for WordPress
Application framework for WordPress
I am using knowledge-base to build theme. It loads module stem-press/stem. I stuck when I try to create a block gutenberg and It doesn't load group field
I created block class to register a block gutenberg. Here is content of class
<?php
namespace ConceptualStudio\Blocks;
use Stem\Core\UI;
use Stem\UI\Block;
use Stem\Core\Context;
use ConceptualStudio\Utilities\Link;
use \StoutLogic\AcfBuilder\FieldsBuilder;
use ConceptualStudio\FieldsBuilder\LinkBuilder;
class HomeBecomePartners extends Block {
public $cta = null;
public function __construct(Context $context, UI $ui, $data = null) {
$this->title = "Home - Become Partners";
$this->description = "Home - How We Become Partners";
$this->category = "HHG";
$this->icon = "smiley";
$this->keywords = ["hhg", "home", "become", "partners", "section"];
$this->template = "blocks.home-become-partners";
parent::__construct($context, $ui, $data);
// vomit($this);
}
protected function configureFields() {
$link = new LinkBuilder('cta');
$block = new FieldsBuilder('home-democratize-health');
$block
->addText('caption', ['label' => 'Caption'])
->addText('title', ['label' => 'Title'])
->addImage('backgroundImage', ['label' => 'Background Image'])
->addImage('mobileBackgroundImage', ['label' => 'Mobile Background Image'])
->addTextarea("content", ['label' => "Content"])
->addGroup("cta", ['label' => "CTA"])
->addFields($link->loadField())
->endGroup();
return $block->build();
}
}
Content of LinkBuilder.php. This class to build group FieldBuilder
<?php
namespace ConceptualStudio\FieldsBuilder;
use \StoutLogic\AcfBuilder\FieldsBuilder;
/**
* Class LinkBuilder
* @package ConceptualStudio\Models\Core
*/
class LinkBuilder extends FieldsBuilder
{
public function __construct($name) {
parent::__construct($name, []);
}
public function loadField() {
$this
->addSelect('type', ['lable' => 'Title'])
->addChoice('none',"None")
->addChoice('post',"Page / Post")
->addChoice('external',"External Link")
->addChoice('anchor',"Current Page Anchor")
->addChoice('file',"File")
->setDefaultValue('none')
->addText("title", ['label' => "Title"])
->conditional('type', '!=', 'none')
->addPostObject("post_object", ['label' => "Post Object"])
->conditional('type', '==', 'post')
->addText("anchor", ['label' => "Anchor"])
->conditional('type', '==', 'anchor')
->addText("external_page_link", ['label' => "External Page Link"])
->conditional('type', '==', 'external')
->addFile("file")
->conditional('type', '==', 'file');
return $this;
}
}
At file views/blocks/home-become-partners.blade.php I just vomit $blocks value
[
"caption" => "ABC",
"title" => "ABC",
"backgroundImage" => Object(),
"mobileBackgroundImage" => Object(),
"cta" => null // cta is null, although I have seen acf store my value at the backend
]
Dear author,
Currently I can't run composer install 3 libs
that are
"stem-press/stem:0.7.20"
"stem-press/mail-template": "0.3.1",
"stem-press/stem-content": ">=0.4.4"
It show below error.
duncan3dc/blade[4.4.0, ..., 4.6.0] require illuminate/view >=5.5,<5.9 -> satisfiable by illuminate/view[v5.5.0, ..., 5.8.x-dev].
- Root composer.json requires roave/security-advisories dev-master -> satisfiable by roave/security-advisories[dev-master].
- stem-press/stem 0.7.20 requires duncan3dc/blade ^4.4 -> satisfiable by duncan3dc/blade[4.4.0, ..., 4.11.0].
- duncan3dc/blade[4.9.0, ..., 4.11.0] require illuminate/view ^6.0 || ^7.0 -> satisfiable by illuminate/view[v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev].
- duncan3dc/blade[4.7.0, ..., 4.8.0] require illuminate/view ^6.0 -> satisfiable by illuminate/view[v6.0.0, ..., 6.x-dev].
- illuminate/view[v7.30.6, ..., 7.x-dev] require illuminate/support ^7.0 -> satisfiable by illuminate/support[v7.0.0, ..., 7.x-dev].
- illuminate/view[v6.20.42, ..., 6.x-dev] require illuminate/support ^6.0 -> satisfiable by illuminate/support[v6.0.0, ..., 6.x-dev].
- illuminate/support[v6.19.0, ..., 6.x-dev, v7.29.0, ..., 7.x-dev] require nesbot/carbon ^2.31 -> satisfiable by nesbot/carbon[2.31.0, ..., 2.x-dev (alias of dev-master)].
- illuminate/support[v7.0.0, ..., v7.28.4] require nesbot/carbon ^2.17 -> satisfiable by nesbot/carbon[2.17.0, ..., 2.x-dev (alias of dev-master)].
- illuminate/support[v6.0.0, ..., v6.18.43] require nesbot/carbon ^2.0 -> satisfiable by nesbot/carbon[2.0.0-beta.1, ..., 2.x-dev (alias of dev-master)].
- nesbot/carbon 2.x-dev is an alias of nesbot/carbon dev-master and thus requires it to be installed too.
- You can only install one version of a package, so only one of these can be installed: nesbot/carbon[dev-master, 1.20.0, ..., 1.39.1, 2.0.0-beta.1, ..., 2.57.0].
- stem-press/stem 0.7.20 requires nesbot/carbon ^1.21 -> satisfiable by nesbot/carbon[1.21.0, ..., 1.39.1].
- Conclusion: don't install nesbot/carbon 1.22.0 (conflict analysis result)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.