Wojciech

Wojciech

How to work with layouts and some general questions about BeaconCMS

I added BeaconCMS to my project and i have a couple of questions.

  • when i create a page within BeaconCMS only Beacon’s layout is applied and as far as i know there’s no way to use phoenix’s default ones, this also goes the other way around and i can’t use BeaconCMS layouts within regular LiveViews
  • can i use functions such as mount/3 and handle_params directly through BeaconCMS?
  • how much stuff that can be written directly with elixir&liveview can be also written within BeaconCMS?
  • how to remove layouts/pages?

Marked As Solved

Wojciech

Wojciech

I got answered on elixir’s slack on the beacon cms channel.

Hey @Wojciech Woźniak

  1. you can pass a :root_layout in beacon_site - see Feature: Makes Host Project Layouts Available via `beacon_site` macro by ddink · Pull Request #431 · BeaconCMS/beacon · GitHub

It’s not fully documented yet because there are some trade-offs with the current solution, beacon expects some functions in the header to work properly (beacon/lib/beacon/web/components/layouts/runtime.html.heex at main · BeaconCMS/beacon · GitHub) so you have to be careful. So consider it as “alpha” while we receive more feedback.2. not directly but you can pass on_mount in beacon_site and also define assigns using live data - see this guide beacon/guides/recipes/on_mount_handle_info_loop.md at main · BeaconCMS/beacon · GitHub
and some page attributes as path/query params are available in @beacon.page, see https://github.com/BeaconCMS/beacon/blob/main/guides/recipes/access-page-info.md3. do you mean sharing the same LV and components between your regular app and beacon? could you give some example?4. not yet possible, a “redirect manager” is on the roadmap so you can delete/unpublish pages properly without impacting SEO

Then i asked:

By “how much stuff that can be written directly with elixir&liveview can be also written within BeaconCMS?” i was asking when starting to use beacon cms for creating pages starts getting inefficient, what liveview features aren’t supported really well within BeaconCMS.It seems that one of those features is mount/3And thanks for the fast answer btw

Second answer:

We have a page in dockyard.com that’s running in Beacon but is not a beacon page. It’s kind of a hack using private APIs but we can work on something official if that becomes a necessity

Thanks Leandro Pereira

Where Next?

Popular in Questions Top

stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
tduccuong
Hi, is there any work on GUI with Elixir, that is similar to Electron/Javascript? My idea is to bundle Phoenix and BEAM into a single se...
New
Kagamiiiii
Student & New to elixir. Nice language. I want to convert a english character, e.g. “a”, which is stored in a variable, to it’s asci...
New
polypush135
As many of you may have realized by now (sorry for all the posts here) I’ve been working on a db problem where I’m trying to aggregate a ...
New
Phillipp
Hey, I have a NanoPi-M3 and try to install Elixir on their Ubuntu image. I followed the Raspberry Pi installation instructions from the ...
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
johnnyicon
Hi all, I've just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I'm trying to use Postg...
New

Other popular topics Top

pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 45766 226
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 49522 488
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 35421 110
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
johnnyicon
Hi all, I've just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I'm trying to use Postg...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
AstonJ
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including. What is Phoenix LiveV...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New

We're in Beta

About us Mission Statement