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!
Neither on the engine nor on wagon, this ordering seems to work: ``` {% with_scope start.gt: now, order_by: 'start.asc' %} {% assign future_events = contents.events %} {% endwith_scope %} ``` The order as defined in events.yml is start.desc, which is also the order I get regardless of the order defined in the with_scope tag.
Posted by Tobias Geisler 4 years ago
My hosted locomotiveCMS is under domain blog.mydomain.com. I have mydomain.com/blog maps to blog.mydomain.com for SEO purpose. (via reserve proxy) However, url generated by locomotive will look something like this mydomain.com/posts/post-slub, obviously these links won't work since they are hitting my main app. I want them to be mydomain.com/blog/posts/post-slub. What will be the best way to do this? Thanks
Posted by Eric 4 years ago
It worked for us in v2, but in a project now in v3, we can't get fixed:true to work on editable elements such as editable_text or editable_file. ### The setup In our `index.liquid` file, we have something like this: ```liquid {% block 'site_settings' %} {% block 'map' %} {% capture map_text %}{% editable_text 'map', format: raw, fixed: true %}..{% endeditable_text %}{% endcapture %} {% endblock %} {% block 'slider' %} {% capture slider_text %}{% editable_text 'slider_text', format: raw, rows: 3, fixed: true %}...{% endeditable_text %}{% endcapture %} {% capture slider_image_1 %}{% editable_file 'slider_bild_1', fixed: true %}slider/home-4.png{% endeditable_file %}{% endcapture %} {% endblock %} {% endblock %} ``` We're not using site_metafields because we haven't gotten them to work yet. Even though we're using fixed: true, those editable elements appear on the editor for all pages that inherit from the index. Any ideas on how to get the correct behavior working?
Posted by Tobias Geisler 4 years ago
From the v3.1 release notes I take it that the feature still exists, but only works under certain conditions: Wagon doesn't stop the whole site deployment if a JS/CSS can't be minified. What are those conditions/what can I do to make the minification work?
Posted by Tobias Geisler 4 years ago
Hi, i got a problem while trying to filter my blog entries through with_scope. In wagon my filter system it worked quiet well. But when i deploy it to my locomotive site it won't filter these entries anymore. Here is my Code: {% assign currenttag = params['tag'] %} {% with_scope tags: currenttag %} {% paginate contents.blog by 5 %} {% for post in paginate.collection %} <div class="blog-material"> <img class="blog-image" src="{{ post.image.url }}"> <div class="blog-body clearfix"> <h5><a href="{{ post._slug }}">{{ post.title }}</a></h5> <p>{{ post.text | truncatewords: 50 }}</p> <a href="{{ post._slug }}" class="button float-right">Weiterlesen</a> </div> </div> {% endfor %} <div class="row content-top-min content-bottom-min"> <div class="large-12 columns text-center"> {% if paginate.previous_page %} <a href="?tag={{currenttag}}&page={{paginate.previous_page}}" class="button arrow"> <i class="material-icons">arrow_back</i> </a> {% endif %} {% if paginate.next %} <a href="?tag={{currenttag}}&page={{ paginate.next_page }}" class="button arrow"> <i class="material-icons">arrow_forward</i> </a> {% endif %} </div> </div> {% endpaginate %} {% endwith_scope %}
Posted by Tobias Zoll 4 years ago
Hi I use coffee script and all run very good in my local host, but when I deploy in my preview send me the next " error SyntaxError: expected expression, got '<' " I use the file alert.coffee and in my snipplet I use this <script src="/javascripts/alert.coffee" type="text/javascript" ></script> I dont know where is my problem or if need something else in my project like put alert.js.coffee or another thing Best Regards, Miguel. I very enjoy use locomotivecms!
Posted by miguel 4 years ago
Hey Everybody, I have a form with used for public submission. That form is placed on the `event` page and creates an `open_subscription` and `open_subscription` belongs_to `event`. Now the issue I have is that it creates the `open_subscription` entry but the event field stays empty. I have tried everything i could think of but still no success. Has anyone worked with forms that create related objects? How did you implement it? Any suggestions? Here is a gist with my code: <script src="https://gist.github.com/DonKoko/ff8d59d42d9357ef5cb0fc6545d30876.js"></script>
Posted by Nikolay Bonev 4 years ago
I've just stumbled across Locomotive and it looks really good so thought I'd give it a go. Starting with the quick start guide it all went well until I got down to number 5. Deploy the site. I've got a droplet setup on Digital Ocean and not sure what to do. I ran the command in shell but got an error back? Do I need to do something else to get it to work with Digital Ocean?
Posted by Dave Armstrong 4 years ago
It is possible to access contents.posts.first and .last. How do I access arbitrary elements? I know I can do .all[i], but this fetches all documents from the database and is thus inefficient. In locomotivecms_steam-1.1.1/lib/locomotive/steam/liquid/drops/content_entry_collection.rb a slice(index, length) function is defined which should do exactly what I want. However it is protected and cannot be accessed over the liquid API. What do?
Posted by Jonathan 4 years ago
Hi I need an offline version of the docs at https://locomotive-v3.readme.io/, to work when no internet connection is available (travel). Is there any way to get that? I tried wget (wget --mirror --convert-links --adjust-extension --page-requisites https://locomotive-v3.readme.io/), but the scraped version is not usable offline (still depends on some assets like gfonts and scripts from CDN). I know that I can just take the Markdown files from the locomotivecms git repos, but is there a way to get the nice HTML docs offline?
Posted by Jonathan 4 years ago
I'm having problems installing Engine on my own server, following instructions here: https://locomotive-v3.readme.io/docs/getting-started-with-locomotive I get a bunch or errors like this: Action Controller Exception - /usr/local/lib/ruby/gems/2.1.0/gems/locomotivecms-3.1.1/app/models/locomotive/concerns/site/metafields.rb:72: syntax error, unexpected ':', expecting => ...=> { 'type' => 'string', 'not': { 'enum': ['dom_id', 'model_... ... ^ I'm using Ruby 2.1.6, Rails 4.2.6 and Apache 2.4.10 + Passenger installed as a gem for the server. You can see the complete output here: http://locomotive.creativecocos.com/ What am I missing? Thanks.
Posted by Juan Capristán 4 years ago
Hello, I am getting errors when running rake routes. I ran the "Install Locomotive Engine" example program exactly as specified in https://locomotive-v3.readme.io/docs/getting-started-with-locomotive. My Gemfile has gem 'locomotivecms', '~> 3.1.0' github: 'rails/rails' gem 'rails', '4.2.6' When I then run "rake routes" I get : Prefix Verb URI Pattern Controller#Action locomotive /locomotive Locomotive::Engine /locomotive(/:site_handle)/api #<Rack::Builder:0x007fa2b4fa5740 @warmup=nil, @run=Locomotive::API::Dispatch, @map=nil, @use=[#<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>, #<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>, #<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>]> / #<Rack::Builder:0x007fa2b4f5ea48 @warmup=nil, @run=#<Locomotive::Steam::Middlewares::Renderer:0x007fa2b4f5cf40 @app=nil>, @map=nil, @use=[#<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>, #<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>, #<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>, #<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>, #<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>, #<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>, #<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>, #<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>, #<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>, #<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>, #<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>, #<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>, #<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>, #<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>, #<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>, #<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>, #<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>, #<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>, #<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>, #<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>, #<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>, #<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>]> Routes for Locomotive::Engine: new_locomotive_account_session GET /sign_in(.:format) locomotive/sessions#new locomotive_account_session POST /sign_in(.:format) locomotive/sessions#create destroy_locomotive_account_session DELETE /sign_out(.:format) locomotive/sessions#destroy locomotive_account_password POST /password(.:format) locomotive/passwords#create new_locomotive_account_password GET /password/new(.:format) locomotive/passwords#new edit_locomotive_account_password GET /password/edit(.:format) locomotive/passwords#edit PATCH /password(.:format) locomotive/passwords#update PUT /password(.:format) locomotive/passwords#update sign_up GET /sign_up(.:format) locomotive/registrations#new POST /sign_up(.:format) locomotive/registrations#create sign_in GET /sign_in(.:format) locomotive/sessions#new sign_out DELETE /sign_out(.:format) locomotive/sessions#destroy root GET / locomotive/sites#index sites GET /sites(.:format) locomotive/sites#index POST /sites(.:format) locomotive/sites#create new_site GET /sites/new(.:format) locomotive/sites#new edit_site GET /sites/:id/edit(.:format) locomotive/sites#edit site GET /sites/:id(.:format) locomotive/sites#show PATCH /sites/:id(.:format) locomotive/sites#update PUT /sites/:id(.:format) locomotive/sites#update DELETE /sites/:id(.:format) locomotive/sites#destroy regenerate_api_key_my_account PUT /my_account/regenerate_api_key(.:format) locomotive/my_account#regenerate_api_key my_account POST /my_account(.:format) locomotive/my_account#create new_my_account GET /my_account/new(.:format) locomotive/my_account#new edit_my_account GET /my_account/edit(.:format) locomotive/my_account#edit GET /my_account(.:format) locomotive/my_account#show PATCH /my_account(.:format) locomotive/my_account#update PUT /my_account(.:format) locomotive/my_account#update DELETE /my_account(.:format) locomotive/my_account#destroy GET /:site_handle(.:format) locomotive/dashboard#show dashboard GET /:site_handle/dashboard(.:format) locomotive/dashboard#show developers_documentation GET /:site_handle/developers(.:format) locomotive/developers_documentation#show sort_page PUT /:site_handle/pages/:id/sort(.:format) locomotive/pages#sort get_path_pages GET /:site_handle/pages/get_path(.:format) locomotive/pages#get_path pages GET /:site_handle/pages(.:format) locomotive/pages#index POST /:site_handle/pages(.:format) locomotive/pages#create new_page GET /:site_handle/pages/new(.:format) locomotive/pages#new edit_page GET /:site_handle/pages/:id/edit(.:format) locomotive/pages#edit page GET /:site_handle/pages/:id(.:format) locomotive/pages#show PATCH /:site_handle/pages/:id(.:format) locomotive/pages#update PUT /:site_handle/pages/:id(.:format) locomotive/pages#update DELETE /:site_handle/pages/:id(.:format) locomotive/pages#destroy update_all_editable_elements PATCH /:site_handle/pages/:page_id/editable_elements/update_all(.:format) locomotive/editable_elements#update_all editable_elements GET /:site_handle/pages/:page_id/editable_elements(.:format) locomotive/editable_elements#index update_all_current_site_metafields PATCH /:site_handle/current_site_metafields/update_all(.:format) locomotive/current_site_metafields#update_all current_site_metafields GET /:site_handle/current_site_metafields(.:format) locomotive/current_site_metafields#index accounts GET /:site_handle/accounts(.:format) locomotive/accounts#index POST /:site_handle/accounts(.:format) locomotive/accounts#create new_account GET /:site_handle/accounts/new(.:format) locomotive/accounts#new edit_account GET /:site_handle/accounts/:id/edit(.:format) locomotive/accounts#edit account GET /:site_handle/accounts/:id(.:format) locomotive/accounts#show PATCH /:site_handle/accounts/:id(.:format) locomotive/accounts#update PUT /:site_handle/accounts/:id(.:format) locomotive/accounts#update DELETE /:site_handle/accounts/:id(.:format) locomotive/accounts#destroy memberships GET /:site_handle/memberships(.:format) locomotive/memberships#index POST /:site_handle/memberships(.:format) locomotive/memberships#create new_membership GET /:site_handle/memberships/new(.:format) locomotive/memberships#new edit_membership GET /:site_handle/memberships/:id/edit(.:format) locomotive/memberships#edit membership GET /:site_handle/memberships/:id(.:format) locomotive/memberships#show PATCH /:site_handle/memberships/:id(.:format) locomotive/memberships#update PUT /:site_handle/memberships/:id(.:format) locomotive/memberships#update DELETE /:site_handle/memberships/:id(.:format) locomotive/memberships#destroy translations GET /:site_handle/translations(.:format) locomotive/translations#index POST /:site_handle/translations(.:format) locomotive/translations#create new_translation GET /:site_handle/translations/new(.:format) locomotive/translations#new edit_translation GET /:site_handle/translations/:id/edit(.:format) locomotive/translations#edit translation GET /:site_handle/translations/:id(.:format) locomotive/translations#show PATCH /:site_handle/translations/:id(.:format) locomotive/translations#update PUT /:site_handle/translations/:id(.:format) locomotive/translations#update DELETE /:site_handle/translations/:id(.:format) locomotive/translations#destroy bulk_create_content_assets POST /:site_handle/content_assets/bulk_create(.:format) locomotive/content_assets#bulk_create content_assets GET /:site_handle/content_assets(.:format) locomotive/content_assets#index POST /:site_handle/content_assets(.:format) locomotive/content_assets#create new_content_asset GET /:site_handle/content_assets/new(.:format) locomotive/content_assets#new edit_content_asset GET /:site_handle/content_assets/:id/edit(.:format) locomotive/content_assets#edit content_asset GET /:site_handle/content_assets/:id(.:format) locomotive/content_assets#show PATCH /:site_handle/content_assets/:id(.:format) locomotive/content_assets#update PUT /:site_handle/content_assets/:id(.:format) locomotive/content_assets#update DELETE /:site_handle/content_assets/:id(.:format) locomotive/content_assets#destroy new_account_public_submission_accounts GET /:site_handle/content_types/:slug/public_submission_accounts/new_account(.:format) locomotive/public_submission_accounts#new_account edit_public_submission_accounts GET /:site_handle/content_types/:slug/public_submission_accounts/edit(.:format) locomotive/public_submission_accounts#edit public_submission_accounts PATCH /:site_handle/content_types/:slug/public_submission_accounts(.:format) locomotive/public_submission_accounts#update PUT /:site_handle/content_types/:slug/public_submission_accounts(.:format) locomotive/public_submission_accounts#update show_in_form_content_entries GET /:site_handle/content_types/:slug/entries/show_in_form(.:format) locomotive/content_entries#show_in_form sort_content_entries PUT /:site_handle/content_types/:slug/entries/sort(.:format) locomotive/content_entries#sort export_content_entries GET /:site_handle/content_types/:slug/entries/export(.:format) locomotive/content_entries#export content_entries GET /:site_handle/content_types/:slug/entries(.:format) locomotive/content_entries#index POST /:site_handle/content_types/:slug/entries(.:format) locomotive/content_entries#create new_content_entry GET /:site_handle/content_types/:slug/entries/new(.:format) locomotive/content_entries#new edit_content_entry GET /:site_handle/content_types/:slug/entries/:id/edit(.:format) locomotive/content_entries#edit content_entry GET /:site_handle/content_types/:slug/entries/:id(.:format) locomotive/content_entries#show PATCH /:site_handle/content_types/:slug/entries/:id(.:format) locomotive/content_entries#update PUT /:site_handle/content_types/:slug/entries/:id(.:format) locomotive/content_entries#update DELETE /:site_handle/content_types/:slug/entries/:id(.:format) locomotive/content_entries#destroy new_option_custom_fields_select_options GET /:site_handle/content_types/:slug/fields/:name/select_options/new_option(.:format) locomotive/custom_fields/select_options#new_option edit_custom_fields_select_options GET /:site_handle/content_types/:slug/fields/:name/select_options/edit(.:format) locomotive/custom_fields/select_options#edit custom_fields_select_options PATCH /:site_handle/content_types/:slug/fields/:name/select_options(.:format) locomotive/custom_fields/select_options#update PUT /:site_handle/content_types/:slug/fields/:name/select_options(.:format) locomotive/custom_fields/select_options#update new_domain_current_site GET /:site_handle/current_site/new_domain(.:format) locomotive/current_site#new_domain new_locale_current_site GET /:site_handle/current_site/new_locale(.:format) locomotive/current_site#new_locale new_url_redirection_current_site GET /:site_handle/current_site/new_url_redirection(.:format) locomotive/current_site#new_url_redirection current_site POST /:site_handle/current_site(.:format) locomotive/current_site#create new_current_site GET /:site_handle/current_site/new(.:format) locomotive/current_site#new edit_current_site GET /:site_handle/current_site/edit(.:format) locomotive/current_site#edit GET /:site_handle/current_site(.:format) locomotive/current_site#show PATCH /:site_handle/current_site(.:format) locomotive/current_site#update PUT /:site_handle/current_site(.:format) locomotive/current_site#update DELETE /:site_handle/current_site(.:format) locomotive/current_site#destroy preview /:site_handle/preview #<Rack::Builder:0x007fa2b3f684e0 @warmup=nil, @run=#<Locomotive::Steam::Middlewares::Renderer:0x007fa2b3f52168 @app=nil>, @map=nil, @use=[#<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>, #<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>, #<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>, #<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>, #<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>, #<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>, #<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>, #<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>, #<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>, #<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>, #<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>, #<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>, #<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>, #<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>, #<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>, #<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>, #<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>, #<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>, #<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>, #<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>, #<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>, #<Proc:[email protected]/Users/brian/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:86>]> How can I fix these errors? I am getting the exact same errors in the real app that I am working on. Thanks, Brian
Posted by Brian Hill 4 years ago
I set up a metafield with a boolean value and used it to control display of a portion of a page inside the tag {% if <metafield> %}. I set it up in my config file using true or false for the default values, and the page displays in Wagon as I would expect based on the value I set. But when I push the site to the engine, the value I set using the back office makes no difference in the display of the page. The portion of the page I'm trying to control displays regardless of the value. I'm wondering if I have a fundamental misunderstanding of something.
Posted by Larry Fransson 4 years ago
On a previous project and now a current one, we face the problem that wagon is killed during page load on wagon. ``` Agrano Alto Started GET "/events" at 2016-05-29 12:55:58 +0000 Params: {} Timezone: UTC Detecting locale DE Found page "Events" [events] Completed 200 OK in 249.3ms Killed ``` This usually happens, before images are loaded/done loading as it seems. On the engine it works totally fine. Is this a known issue/any hints on the causes?
Posted by Tobias Geisler 4 years ago
When looping out out content of sub pages images turns out as Null running engine. When running locally with Wagon images from child pages is returned as expected. Other editable elements wok in both cases. {% for subpage in page.children %} <a href="{% path_to subpage %}"> <img src="{{subpage.editable_elements.content.main.main_image }}"/> <h2 style="font-size: 1em;">{{subpage.title}}</h2> </a> {% endfor %}
Posted by Claes Pontusson 4 years ago
Hi, I would like to add search option to my site. I can't find any help in the doc v3. I'm trying to add somthing simple for the beginning like that: {% assign query_string = 'two' %} {% capture filter_query %}/{{ query_string }}/i{% endcapture %} {% with_scope title: filter_query %} {% assign posts = contents.posts.all %} {% endwith_scope %} I use regular expression but switch "i" doesn't work. MongoDB docs says that I can use switch "i" as a param. If I remove "i" switch I'll get some matching results - but with case sensitivity. I need to use "case insensitivity". My questions are: 1. Is it possible to use param "i" & "with_scope"? 2. Is it possible to add search code more user friendly like the Locomotive v2 has? Adam
Posted by Adam Koala 4 years ago
Hi, the old locomotive hosting admin pages had a function to search for entries. I can't seem to find it in the locomotive works portal. We have about 700 events on the site, and it's borderline unusable without it. Please halp! Thanks! Vlad
Posted by Vlad Grenkov 4 years ago
So I have an events content_type and an `event` , `has_many` => `open_subscriptions`, so people can go to a page, select an `event`, fill in their info and subscribe to the `event` via the `open_subscriptions`. You can see my form here http://engine.whale-agency.com/locomotive/okarnhem/preview/open-subscriptions/create_application the problem I have is that it creates the open_subscription entry but it doesn't create the relationship to the event and I can imagine it is because of the form and how I am doing the select. Here is a gist with the code of my page with the form. https://gist.github.com/DonKoko/28bc5cc36b2a381c2860b0ee3ecd4841
Posted by Nikolay Bonev 4 years ago