https://twill.io logo
Join Discord
Powered by
# ❓questions
  • h

    hazelbag

    05/18/2021, 6:59 PM
    I did attempt this and due to some failures I had to skip this, we launched on Friday and I had to ensure posts could go out, though I did respond to the email from support. So I will then now move to working on the block editor and getting that up. So essentially if a post contains 10 paragraphs and 11 images I can just insert that into the block and it will render in that order?
  • i

    ifox

    05/18/2021, 6:59 PM
    yeah exactly
  • i

    ifox

    05/18/2021, 6:59 PM
    how is your frontend built? blade templates?
  • h

    hazelbag

    05/18/2021, 7:01 PM
    Our front end is on a different build, we created an admin panel on its own instance and the front end on another instance. But yes, it makes use of blade templates
  • r

    Rayderxx

    05/18/2021, 7:01 PM
    https://github.com/area17/twill/blob/b5a0b52bdf2c7b6fde49e8946d9440fb94fbd166/src/Models/Behaviors/HasBlocks.php#L14
  • i

    ifox

    05/18/2021, 7:02 PM
    interesting, so 2 Laravel apps connecting to the same db?
  • h

    hazelbag

    05/18/2021, 7:03 PM
    Essentially yes as the non admin panel has user instance as well
  • i

    ifox

    05/18/2021, 7:07 PM
    cool
  • i

    ifox

    05/18/2021, 7:11 PM
    @User quick example case studies on area17.com, like https://area17.com/work/fondation-louis-vuitton-website are built with the block editor
  • i

    ifox

    05/18/2021, 7:12 PM
    after the link to the website, the block editor starts, this is how the CMS looks:
  • i

    ifox

    05/18/2021, 7:15 PM
    our first block is called
    website
    here because it's more specific to just showing an image, but you get the idea
  • h

    hazelbag

    05/18/2021, 7:19 PM
    Ah nice, this is what I need to get done now yes, this would solve so much of my issues with having to edit. So my next branch will begin shortly. As for the preview panel, (we currently use a uuid generated for each post, that generates a url to preview in the actual page layout) can I bring this over to the twill build and then have the preview generated inside the will block view?
  • h

    hazelbag

    05/18/2021, 7:19 PM
    Not sure I am making all that sense though
  • i

    ifox

    05/18/2021, 7:22 PM
    so the block previews are iframes that render individual block inside of a layout which you have control over. the full preview you could put an iframe in there too that loads your other app with that uuid
  • i

    ifox

    05/18/2021, 7:22 PM
    that's what we do to preview SPA/SSG apps
  • r

    Rayderxx

    05/18/2021, 7:23 PM
    Yes I used an iframe as well in nextjs project ^^
  • h

    hazelbag

    05/18/2021, 7:24 PM
    Awesome! Thank you, kudos to the Twill team, I am learning so much with this project and its awesome.
  • h

    hazelbag

    05/18/2021, 7:24 PM
    @User I would love to build one with nextjs, I love the way things just flow with next (well for me)
  • r

    Rayderxx

    05/18/2021, 7:25 PM
    https://giboulees.com/projets/rendre-la-transition-ecologique-accessible-a-tous-2 ===> only block 😉
  • i

    ifox

    05/18/2021, 7:25 PM
    nice @User, did you also setup individual block previews in the editor, or only the full preview
  • r

    Rayderxx

    05/18/2021, 7:26 PM
    only the full too much work
  • i

    ifox

    05/18/2021, 7:26 PM
    yeah makes sense
  • h

    hazelbag

    05/18/2021, 7:27 PM
    That is awesome @User
  • r

    Rayderxx

    05/18/2021, 7:27 PM
    and my iframe looks like that : slug}}?timestamp={{$date}}">
  • i

    ifox

    05/18/2021, 7:27 PM
    if you can render your components individually through props, you can play with the block layout to bring the next app
  • i

    ifox

    05/18/2021, 7:28 PM
    but the full preview is probably good enough 😉
  • i

    ifox

    05/18/2021, 7:29 PM
    here's ours for a Nuxt app:
  • i

    ifox

    05/18/2021, 7:29 PM
    Copy code
    <iframe src="{{ $previewUrl }}?previewToken={{ $previewToken }}" style="
      position: fixed;
      top: 0px;
      bottom: 0px;
      right: 0px;
      width: 100%;
      border: none;
      margin: 0;
      padding: 0;
      overflow: hidden;
      z-index: 999999;
      height: 100%;
    "></iframe>
  • i

    ifox

    05/18/2021, 7:30 PM
    and in our nuxt app:
    Copy code
    let apiUrl = env.API_URL
    
        if (query.previewToken) {
          apiUrl += `?previewToken=${query.previewToken}`
        }
    
        const apiData = await $axios.$get(apiUrl)
  • r

    Rayderxx

    05/18/2021, 7:30 PM
    the ?previewToken for forcing the iframe to reload ?
1...456...484Latest