db.locomotive_content_entries.find({ "created_at": {$gte: new Date(1631491200000)} })
new Date("2021-9-13").valueOf()
returns a long epoch.
Just tested the date output. For me, the above spits out
{{ '2021-09-14' | parse_date }}
# output: 2021-09-14
{{ '2021/09/14' | date: "%b %d, %y" }}
# output: Sep 14, 21
or, the other way around ( i guess that is the expected output according to the docs:
{{ '2021-09-14' | date: "%m/%d/%Y" }}
# output: 09/14/2021
{{ '2021-09-14' | date: "%s" }}
# output: 1631592000
{{ now | date: "%s" }}
# output: 1631744078
Hello everybody, I’m currently giving the authentication feature a spin, but I’m having trouble setting the from
field via the custom smtp settings, so users receive proper looking welcome / password related e-mails. I’m setting a custom smtp namespace in my sign-up form via the following hidden field:
<input type="hidden" name="auth_email_smtp_namespace" value="smtp_settings" />
In order to configure the custom smtp, I used this guide and the following configuration in my site.yml
:
metafields:
smtp_settings:
address: myaddress.com
authentication: plain
port: 587
enable_starttls_auto: true
user_name: user@name.com
password: some_password
domain: mydomain.com
from: my@mail.com
When a new user registers and receives the welcome e-mail, the from
field is still set to the default, and not to e.g. my@mail.com
, as specified above.
Any idea how to get this working?
Hi @dyerc, I'm not 100% sure if I understand you correctly so my apologies if the below is irrelevant.
I've assumed you mean that the page in question can only be viewed on the front-end by users authorized in the back-end. If that's the case, then you can get a list of "memberships" for a site at:
You could use the actions api do so something like this:
{% action "get content types" %}
var memberships = callAPI("GET", "https://station.locomotive.works/locomotive/api/v3/memberships.json", {
data: {
},
headers: {
"X-Locomotive-Account-Email": "admin_email",
"X-Locomotive-Account-Token": "account_token",
"X-Locomotive-Site-Handle": "site_handle"
}
});
setProp("memberships", memberships);
{% endaction %}
You could then set the page in question to be restricted using Locomotive's built-in authentication. Then match the email address of the front-end user to the back-end user so that only authenticated users who also have a back-end membership can view the page.
Hopefully that makes sense. Hit me up again if you have questions.
Anybody know how I can organize my file system better than having all the sections in the folder app/views/sections
(i.e. split into multiple folders like: app/views/sections/folder1 && app/views/sections/folder2)
When I put my sections into different folders, those sections don't show up in the User Interface
@patternpoints Thanks for the response! I've sorted with categories for the Engine, but I was thinking it'd be handy to sort by categories in the backend. So you could have a folder structure like:
+ sections
- Heros
- full_width.liquid
- portrait.liquid
- Call_To_Actions
- button.liquid
- animated_button.liquid
- Contact_Forms
Inside your codebase.
Hi guys. ItÅ› possible to sync all content_entries excepted customers data? Imagine you have 20000 customers, the command bundle exec wagon sync env -r content_entries
will take much time to execute and a timeout error will be returned.
May be itÅ› possible to sync only a specific content_entry by bundle exec wagon sync en -r content_entries -f mySpecificContentEntry -v
?
Hi, just looking at locomotive. I'm trying to use tailwind css. I'm using tailwind cli to compile a file public/stylesheets/tailwind.css
. I have the issue that tailwind stylesheet has this rule:
abbr:where([title]) {
-webkit-text-decoration: underline dotted;
text-decoration: underline dotted;
}
when I try to deploy with wagon I get this errorpersisting stylesheets/tailwind.cssWarning: Unable to compress and minify it, error: Invalid CSS after "abbr:where(": expected pseudo_expr, was "[title])"
I am not really sure how wagon is compressing and minifying the files. I think the abbr:where([title])
is acceptable CSS? How can I get the file to be compressed and minified correctly?
OR is there a better way to include tailwind?
Thanks!