Git Product home page Git Product logo

stem's People

Contributors

jawngee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

phonggcs

stem's Issues

Can't use group field for Block

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
]

Outdated lib version

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.