Posts by BrightdayStudio

    Ok, that fixed something, I'm not getting any errors anymore which is good! Thank you SAB


    But I'm not getting any data, checking the debug toolbar it doesn't seem to be querying the database. I've changed a few names as I wasn't sure if it was a naming issue to start with.


    I'm just trying to get data from the database and show it on the site in a page, that's it. I've looked through other extensions trying to find an answer, like the blog, but as they are more complex I'm getting lost, I've been trying to strip it back to absolute basics.


    model/stuff.php





    SiteController:



    view:




    So I can print "Test" but not data in the db.

    I've double checked the database table does exist (with test data) and is named correctly.


    I don't have an app/bundle file but I'm not using vue or javaScript. I have not settings tabs, nothing in the admin, just front end public view.


    Any ideas? Anyone tried to do this? Or has an example?


    Many Thanks in advance.

    Files

    Hi, can anyone help me?


    I've just trying to build a very simple extension that simply returns data from the database.


    I've got an extension called 'happenings', I've added a script.php (plus added some placeholder entries via myPHPadmin). I've set up my src controller, model, and the view.


    When I test it i'm just getting an error page displaying all sorts of stuff I don't understand.X(


    I'm reaching the end of my tether and tempted to just use vanilla php.


    I've attached the 'happenings' extension that should go into a 'brightday' vender folder.


    src/Controller/SiteController.php


    src/Model/stuff.php:



    src/Model/stuffModelTrait.php:


    views/index.php:


    PHP
    1. <div id="happening">
    2. <?php foreach ($stuff as $thing): ?>
    3. <p> <?= $thing->title ?></p>
    4. <?php endforeach ?>
    5. </div>




    That's it.


    I've looked at other extensions, read some more about symfony php, I've read https://pagekit.com/docs/developer/orm, but I just see where I'm going wrong.;(


    Any ideas?


    Many Thanks,
    Leanne

    Ok! That makes sense! thank you SPQ. Ok I was getting the v-model wrong. I had tried a mapping an array like the slideshow using. <div v-for="image in widget.data.images"> but that just broke everything so I've made sure I've got widget.data. referenced and it works!


    One small problem. I've renamed "images" to "panel", now my frontend view wont render the image, I've used:


    <img src="<?= $panel->get('image.src') ?>" alt="<?= $panel->get('image.alt') ?>">


    Which doesn't work, the data looks like this:


    {"panel":{"image":{"src":"storage\/pagekit-logo.svg","alt":"Pagekit logo"},"header":"Header","text":"Text","link":"link","url":"@page\/1"}}


    I'm rendering the other data ok, like <h3><?= $panel['header'] ?></h3> works


    It's just the image.


    Probably something simple. Any ideas?


    Many Thanks,

    Leanne :)

    Hey, Ok sorry If I'm not explaining this well.


    I have a backend-widget that has a settings-tab.


    The widget is visible on the backend and frontend but the data isn't saved to the db, so when I save the data in the backend it doesn't store anything.


    My widget view was based on https://github.com/jebster-pag…iews/widget/slideshow.php I've been using this extension as a guide.


    I can't see any issues on widget/panel.php, but data = 0, so it won't display anything in the frontend. If you've spotted anything wrong with my widget/panel.php can you point it out to me?


    I think there might be something wrong with the app component but I can't see anything there either:

    https://github.com/BrightdaySt…app/components/widget.vue


    I've updated the index.php to include routes incase that was a problem.


    Other widgets are saving fine, so it's only an issue with my widget.


    I'm not sure what to try next. :/

    Hello, yes that's me. I lost my password to the other account, I'm actually not sure I know a password to this one but hey ho, hopefully I'll still get in.


    Ok I solved that problem. I hadn't linked the right file name! doh! The first thing I should have checked! FACEPALM.


    Now I've got another problem where the content isn't passing to the view. When I checked It's not storing the data to the database.


    I'm thinking of trying to add another "Save" button in, I don't know if that would work. Or maybe I need to config the fields with default values. I'm referencing props: ['widget, ''config', 'form'].


    Hopefully I'll figure it out :) Any ideas where to look?

    Hi Guys,


    I'm creating a simple widget so that a user can add an image, a link, title and text to a section on a page using a widget.


    I've created the extension, checked other system files and extensions, I can enable it, I ran webpack so my js should be ok, My namespace looks ok, but when I try to add the widget in the front-end my custom fields are not showing. I just get the title field and that's it.


    I put files on github: https://github.com/BrightdayStudio/pagekit-panelWidget


    Can anyone spot what I've done wrong? Or have any advice?


    Many Thanks,

    Leanne

    So I can see I can change node-page.vue to this:


    Code
    1. <div class="uk-form-row">
    2. <v-editor :value.sync="page.content" :options="{markdown : page.data.markdown}"></v-editor>
    3. <v-editor :value.sync="page.side" :options="{markdown : page.data.markdown}"></v-editor><p>
    4. <label><input type="checkbox" v-model="page.data.markdown"> {{ 'Enable Markdown' | trans }}</label>
    5. </p>
    6. </div>


    I have a new column in my database called "side"

    How do I then translate that onto my template.php?

    I thought it would be something like this?

    PHP
    1. <?php if ($page['side']) : ?>
    2. <?= $view->render('side') ?>
    3. <?php endif ?>



    Any thoughts what I'm missing here?

    Thanking you.

    Hi,


    I'm trying to add a new field to the Site > Page > "Content" tab.


    I can easily update the 'themes' tab with images etc but I'm trying to figure out how to extend the "content" tab in 'site'.


    Basically I need to add a text intro section on each page, and possibly an aside element for images. I can't do it with widgets as the content will be different with every page, I can't use shortcodes as it's a bit more complicated that just snippets of info.


    Any ideas where to start? what I should look for? Has anyone else already done this or something similar?


    Many thanks,

    Leanne

    hi SPQRInc Yes indeed the "shortcode" extension, and a text widget. I thought this might be included in the Tinymce extension, so I can specify where I want the Tinymce applied, but I've taken a look at the Tinymce extension and can't see where it specifies replacing the existing editor. So wondering how I'd get round this, and if I can target specific editors. Any ideas where I should look? :)