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)

byhub
@byhub
hi everyone, got quick question for anyone who can help with. We are trying to convert from Orchard legacy to orchard core. It seems like there is no IFieldStorage interface in orchard core. Can you please guide us with some documentation link "to implement custom field storage" --> IFieldStorage interface doesn't exist in Orchard Core so that there must be a new logic/model/api. Thanks in advance!
38 replies
dataminer-accolade
@dataminer-accolade
Hi guys, I would like to import data from different data sources. What would be the best solution to create content via API. As far as I know, GraphQL API does not support mutations.
5 replies
awyl
@awyl
Is there any way to replace the default search for contents on the top of content items admin page? I have built one with that look up lucene. I want to let the user just type what they want to search (e.g., "16659") instead of having to add something like "full:16659".
Dean Marcussen
@deanmarcussen
@awyl it depends where you want to replace (i.e. the entire thing, or just a section). you could replace the query service, or just register a different default term (the term that does not require full:) and use lucene for the query in that. (it was designed and intended that if you wanted to replace it with a lucene query you could)
Saleem-Developer
@saleemhaq
face this issue:
image.png
image.png
awyl
@awyl
@deanmarcussen I want to replace default term on /Admin/Contents/ContentItems. I tried to register a different default term, but it didn't work. I still want other filters to work as it is now. Just want to swap the default text: to my full:.
Niraj Soni
@ns8482e
@awyl may be you can register your own IContentsAdminListFilterProvider that takes full as default term
awyl
@awyl
I did. The default one still run instead of mine. Is there a way to remove the default “text:” one?
Niraj Soni
@ns8482e
may be the order of registation?
awyl
@awyl
You mean setting the priority of my module higher than Contents? I can try that.
Niraj Soni
@ns8482e
not the whole module just the registration of your IContentsAdminListFilterProvider before Contents
awyl
@awyl
How do I do that?
Niraj Soni
@ns8482e
good question
[RequireFeatures("OrchardCore.Contents", "MyModule")]
    public class FullTermStartup : StartupBase
    {
        // Run Before 
        public override int Order => -1;
        public override void ConfigureServices(IServiceCollection services)
     {
        services.AddTransient<IContentsAdminListFilterProvider, FullTermContentsAdminListFilterProvider>();
     }
    }
awyl
@awyl
Yes, it totally works. Thank you very much.
Updated to latest dev. Lucene 4.8 beta 15
This shows how to register a Lucene.NET built-in Analyzer. Also shows how to register a custom one.
The Analyzers have changed a little in beta 15
Lucene now uses its own Exception extension class which requires some refactoring on custom analyzers.
Sébastien Ros
@sebastienros
Today's meeting is an hour earlier for Europeans ... changed time
meaning now ;)
Dave Black
@daveblack101
🤦‍♂️ I always get foiled by the time change
Mark Clark
@daerogami
Should I be able to get access to the IConfiguration instance in a Module's startup class? I thought it was a statically available class but I could be thinking of NET4
The MS and OC docs weren't very explicit on whether I need to fetch it from the service provider (or I missed where it was)
Wondering if I should be able to just do something like this
private readonly IConfiguration _configuration;

public Startup(IConfiguration configuration)
{
    _configuration = configuration;
}
Niraj Soni
@ns8482e
why not ? should work
however its better to use IShellConfiguration
supports tenant aware configuration
if you would like to have different config per tenant
Mark Clark
@daerogami
no need for tenancy support, will always be single tenant and this is for a module spinning up a few EF contexts from external sources and I just need a way to access the connection strings.
Kevin Welsh
@kdubious
Does anyone use the SEO settings? I don't think the Canonical field is doing anything.
Mike Paterson
@devlife
how can i explicitly render one content item inside of another content item? Something like this (but that actually works :))
<div id="hero-container" class="ra-hero--saber @String.Join(" ", Model.Classes)">
    <div class="ra-hero__content">
        <div class="ra-hero__callout ra-contained">
            <div class="ra-hero__callout-content">
                @await DisplayAsync(Model.Header)

                @{
                    var widgets = (ContentItem[])Model.ContentItem.Content.FlowPart.Widgets.ToObject<ContentItem[]>();
                    var logos = widgets.Where(c => c.ContentType == "FlowMediaWidget").ToList();

                    foreach (var logo in logos)
                    {
                        @* This throws as it needs a shape *@
                        await DisplayAsync(logo);
                    }

                    Model.Content.Remove("FlowMediaWidget");
                }
            </div>
        </div>
    </div>
    @await DisplayAsync(Model.Content)
