Discussions
Search by _id field
Hello again. I am having a trouble using the `with_scope` tag. I need to filter by `_id.in: array of ids`.
Looks like a normal case, but in the MongoDB logs I see `{"_id" => { "$in" => false } }` and it crashes.
On the other hand, if I filter entries by `id.in: array of ids` , the query looks good but I get no results.
Are there any prerequisites for such behavior or is this a bug?
Posted by Igor almost 2 years ago
Add "Code Promo" option in the shopping cart
Hi ! My company hired someone to develop a site using Locomotive 3 years ago, and today the shop looks not up-to-date at all. I wonder if it's possible to add options like a "code promo" champ for clients to add when checking out their cart?
Thx
Posted by Zara about 2 years ago
Not syncs content_entries
When I do sync from production it just text Syncing ContentEntries and thats all.
Posted by Misha Shelestiuk over 2 years ago
New language added not showing content from English version
Hi.
So we added Polish to our site and by default there is no translations or localising of the content in the models, it is just meant to show the English version. But adding the language, it doesn't show any of its content even after using the Wagon back office to re-save it for Polish.
There are plans for future languages to be added and deleting, re-adding all of the content in the models isn't a good solution. Currently the only similarities between the pages is that both uses type: select for filtering content.
The content type which is one of the two that is having problems.
- tutorial_type:
label: Type
type: select
select_options: ['Video', 'Written']
{% with_scope tutorial_type: 'Written', order_by: 'data_added.desc' %}
This is the code that is used to choose which content is shown and is ordered.
Is there a setting that might have been missed in the Wagon or something that can be set in the code?
Posted by Chloe Coyle over 2 years ago
Is there a way to shorten urls of filtered images ?
Hi,
I use the imagemagick filters to edit images on the fly on my website.
The urls generated for these filtered images are very long, like in :
`/steam/dynamic/W1siZmYiLCIvaG9tZS9ib2xvc3MvbG9jb21vdGl2ZS9wdWJsaWMvc2l0ZXMvNjA4MmFiZTI3NGZlNzIwNmFlMjE4N2I2L2Fzc2V0cy82MDgyYWM1MDc0ZmU3MjA2YWUyMTg3ZjQvV2ViXzE5MjBfLV8xLWltYWdlLTEucG5nIl0sWyJwIiwidGh1bWIiLCIyMDAwMDB4PiJdLFsicCIsImNvbnZlcnQiLCIrcHJvZmlsZSAnKicgLW1vZHVsYXRlIDEwMCwwIC1zaXplIDI1NngxISBncmFkaWVudDojRkYwMDJFLSNGRkY1OUIgLWNsdXQiXV0/a021273a9e4f1a38/Web_1920_-_1-image-1.png `
My client would like to shorten it. Do you know a simple way to do that ? Or should I use a javascript library to achieve that ?
Thanks,
Grégoire
Posted by Grégoire Colson over 2 years ago
is there a way to set up a download zone ?
Hi,
I'm trying to set up a download zone in a website, aka a kind of list of files that users can download by clicking on it.
I tried to use the `asset_picker` setting type on a section as defined here : https://doc.locomotivecms.com/docs/json-definition#setting-types
But I got this message when trying to push it :
```Resource invalid: definition The property '#/blocks/0/settings/0/type' value "asset_picker" did not match one of the following values: text, image_picker, checkbox, select, url, radio, content_type, hint, integer```
How would you achieve that in that case ?
Anyway, I think it would be great to update your doc if there is no more `asset_picker` type.
Thanks !
Grégoire
Posted by Grégoire Colson over 2 years ago
What is super_admin?
I noticed that in the Mongo collection 'locomotive_accounts' the user has a 'super_admin' field. But I didn't find any information about it.
Posted by Dmitry Karpushkin over 2 years ago
How to integrate with my existing rails app?
I would want to know how to integrate locomotiveCMS with and existing Rails app.
How can I call an existing rails app service wich loads products from db an show in a locomotive page?
How can I use my existing models in a locomotive install?
Sorry, but I can't find such information in the docs.
Thanks in advance!
Posted by manolei over 2 years ago
Comment gérer les espaces insécables dans les paragraphes
J'aimerais arriver à gérer correctement les espaces insécables dans les paragraphes rédigés par les utilisateurs, notamment pour éviter les retours à la ligne avant une ponctuation.
Une solution pour cela est d'utiliser , mais son utilisation dans l'éditeur rich text ne fonctionne pas et affiche littéralement " ".
Est-ce que vous voyez un moyen simple de gérer cela ? Via un script javascript ? Via un bouton dans l'éditeur rich text qui permettrait d'insérer un espace insécable ?
Merci d'avance,
Grégoire
Posted by Grégoire Colson almost 3 years ago
Pourquoi les éditeurs html (rich text) sont différent pour les content_types et pour les éléments des sections ?
Bonjour,
J'ai remarqué que l'éditeur "rich text" n'est pas le même quand il s'agit d'un élément à modifier dans les content_types et dans un élément d'une section.
Pour un content_type, la définition ressemble à cela :
```
- description: # The lowercase, underscored name of the field
label: Description # Human readable name of the field
type: text
text_formatting: html # html (uses rich text editor), markdown or text (uses plain text editor)
```
Pour un élément (bloc) d'une section, la définition est légèrement différente :
```
- label: Paragraphe
id: paragraph
type: text
html: true
line_break: true
```
Pour autant, le rendu dans l'interface d'admin n'est pas le même : l'éditeur html des content_type inclut notamment les boutons d'alignement du texte et de listes alors que l'autre est vraiment basique et permet uniquement le gras, italique, souligné, barré et l'insertion de liens.
Mon client désirant pouvoir centrer ou justifier les textes de ses pages, je me suis vu obligé d'ajouter une checkbox dessous lui permettant de décider de centrer ou justifier son paragraphe.
J'aimerais beaucoup éviter ce "monkeypatch", qui m'oblige à ajouter cette checkbox sous chaque élément de type text html dans mes sections..
Est-ce possible ?
Merci,
Grégoire
Posted by Grégoire Colson almost 3 years ago