Ask a Question

how to fix ->SyntaxError: expected expression, got '<'?

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!

S3 upload problem?

I am getting this "getaddrinfo: Name or service not known". I think that it is something to do with S3 but I can't tell. If I drag a file onto upload it looks like it is doing something but the the "drop" image shakes which I assume means failure. The S3 bucket works with the same credentials in my Transmit FTP app. Struggling to diagnose this. Regards Colin McGowan Seahorse::Client::NetworkingError in Locomotive::CurrentSiteController#edit getaddrinfo: Name or service not known Extracted source (around line #879): 877 878 879 880 881 882 D "opening connection to #{conn_address}:#{conn_port}..." s = Timeout.timeout(@open_timeout, Net::OpenTimeout) { TCPSocket.open(conn_address, conn_port, @local_host, @local_port) } s.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1) D "opened" Rails.root: /app Application Trace | Framework Trace | Full Trace vendor/ruby-2.2.2/lib/ruby/2.2.0/net/http.rb:879:in `initialize' vendor/ruby-2.2.2/lib/ruby/2.2.0/net/http.rb:879:in `open' vendor/ruby-2.2.2/lib/ruby/2.2.0/net/http.rb:879:in `block in connect' vendor/ruby-2.2.2/lib/ruby/2.2.0/timeout.rb:89:in `block in timeout' vendor/ruby-2.2.2/lib/ruby/2.2.0/timeout.rb:99:in `call' vendor/ruby-2.2.2/lib/ruby/2.2.0/timeout.rb:99:in `timeout' vendor/ruby-2.2.2/lib/ruby/2.2.0/net/http.rb:878:in `connect' vendor/ruby-2.2.2/lib/ruby/2.2.0/net/http.rb:863:in `do_start' vendor/ruby-2.2.2/lib/ruby/2.2.0/net/http.rb:858:in `start'

How am I supposed to do custom development as I do with Rails ?

I'm quite new to using Locomotive and so far it is great. But now that I'm considering adding some basic logic to my app like I would do normally with a Rails controller, things start to get confusing. Am I supposed to directly modify the engine for that purpose ? If so I think it's really not ideal... For example, I want to add a contact form, I've seen there is a tutorial on this in the docs but it doesn't say anything about the POST side of it. I want to send an email when a message is sent through the contact form and I really have no idea how I should do this with Locomotive. Also I'd like to use Locomotive for a future project that will require a lot of custom logic and I'm afraid it won't fit. I hoped to use a Rails CMS so that I can develop easily with Rails and at the same time have a nice CMS. Is this realistic with Locomotive ?

Anyone been getting this error (Action Controller: Exception caught - Devise) when logging into the Engine backend?

After installing LocomotiveCMS and setting up the first site in the Engine Backend then logging out. I now get this error when logging into /locomotive: SyntaxError in Locomotive::SessionsController#new /.../.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/devise-3.5.10/app/controllers/devise/sessions_controller.rb:5: syntax error, unexpected '{', expecting keyword_end ...ter only: [:create, :destroy] { request.env["devise.skip_tim... ... ^ /.../.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/devise-3.5.10/app/controllers/devise/sessions_controller.rb:5: syntax error, unexpected '}', expecting keyword_end ..."devise.skip_timeout"] = true } ... ^ Any ideas appreciated.

Editable_File default image

Hi there, I've spent a tremendous amount of time trying to solve this: Before I upgraded to v3 I've been adding images as editable_files with a default value as mentioned in http://doc.locomotivecms.com/references/api/tags/editable-file Now, after the upgrade, everything works fine on wagon, but not on the engine (e.g. locomotive.works). I've tried every possible combination of capture and editable_file I could think of and keep missing my default value (which is not something I want to give up!). Old version: > {% capture coin_topright_url %}{% editable_file "coin_topright_image", hint: "Upload a coin image for the top right coin." %}{% endeditable_file %}{% endcapture %} with > src=" {% if coin_topright_url != '' %}{{ coin_topright_url }}{% else %}{{ 'coins/student.png' | theme_image_url }}{% endif %}" Things I've tried (among many others): > src="{{ coin_topright_url | default: '/coins/student.png' | theme_image_url }}" > {% capture coin_topright_ur %}{{ coin_topright_ur | strip_html }}{% endcapture %} > > src="{{ page.editable_elements.main.landingpage_coins.coin_right_image }}" > src="{% if page.editable_elements.main.landingpage_coins.coin_right_image != '' %}{{ page.editable_elements.main.landingpage_coins.coin_right_image }}{% else %}{{ 'coins/investor.png' | theme_image_url }}{% endif %}"

Force theme assets to deploy

I'm not sure if these questions are read but my love for the CMS part of LocomotiveCMS is being dulled by the obscurity and obtuseness of the Wagon deploy process. Current issue is that unless a file is physically edited it appears to be assumed to be the same. If I drop a new file that has the same name as a previous one it is ignored(skipped). Obviously if it is an image file or similar this becomes problematic. I am trying to force all assets to be redeployed to overwrite the existing ones to get everything in sync. No matter what I have tried ( even deleting all the deployed assets ) every time I run deploy to local engine it skips all the ThemeAssets but appears to push everything else. I suspect some caching issue or failure to reload the current assets or similar may be to blame. Anyway: I worked my way to the file push_theme_assets_command.rb and this appears to be where it is checked. and commenting out this line 26 gets me a bit further. raise SkipPersistingException.new if same?(decorated_entity, _entity) To get round this I commented it out and that gets me a bit further. Perhaps a -f flag on the deploy command could be used to force all assets to be replaced?

how do to have a dropdown menu?

Hi I try to have a dropdown menu, but I lost try, my structure is the next +index +page1 +sonpage1 +page2 +sonpage2 +page3 I hope have a drop down in the nav. Best Regards, Miguel

Content entry list is empty with scope on a localized page

Hi! I think I found another bug on engine-side. I have many "events" which are grouped by "country" field. - country: label: Country type: select required: true hint: Explanatory text displayed in the back office localized: false select_options: ['HUN', 'IND'] I have two locales: 'en' (default) and 'hu'. If I switch to 'hu', the scoped list items are empty: {% with_scope country: 'HUN' %} {% for event in contents.events %} ... {% endfor %} {% endwith_scope %} Everything works correctly (scoped events are displayed on both locales) in wagon project. If I remove the scope, it will work on engine-side too. (and all of the "events" will be listed) Regards, Zsolt (PS: If you would like to see the full example I will share my code.)

Browser is not updating after filechange

Hi, I am a developer and new to LocomotiveCMS. I installed ruby 2.7.2, wagon 3.0.3 and 'wagon serve' is working. After updating a file : index.liquid I see a message in my terminal: ``` service=listen action=reload resource=pages timestamp=2022-01-22 11:25:09 +0100 ``` So it is recognized that a file has changed. But my browser is not reloading the page. I tried it on MacOS and on a ubuntu system. In both cases auto reloading is not working in the browser. What am I doing wrong? Should i install extra libs or software? Hope someone can help me. Best regards, Martijn Dekker

Searching in v3

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