</div>
Dean Marcussen
@deanmarcussen
It worked when I wrote it @kdubious
Kevin Welsh
@kdubious
@deanmarcussen if I set a value on a BlogPost, it doesn't seem to render it in the head tag
do you know if it expects other settings?
Dean Marcussen
@deanmarcussen
@devlife you need to call BuildDisplay first. There’s a helper Orchard.DisplayAsync which does it, or inject the content item display manager
3 replies
I don’t think so. Try it on a page that isn’t a list. Cause the list renders RSS feed links as well. It shouldn’t conflict though
Kevin Welsh
@kdubious
no luck. I set it to the following on the home page, but nothing renders:
image.png
og:url and twitter:url get set automatically to "https://www.panhumanbooks.com/home"
but no <link rel="canonical"
Kevin Welsh
@kdubious
@deanmarcussen Do I need something like this for the link?
<resources type="Meta" />
Ahh... <resources type="HeadLink" />
Mike Paterson
@devlife
Is there a way to remove all "FlowMediaWidget" parts from the "FlowPart.Widgets" array here? I tried Model.Content.Remove("FlowMediaWidget"); but no such luck.
{
  "TitlePart": {
    "Title": null
  },
  "HeroContainer": {
    "BackgroundImage": {
      "Paths": [
        "Innovator Resources/SERIES-I-Logo-Hero-2.png"
      ],
      "MediaTexts": []
    },
    "CalloutLogo": {
      "Paths": [],
      "MediaTexts": []
    }
  },
  "FlowPart": {
    "Widgets": [
      {
        "ContentItemId": "4dpm8bcp9aevywvjhecehncsnd",
        "ContentItemVersionId": null,
        "ContentType": "FlowMediaWidget",
        "DisplayText": "Logo",
        "Latest": false,
        "Published": false,
        "ModifiedUtc": "2021-11-03T17:21:14.8646595Z",
        "PublishedUtc": null,
        "CreatedUtc": null,
        "Owner": "",
        "Author": "admin",
        "FlowMediaWidget": {
          "Media": {
            "Paths": [
              "Logos/SERIES_I_LOGO_Tagline.png"
            ],
            "MediaTexts": [
              ""
            ],
            "Anchors": [
              {
                "X": 0.5,
                "Y": 0.5
              }
            ]
          }
        },
        "FlowPart": {
          "Widgets": []
        },
        "TitlePart": {
          "Title": "Logo"
        },
        "AdditionalStylingPart": {
          "CustomClasses": "center-logo",
          "RemoveGridExtensionClasses": false
        },
        "@WeldedPartSettings": {
          "AdditionalStylingPart": {}
        },
        "FlowMetadata": {
          "Alignment": 2,
          "Size": 100
        }
      }
    ]
  },
  "AdditionalStylingPart": {
    "CustomClasses": "ra-hero--saber-detail",
    "RemoveGridExtensionClasses": false
  },
  "@WeldedPartSettings": {
    "AdditionalStylingPart": {}
  },
  "FlowMetadata": {
    "Alignment": 3,
    "Size": 100
  }
}
Niraj Soni
@ns8482e
json is in Model.ContentItem.Content
Mike Paterson
@devlife
right. i know that's where it is. But how can I remove json objects from the FlowPart.Widgets JArray?
Niraj Soni
@ns8482e
have you tried with <contentitem > tag helper?
Mike Paterson
@devlife
I'm not sure what you mean. how would that remove parts of the json?