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)

VectorMan
@vector-man
Is it possible to work entirely in code (not changing settings in the UI) when developing with Orchard Core?
VectorMan
@vector-man
Also, another question: I'm working on a giveaway website, and I'm not sure where to begin with Orchard Core. I need to create a custom entity type called Sweepstakes, and this has various properties such as Name, Date, Entrants (which are Users who entered the sweepstake) etc. Is there any examples where I can add custom entities and have them added/edited in the UI? I'm trying to do it with Razor Pages, not MVC, if possible.
(also, I'm trying to do it from code, not adding stuff through the UI backend. I prefer to work code first, but if it's not possible, any solution will do. )
VectorMan
@vector-man
(to clarify, I want to develop everything in code, but the editing of the sweepstakes entries I want to do in UI once everything is ready)
somecodeguy
@dafergu2:matrix.org
[m]
Yup, you can do it all in code. Take a look at the orchard core dojo videos by Lombiq on Youtube. They walk you through creating content parts and content items in code. Also gives you a good foundation.
Also, take a look at the OrchardCore.Demo project in the github repo. Shows you how to set up things to use Razor Pages instead of MVC.
Tony Han
@hyzx86
image.png
Is there a problem with JSON conversion? Is this a bug or is there a problem with my writing?
brunoAltinet
@brunoAltinet
Hey guys, i've searched all over but can you confirm that it is not possible to get changes to razor views inside modules reflected in browser by merely saving and refreshing?
Need to know before I switch over to liquid. I did see the comment by sebastian on 1 SO question that that is indeed the case
Dean Marcussen
@deanmarcussen
@brunoAltinet razor should recompile on save when the environment = development
brunoAltinet
@brunoAltinet
Even when views are in module?
Is there any setting i'm supposed to have for that?
Dean Marcussen
@deanmarcussen
yes. there are settings. if it isn't working and you have set your ASP_ENV = Development the easiest way to get the correct csproj settings is to gen an app with the templates https://docs.orchardcore.net/en/dev/docs/getting-started/templates/index.html and compare the differences to your web project.
brunoAltinet
@brunoAltinet
Ok, so it's not working for me, module looks pretty much the same but i took a look at the OrchardCore code and it seems that it needs that refs folder inside assembly to function. I dont see it, and when I add an empty one manually it bugs out
Dean Marcussen
@deanmarcussen
if it isn't working and you have set your ASP_ENV = Development the easiest way to get the correct csproj settings is to gen an app with the templates https://docs.orchardcore.net/en/dev/docs/getting-started/templates/index.html and compare the differences to your web project.
brunoAltinet
@brunoAltinet
Still not working but i can see in orchardCore source code that it's disabled if no refs folder is present in assembly folder
which is missing in my case
ASP_ENV is development if you mean by that on "ASPNETCORE_ENVIRONMENT": "Development"
Dean Marcussen
@deanmarcussen
You are making me repeat myself. the easiest way to get the correct csproj settings is to gen an app with the templates https://docs.orchardcore.net/en/dev/docs/getting-started/templates/index.html and compare the differences to your web project.
brunoAltinet
@brunoAltinet
Ah, ok:) i have misundersood
brunoAltinet
@brunoAltinet
Awesome thanks: If anyone gets the same issue i was missing <PreserveCompilationReferences>true</PreserveCompilationReferences> in my csproj file. Thanks again!
somecodeguy
@dafergu2:matrix.org
[m]
Hrm, if I add a custom part to a liquid widget, I get an exception stating my shape is not found. Is that not something I can do?
Sébastien Ros
@sebastienros
@dafergu2:matrix.org you should be able to add any part to a widget, file an issue with the repro
somecodeguy
@dafergu2:matrix.org
[m]
@sebastienros: I'll see if I can create an easy repro and create a bug for it. In the meantime, do you have any suggestions on how to workaround it or fix it? The exception is thrown by OrchardCore.DisplayManagement.Implementation.DefaultHtmlDisplay.ExecuteAsync(DisplayContext context). Could I replace the default implementation and debug it?
Since I'm using nuget packages for references vs running against the entire OC code base.
somecodeguy
@dafergu2:matrix.org
[m]
@sebastienros: I figured it out. The part was defined and working properly but I did not have a display template file in the module. Since the other place I was using the part had its own shape template in my theme which ignores the part when rendering, none of my other code was actively trying to render the part. This part really doesn't do anything except impact styles rendered in other portions of the markup surrounding the widget the part is placed on.
So, my fix was to create an empty shape template cshtml file.
Would you consider that a bug? Should it simply try to render the part just like it would if it were created in the admin UX?
Sébastien Ros
@sebastienros
File an issue and we'll triage it. There might still be an issue as it could have fallen back to a standard template, I need to understand the details to say if it's a bug.
Sébastien Ros
@sebastienros

@/all We are saddened to inform you that Piotr Szmyd, one of our founding contributors, has passed away. Piotr was a friend to all of us. To pay our respect we have created a thread where people can share memories and messages.

OrchardCMS/Orchard#8484

