These are chat archives for locomotivecms/v3

20th
May 2015
Slava
@slavajacobson
May 20 2015 13:44
@did regarding our discussion of adding a custom model to locomotive... do you by any chance have a better example or an actual application that I can take a look at? I feel like things are missing from the dummy application and I can't really move forward. For example how would I pass the current site ID to the model to ensure that only models related to the current site will load.
also based on the dummy application.. it creates site.com/foo instead of site.com/locomotive/foo
Didier Lafforgue
@did
May 20 2015 14:06
@slavajacobson I might have examples from our hosting platform but I can’t not share the source.
you’ve got the current_site id in the liquid tags / filters and drops
concerning the url issue, have you tried something like:
namespace :locomotive, module: 'locomotivedo
    resources :foo
end
FooController goes under app/controllers/locomotive
Slava
@slavajacobson
May 20 2015 14:26
@did I will try that. thanks! also, when I add a custom model this way, they will appear across all wagon sites, right? Is there an approach that would make certain models only visible on certain sites?
Brandon Mikeska
@brandonmikeska
May 20 2015 14:42
@did hey with the current construction of V3, will it make it easier to upgrade rails versions quicker?
Slava
@slavajacobson
May 20 2015 15:20
@brandonmikeska I believe it all depends on how radical the Rails changes are
Brandon Mikeska
@brandonmikeska
May 20 2015 16:12
Yeah Rails 4 to 5 doesn't look nearly as bad as 3 to 4
interesting article
Didier Lafforgue
@did
May 20 2015 19:04
@brandonmikeska actually, that is / was not a problem of being stuck to a specific version of Rails. The real problem is that we, as the Locomotive community, needs to upgrade Locomotive as often as possible with the new versions of the gems we use.
@slavajacobson thanks for the article, I’m going to read it now
Brandon Mikeska
@brandonmikeska
May 20 2015 19:15
Yeah I have been reading the big fuss over Cable Matter vs someting like Volt
Didier Lafforgue
@did
May 20 2015 19:28
okay, I remember this article, I read it a month ago. Still interesting to read it again with the comments
all I can say is that I tried to write a small web app with NodeJS (with SailsJs to be more specific) and it was a nightmare.
Slava
@slavajacobson
May 20 2015 19:31
I am happy with Rails :)
@did when you get a chance please look at my question ^ regarding models / sites
Didier Lafforgue
@did
May 20 2015 19:33
@slavajacobson we’ve got a problem here :-)
custom models do not play nicely with Wagon
Slava
@slavajacobson
May 20 2015 19:38
so you're saying they will show up across all wagon sites, right?
Okay maybe in a long run I will come up with a solution... maybe under Site settings there should be an option to dynamically add/remove custom models/modules
Didier Lafforgue
@did
May 20 2015 19:42
the thing is that, in the current version, adding custom models to both the engine and wagon is not super easy
Slava
@slavajacobson
May 20 2015 19:43
does it get easier in 3.0?
Didier Lafforgue
@did
May 20 2015 19:43
much more easier
Slava
@slavajacobson
May 20 2015 19:43
sweet
Didier Lafforgue
@did
May 20 2015 19:44
but I still have a problem with that, an architectural one
custom models are, for you, Mongoid documents or Active Records
Slava
@slavajacobson
May 20 2015 19:44
hmm... it seems like 3.0 is good to go except for the backoffice page edits, but I don't really need page edit to develop a site, I can simply push wagon site with all the content
Didier Lafforgue
@did
May 20 2015 19:45
if you start tying Mongoid documents to Wagon, you are missing the whole point of using Wagon
perhaps, the solution is not to use Wagon :-)
I’ve been thinking about another way to build a site
when needs / constraints are too strong for Wagon which seems to be your case
perhaps, we could build a tool to sync pages directly with the engine
let me explain
you’ve your Locomotive engine up and running
you initialize a site on the Engine
here is the difference
instead of using Wagon to create and test locally your site with all its HAML pages, …etc
we could have a tool which will send to the Engine all the modifications you’re making to the pages stored locally in files (like the way it is right now)
BUT
when you want to preview the pages you’re working on
Didier Lafforgue
@did
May 20 2015 19:51
you preview them from the Engine
in other words, you don’t use the “Server” feature of Wagon
you use the rendering of the Engine to preview your modifications
does that make sense?
Slava
@slavajacobson
May 20 2015 19:54
Sorry, got distracted by my boss. lol
Didier Lafforgue
@did
May 20 2015 19:55
:-)
Slava
@slavajacobson
May 20 2015 19:57
I understand the Wagon is intended to be a theme/skeleton of a website and backend code doesn't belong there.
Didier Lafforgue
@did
May 20 2015 19:58
instead of pushing when you want to, it pushes every modification
Slava
@slavajacobson
May 20 2015 19:59
But I was thinking, maybe allow users to push custom "backend" modules into Engine which later can be enabled in Wagon
or
an ability to create new custom content types
Like, currently there is String, Text, Integer, Boolean, File, etc... and I wanted to add a new Type called "Floorplan"
Didier Lafforgue
@did
May 20 2015 20:00
for this, I also have an idea
Slava
@slavajacobson
May 20 2015 20:00
so I would code a new gem locomotive-custom-type-floorplan and then add it to the Engine
Didier Lafforgue
@did
May 20 2015 20:01
instead of creating a new type, it could be another content type with a relationship to the parent model
Nic Boie
@boie0025
May 20 2015 20:01
@slavajacobson can you not use a composite high level model for floorplan?
Slava
@slavajacobson
May 20 2015 20:01
and, perhaps an ability for super user to choose which Content Types are available for certain websites
Didier Lafforgue
@did
May 20 2015 20:02
it’s okay to duplicate the same content type (Floorplan) in other sites
Slava
@slavajacobson
May 20 2015 20:02
So by default all sites will have Integer, String, Text etc... and I can choose which sites will have additional content types that I added via Gemfile such as the Floorplan
@did the problem is.. I need a custom UI in order to manipulate Floorplan content type
Remember I mentioned how I want to be able to drag and drop Photospheres over the floorplan and be able to drag the marker of the photosphere on the floorplan to specify its X and Y over the floorplan image
Didier Lafforgue
@did
May 20 2015 20:03
I remember
Slava
@slavajacobson
May 20 2015 20:05
So I believe the best solution is probably to make the Content Types modular, ability for developers easily code their own and choose which sites have access to the non default content types
Didier Lafforgue
@did
May 20 2015 20:06
right
but do not try to make it work with Wagon, too complicated
Slava
@slavajacobson
May 20 2015 20:07
I think it's all Engine or Steam
@did do you think v3 is ready for production? say if I don't need access to edit the page from the backoffice, I could just push the content from local, right?
Didier Lafforgue
@did
May 20 2015 20:12
if you like to gamble, sure, it’s ready for production ;-)
Slava
@slavajacobson
May 20 2015 20:13
I installed it locally
seems to work fine except for the content editing lol
Didier Lafforgue
@did
May 20 2015 20:13
well
if you find bugs, we’ll solve them
Slava
@slavajacobson
May 20 2015 20:14
love the new design, very sleek
it needs this
:)
so you said adding a model is easier in v3.0... can you instruct me on how to do it?
promise that when i figure it out, I will add it to readme.io :)
Didier Lafforgue
@did
May 20 2015 20:17
it’s not a simple model you want to add but a new field type
Slava
@slavajacobson
May 20 2015 20:18
Well, it could also be done via model... within the model I could specify which page it would belong to.. or something.
Didier Lafforgue
@did
May 20 2015 20:19
are we talking about your Floorplan stuff?
Slava
@slavajacobson
May 20 2015 20:20
Yeah we can use that as an example
Didier Lafforgue
@did
May 20 2015 20:20
I do think you should create your own field type
I don’t like having a model to have a strong link to a page
Slava
@slavajacobson
May 20 2015 20:22
Menu:
Galleries
Gallery 1
Images
Gallery 2
Images
Floorplans
Floorplan1
Photospheres
Floorplan2
Photospheres
i guess indentation wasn't saved lol
```
Menu:
Galleries
  Gallery 1
      Images
 Gallery 2
    Images
Floorplans
  Floorplan1
     Photospheres
 Floorplan2
    Photospheres
Well, I need to somehow link model/page to the custom model
You think creating a new field type would create too much mess?
Didier Lafforgue
@did
May 20 2015 20:28
to be honest, I’ve never done something like that