Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Apr 12 2020 01:41

    jtkech on patch-1

    (compare)

  • Apr 12 2020 01:39

    jtkech on patch-1

    Update ZoneShapes.cs (compare)

Kevin Welsh
@kdubious
I sort of need:
{ "wildcard": { "Book.Genres" : "4ecpyyskvgnt244m6xa08pd7m2" --OR-- "4kv" }},
Jasmin Savard
@Skrypt
Ok, let's say you pass a param named "genres"
Then in Liquid you can use it by doing {{ genres }}
Kevin Welsh
@kdubious
right.
```
{ genres: ["4a","4b"]}
Jasmin Savard
@Skrypt
But if it's an array
Because it would come from the POST request
input name="genre" value="4a"
input name="genre" value="4b" ...
2 different inputs with the same name will become an array
Kevin Welsh
@kdubious
I may send JSON via AJAX, but I follow
Jasmin Savard
@Skrypt
That may work too
But then in the Lucene Query
Kevin Welsh
@kdubious
so I can write Liquid in my query json?
Jasmin Savard
@Skrypt
yep
it's a liquid template
that will parse liquid vars and also liquid code
{% for genre in genres %}
  { "wildcard": { "Book.Genres" : {{ genre }} }},
{% endfor %}
Kevin Welsh
@kdubious
and if I take LuceneQuerySource approach... I can build my own template string?
Jasmin Savard
@Skrypt
Yes
You pass any string containing Liquid and it will parse it
Kevin Welsh
@kdubious
{
  "size": 10,
  "query": {
    "bool": {
      "should": [
        { "wildcard": { "Book.AgeGroups" : "4gdb5kp6ka225s7vb82969tf4p" }},
        {% for genre in genres %}
        { "wildcard": { "Book.Genres" : {{ genre }} }},
        {% endfor %}
      ]
    }
  }
}
and
{ genres: ["4kvmcwpf0f2ry5r0nxeps5t3dh","4ecpyyskvgnt244m6xa08pd7m2"] }
Jasmin Savard
@Skrypt
all good :)
Kevin Welsh
@kdubious
Invalid query : Unexpected character encountered while parsing number: k. Path 'query.bool.should[1].wildcard['Book.Genres']', line 8, position 41.
Almost all good!
Jasmin Savard
@Skrypt
{ "wildcard": { "Book.Genres" : "{{ genre }}" }},
Kevin Welsh
@kdubious
ok
quotes
Kevin Welsh
@kdubious
InvalidOperationException: Unable to resolve service for type 'OrchardCore.DisplayManagement.Razor.IOrchardDisplayHelper' while attempting to activate 'PanhumanBooks.Pages.DemoModel'.
Jasmin Savard
@Skrypt
You are missing some using in you _viewImport file
Kevin Welsh
@kdubious
in my razor page:
OrchardCore.DisplayManagement.Razor.IOrchardDisplayHelper _orchard;
        public DemoModel(OrchardCore.DisplayManagement.Razor.IOrchardDisplayHelper orchard)
        {
            _orchard = orchard;
        }
Oops, OrchardCore.IOrchardHelper
Kevin Welsh
@kdubious
Have you seen this before: No service for type 'OrchardCore.DisplayManagement.Razor.IOrchardDisplayHelper' has been registered.
Kevin Welsh
@kdubious
Your browser sent a request that this server could not understand
;(
hours
I can't work out why I'm not able to POST JSON to an Action
Kevin Welsh
@kdubious
[IgnoreAntiforgeryToken] (F*CK)
1 reply
Kevin Welsh
@kdubious
ok, Lucene query: I need OR for Terms in a Taxonomy, and AND across Taxonomies. So If I pass in: Kids (age), Teens (age), Poetry (genre)... I'm looking for "(kids of teens) and poetry"
Kevin Welsh
@kdubious
And, with help from @Skrypt , here it is:
{
    "size": 10,
    "query": {
        "bool": {
            "must": [
{% if genres %}
                {"match": {
                    "Book.Genres": {
                        "query":"{% for genre in genres %}{{genre}} {% endfor %}",
                         "operator": "or"
                          }
                    }
                },
{% endif %}
{% if agegroups %}
                {"match": {
                    "Book.AgeGroups": {
                        "query":"{% for agegroup in agegroups %}{{agegroup}} {% endfor %}",
                         "operator": "or"
                          }
                    }
                },
{% endif %}
{% if geographies %}
                {"match": {
                    "Book.Geography": {
                        "query":"{% for geography in geographies %}{{geography}} {% endfor %}",
                         "operator": "or"
                          }
                    }
                },
{% endif %}
{% if represenationgroups %}
                {"match": {
                    "Book.RepresentationGroups": {
                        "query": "{% for group in represenationgroups %}{{group}} {% endfor %}",
                         "operator": "or"
                          }
                    }
                }
 {% endif %}
            ]    
        }
    }
}
2 replies
Josiah Nunemaker
@JosNun
Are there any special steps / requirements for publishing a module to a nuget repo? I have a module that works fine when I add it as a project reference to my project, but if I add the published version, it doesn't show up in the Features tab
27 replies
Nic Scott
@Nic-84
I have a suggestion to slightly improve the UI on the admin side of Orchard. When you are dealing with media/images, the media picker has a white background (or black background in dark mode). Instead, could you make the background a checkered board, like other image software? I am using transparent pngs/svgs, and it would be nice to be able to see the image when it's either all white or all black. I have included a screen shot to explain what I mean. Should I post something like this on the GitHub site, Discussions > Ideas?
orchard-media-screen.jpg
Kevin Welsh
@kdubious
@Nic-84 yeah, very useful. I've done that on other project with image processing to deal with white logos with transparency
Can also be done with pure css to add a striped bg
S├ębastien Ros
@sebastienros
@Nic-84 do you want to create a PR for that? Or at least an issue to entice someone into doing it
Jasmin Savard
@Skrypt
done
1 reply