Welcome to the Locomotive V4 developer hub. You'll find comprehensive guides and documentation to help you start working with Locomotive V4 as quickly as possible, as well as support if you get stuck. Let's jump right in!
On the site I have built with Locomotive sometimes the users upload images to go with a story. They may use the same image in multiple places but if they then remove/delete it from one location they are unable to access the page. It seems that the other links to that image are now broken. Is there a way to fix this other than telling the users not to delete an image of they've used it in more than one location?
Posted by Brian Hill 4 years ago
Hi, what is the best way to filter with_scope and multiple params like category, color, size etc. and the case that maybe only one or two params are selected. Example: {% with_scope category: category, colors.in: [color], size.in: [size] %}... When a user clicks on a category, no product appears. If i delete the colors.in and size.in it works. My current workaround is: {% assign category = params["category"] | default: '/^/' %} {% assign size = params["size"] | default: null %} {% assign color = params["color"] | default: null %} and a lot of if.. else if.. else.. but i think there must be a cleaner approach Thanks
Posted by Kations 4 years ago
I'm running through the installation guide at https://locomotive-v3.readme.io/docs/getting-started-with-locomotive to get Engine up and running on my local machine and getting the following error: ``` $ bundle exec rails generate locomotive:install Could not find generator 'locomotive:install'. Maybe you meant 'coffee:assets', 'model' or 'integration_test' Run `rails generate --help` for more options. ``` Anyone run into this and have a solution. Runnings lastest version of OS X and followed the install guide of wagon at https://locomotive-v3.readme.io/docs to get Ruby and Rails up and running.
Posted by Raymond Johnson 4 years ago
I've look through all the docs and cannot find this mentioned anywhere. I've locally edited a file in the data folder of my locally deployed wagon. The file is photos.yml and I added a bunch of entries for photos that should appear on the site. When I serve the site locally all the entries that I've added show up without issue, but when I deploy to my server (also local) none of the images are showing up on the page or in the models section for photos which I would assume them to be in. Any idea of how to deploy a .yml file so I don't have to manually add all the photos to locomotive?
Posted by Patrick Sparks 4 years ago
Hey! So I'm doing first steps, the basic stuff. And I'm stuck on this step – https://locomotive-v3.readme.io/docs/use-them-in-templates. Path_to link to a single entry generates empty space and thus the link just reloads the page we're on. I checked docs and my code like 10 times, I don't get what I'm doing wrong and where's the problem. Any help and advice would be much appreciated.
Posted by Vlad Arbatov 4 years ago
Hi, We currently have our website running on Heroku using the new wagon and professional dyno (www.careerseekers.org.au) . After a day or two, the Theme Assets on the wagon dissappear, and shows our public website without any style or theme, like its just the plane HTML being rendered. Is this a bug on the wagon? or would this be an issue on Heroku?
Posted by Michael Macahilig 4 years ago
Has anyone successfully managed to include font-awesome in a wagon project (outside of using the built-in bootstrap theme that includes font-awesome)? I've tried using the official Font Awesome gem (https://github.com/FortAwesome/font-awesome-sass) with no success. Including just `font-awesome` in my application scss looks for the fonts at the path `/fonts/font-awesome/`, which gives a 404. Including `font-awesome-sprockets` as well gives the error `Custom asset_path helper is not implemented`.
Posted by Jonathan Green 4 years ago
In my locomotive site, if I create a user under "general settings", there's no password field to set the user's password. If I edit an existing user, no password field there either. If I edit my own account, there is a password field and it works.
Posted by Josh Santangelo 4 years ago
I have a field type which is currently a "select", which works fine. I'd like to display it as a series of radio buttons instead. Is that possible? I'm looking at the field types list and don't see anything about radio buttons. https://locomotive-v3.readme.io/docs/define-a-content-type
Posted by Josh Santangelo 4 years ago
Hello, I was experimenting with the demo using the blog template as a solution for a (non-technical) client wanting to post their own blogs. I noticed that when I upload a large image to a blog post it overlaps the edges of the post/page. This is especially apparent when resizing the window for mobile (so setting a width within the image tags doesn't solve the issue). The images don't take into account the size of the page or container they're in at all. Is there something I'm missing or doing wrong? Also, is there a simple way to add image gallery functionality or resizing images within the WYSIWYG editor a-la-Wordpress? Many thanks
Posted by Dino 4 years ago
I've a problem with what a think to be a very common task. I want to filter content entries by the value selected by the user; and if the user doesn't select any value, I want to show all content entries. So, let's say I have a Product model, with a "name" and "category" fields. Name is a string field, and category is a select field. Given the above, the following code DO what I expected: {% assign requested_product_name = '/' | concat: params['requested_product_name'], '/' %} {% with_scope name: requested_product_name %} {% for product in contents.products %} /* PREVIEW PRODUCT */ {% endfor %} {% endwith_scope %} i.e. it show all products if requested_product_name parameter contain the .* regex. But if I use the category field, the regex dosn't work anymore! For example, if category field has two select_options, let's say "books" and "sunglasses", then the following code: {% assign requested_product_category = '/' | concat: params['requested_product_category'], '/' %} {% with_scope category: requested_product_category %} {% for product in contents.products %} /* PREVIEW PRODUCT */ {% endfor %} {% endwith_scope %} show only the entries belonging to the "books" category (the first select option specified). The question is: how to show all entries when the user doesn't pick a filter value in the UI? I can use some "if/then" logic, but with multiple filters, the code can become very lengthy and confusing.
Posted by Riccardo 4 years ago
We have a requirement to set the canonical link in every page of the site that we have developed using locomotive CMS. I initially thought that we can set a custom value in YAML header of every page and access it in page drop. But that is not possible. So is there is any solution for this please?
Posted by Nanditha 4 years ago
We're running http://www.silvesco.com/ on the new Locomotive CMS. We've got some old .php pages showing up in Google search we'd like to do 301 redirects for. When we route /who-we-are.php to /about it doesn't work. When visiting /who-we/are.php we get a 403 error with "nginx" text. Any suggestions for how we might be able to get those redirects in place?
Posted by Tyler Peterson 4 years ago
I have ui_enabled active for all relationships on our sites. For *has_many* relationships, the `Add a new one` button is displayed. For many_to_many relationships, it never displays. This makes the whole thing extremely user unfriendly. E.g. if I want to add a new picture to an album, I have to upload it from the images page which is a click fest. Shall I look for errors on our side or is this a common misbehavior?
Posted by Tobias Geisler 4 years ago
I have something like this: ``` slider: fields: slider_text: type: string slider_bild_1 type: file ``` (metafields_schema.yml) On wagon, this works perfectly. On the engine, I get this (self-hosted and on locomotivehosting): ``` I, [2016-07-16T17:51:02.759050 #3087] INFO -- : [LocomotiveCMS] [ApplicationError] #<NoMethodError: undefined method `slider_bild_1?' for #<Locomotive::CurrentSiteMetafieldsHelper::SchemaGroup:0x00000005 6cbe20>> I, [2016-07-16T17:51:02.762500 #3087] INFO -- : Completed 500 Internal Server Error in 87ms F, [2016-07-16T17:51:02.772287 #3087] FATAL -- : NoMethodError (undefined method `slider_bild_1?' for #<Locomotive::CurrentSiteMetafieldsHelper::SchemaGroup:0x000000056cbe20>): ``` (log excerpt from self-hosted engine) => The file field causes an error (the text field alone works). *Since it's an image field, I changed it to `type: image`, and this seems to solve the issue.* However, I can't get `type: file` to work.
Posted by Tobias Geisler 4 years ago
``` {% with_scope _slug: "technology" %} {% assign section = contents.article_sections.first %} {% endwith_scope%} {% for subsection in section.subsections %} .category-block %h2 {{ subsection.subsection_name }} .articles {% for article in subsection.libraryarticles %} %a.article{:href => '/articles/{{ article._slug }}'} {% endfor %} {% endfor %} {% endblock %} ``` With two models, subsections and articles. In locomotive 2.5.7, the order of the articles would be determined by how they were ordered within the subsection. In locomotive 3.0, the order of the articles is being determined by how they are ordered in the main model page that shows all the articles. Completely ignores the order that they are assigned in the edit page for a subsection. Subsections and articles are both set to order_by manual. Not that it should matter for subsections. Is there a way in the model declaration to explicitly say that order in the many_to_many relationship matters? Or is there some magical filter/sort_by that I don't know about? Thanks!
Posted by Jiexi Luan 4 years ago
Hello, I'm trying to add some new functions inside the admin site, showing a new section in the left sidebar. Any help is welcome =D. I saw the metafields configuration that create a new section but this is a internal configuration. I want to do something like that but with my own database information. Thanks ;)
Posted by Lester 4 years ago