orbus-dkreivenas
@orbus-dkreivenas
Hey, have a question, we are facing some memory issues running Orchard CMS in Azure, we use it as a multi tenancy system, hosting more than 100 tenants, each tenant takes around 200mb of memory, so obviously this is not really viable except having to scale the app service into separate app services and put some kind of a front door on top of them. The question really is kind of abstract: what are your recommendations in scaling Orchard, maybe there is some kind of unload functionality for tenants that are inactive etc... ?
Jasmin Savard
@Skrypt
@orbus-dkreivenas You are using Orchard or Orchard Core?
orbus-dkreivenas
@orbus-dkreivenas
We are using OrchardCMS
kulandairaj
@kulandairaj
Hey, can I use OrchardCore for Asp.net core angular application to make it multi-tenant or modular
3 replies
Le Thanh Son
@lethanhson1998
Hi there, I'm new in orchard core, I have two taxonomy field as selected field, can someone tell me how can i display data in second field according to each selected value in first field, or any document describing this, thanks.
changdongqing
@chdq0306
image.png
somecodeguy
@dafergu2:matrix.org
[m]
@deanmarcussen: Following up on a conversation we had a few weeks ago, you mentioned creating a driver for the content type that I wanted to see requested data for during preview. I have it working but I wanted to verify that the base class I'm deriving the content type from is correct.
public class MyContentTypeDriver : ContentDisplayDriver
{
        private readonly ClassDetailsAccessor _classDetailsAccessor;
        // .... other services used

        public MyContentTypeDriver(ClassDetailsAccessor classDetailsAccessor, /* other injected services */) { _classDetailsAccessor = classDetailsAccessor }

        public override async Task<IDisplayResult> DisplayAsync(ContentItem model, BuildDisplayContext context)
        {
            if (!CanHandleModel(model))
            {
                return null;
            }

            // Allows a user to preview the class details instead of only retrieving the class details when
            // we access the content from the known url route.  The content preview functionality uses a
            // different route.
            if (_classDetailsAccessor.ClassDetails is null)
            {
                var classId = int.TryParse(_httpContextAccessor?.HttpContext?.Request.Query["classId"], out var id)
                    ? id
                    : 23798;
                _classDetailsAccessor.ClassDetails = await _classDetailsService.GetClassDetailsAsync(classId);
            }

            // We return a null shape since we did not render the content type
            return null;
        }

        public override bool CanHandleModel(ContentItem model)
        {
            return model.ContentType == "MyContentTypeTechnicalName";
        }
}
somecodeguy
@dafergu2:matrix.org
[m]
Would the above be the correct base class and the correct method to override? And returning null is the correct thing to do? I don't want to introduce code in the future that will become a performance issue by increasing a burden on every content type for example. I'm trying to understand how to define a driver that is appropriate. I know that content parts have a generic type that is specified, but I couldn't find an example for that when dealing with content types.
Andy Rose
@andycyberian
I have a requirement for a Content Type to have a couple of text fields that are validated as having a unique values across similar content types when published. I've initially looked at creating a custom field (similar to a text field) with validation in the UpdateAsync method but am struggling a bit with the query to ensure the field value is unique. I can see that I can retrieve the content type property 'Path' from the field parameter and can retrieve matching content types with a query but am struggling to look up the properties to compare. I was wondering if there was a simpler approach or should I rather be considering a content part for this? Or should I just push on with the approach I am taking?
9 replies
ruisdias
@ruisdias
Hello,
anyone knows what that "base url" in the settings is for?
Mike Paterson
@devlife
I have a lucene query that, when run in admin UI, returns results. however, running Orchard.ContentQueryAsync() always returns zero results. Can you point me in the right direction regarding how to resolve this issue?
6 replies
image.png
Mike Paterson
@devlife
image.png
Jean-Philippe Tissot
@jptissot
Would it be possible to support many RequestUrlPrefix in oc ?
21 replies
orbus-dkreivenas
@orbus-dkreivenas
Hey, is it possible to unload a tenant that is not used?
agono
@agono
Hi all! I want to modernize a project/site with a large relational database to Orchard Core. In the database, there are multiple 1:N hierarchies, where the parent record is referenced by hundred-thousands up to to a few millions of records and there are a lot of other relations. I would be happy if i could use Orchard as an application framework. But, how to do it correctly and without sacrificing some useful features of Orchard? What are my options? Remodeling the DB and use the yessql document approach - i am not sure this would be a good idea. Using Dapper (or EF Core) with raw tables in Orchard? Perhaps, but how to do it without loosing a lot of Orchard framework features? I know, I can use just "anything" in my custom modules as it is just a asp.net core app in the end, but i have the feeling that i will loose very much of Orchards features... Are there some docs or source code to look at? Thank you for your help!
And i have another (dumb) question :) Is it possible to run 2 orchard core sites with data "shared" in one database? One site would be the "backend" accessible only from local network with lot of CRUD functionality and the other one would be the "readonly" website.
Seth Cleaver
@scleaver
Hey how are the out of the box roles created? Is it via code somewhere?
1 reply