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)

Kshitiz
@KshitizGIT
I created a widget, and its content is populated by a third party api call. How can I use Pager for pagination for this ?
1 reply
gemer45684 ddwfzp
@gemer45684_gitlab
Hi there!
I have some troubles trying to use the HTML Editor to put a Collapse elemente from Bootstrap.
Do you have some idea why or how I could add this kind of element in a page?
Sébastien Ros
@sebastienros
@gemer45684_gitlab wrong forum, sorry
somecodeguy
@dafergu2:matrix.org
[m]
@sebastienros: Speaking of drivers, is that the correct place to add more to a content item's model prior to rendering? I have a content type that needs a 3rd party db lookup in order to populate dropdowns. I'm looking through them right now and I'm guessing I should use those? If so, what is the significance of .Location and Actions:4, Content:10?
30 replies
wapanman
@wapanman
Hello. Im total noob. I cant get the search feature to work. Any common issues with search? As far as i can tell, the shape is loaded but the Model is empty. Any ideas?
1 reply
juergen-de
@juergen-de
Not sure its OrchardCore related, but I receive a 400 bad request error when calling
public ActionResult Read(xxx) in a custom mvc module. The action is called by a kendoui grid, I only copied the code over. The grid itself displays fine, but the Controller is never hit, I get a 400 bad request right away.
Dean Marcussen
@deanmarcussen
probably missing an Antiforgery token @juergen-de
1 reply
Dave Black
@daveblack101
placements.jpg
The flexibility placements bring is just magnificent 👌👌
Troy Parkinson
@trousyt
Hi there. Trying to get Orchard working with an SPA app. Basically, I want the SPA to handle any routes that Orchard doesn't, with the exception of my API controllers. So far I've got the below code. The SPA works, but I can't seem to call any of my API controllers (they are using route attributes), and I can't access the Orchard backend -- the SPA handles all of it. Any ideas what I'm doing wrong?
void Configure(app) {
  // ...
  app.UseSpaStaticFiles();
  // ...
  app.UseOrchardCore();
}

void ConfigureServices(services) {
  services.AddOrchardCms(builder => {
    builder.ConfigureServices(tenantServices => {
      tenantServices.AddControllers();
    })
    .Configure(tenantApp => {
      tenantApp.UseSpa(spa => {
        spa.Options.SourcePath = "ClientApp";
        if (Environment.IsDevelopment()) {
          spa.UseReactDevelopmentServer(npmScript: "start");
        }
      }
    })
  }
}
juergen-de
@juergen-de

Hello, how do you set .AddJsonOptions for a MVC Module if you cant use services.AddMvc() ? I tried to use
services.AddControllers().AddJsonOptions(options => {
options.JsonSerializerOptions.PropertyNamingPolicy = null;
options.JsonSerializerOptions.DictionaryKeyPolicy = null;

        });

in the module, but it does not seem to do anything at all

alin-devnet
@alin-devnet
Is it possible to change a content field to a different type? ie from Markdown to Html field. I was thinking about removing and adding the field back in, but the saved content for that field is sort of lost (which makes sense as the JSON structure is different between the two field types). Is there a way to change the content field type and somehow keep the content (potentially migrate the content)?
1 reply
HUYNH ANH NHAT
@nhathuynh77
Capture.PNG
Capture1.PNG
HUYNH ANH NHAT
@nhathuynh77
error when load template
page
1 reply
but debug it work ok
release error template
Simon
@simtr

Hi, I'm fairly new to OrchardCore and I'm trying to build a SPA that uses the GraphQL API for fetching content, I'm having some difficulties with GraphQL when querying fields in content items inside bags.
I have a custom "BagPage" content type with a "Bag" part that accepts "FaqItem" children. The "FaqItem" content type has two fields: "Question" (plain) and "Answer" (markdown).
When I try to run the following query:

query MyQuery {
  bagPage {
    bag {
      contentItems {
        ... on FaqItem {
          contentType
          answer {
            html
          }
          question
        }
      }
    }
  }
}

I get the content items, but the answer & question fields are not present:

{
  "data": {
    "bagPage": [
      {
        "contentItems": [
          {
            "contentType": "FaqItem"
          },
          {
            "contentType": "FaqItem"
          }
        ]
      }
    ]
  }
}

Is there something I'm missing?

1 reply
David Ferguson
@somecodeguy_twitter
I made a custom accessor for liquid that returns a list of time zone objects. If I do an assign and then console_log to it, I get the array of JSON objects I’m expecting. When I loop through the array to add to a select the properties of the object rendering as nil. How do I fix that?
2 replies
Felipe Pergher
@FelipePergher
Hey guys, I have a noob question. If I want to use MVC on a decoupled site, I need to create a module or I can use directly on the main project? And if can be directly on the main projet, how I can configure the default mvc route? Thanks in advance for any help :)
1 reply
Mike Paterson
@devlife
Is it possible to view past workshops? i'm specifically interested in the commerce workshop (#5)

Also i'm getting the following when running npm install from the repo root

ERROR: "install:orchardcore.apis.graphql" exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! undefined postinstall: `run-s install:*`

Any ideas?

Dean Marcussen
@deanmarcussen
check you've got the lates npm and nodejs @devlife I don't think the commerce workshop was ever able to run sorry
Mike Paterson
@devlife
ok thanks Dean.
CrestApps
@CrestApps
I get this error when trying to get use session to query an index KeyNotFoundException: The given key 'OrchardCore.ContentManagement.ContentItem, OrchardCore.ContentManagement.Abstractions' was not present in the dictionary.
this is the query that cause that error
var contentItem = await _session
                    .Query<SearchPage, SearchPageIndex>()
                    .Where(index => index.PageKind == PageKind.ByCity)
                    .FirstOrDefaultAsync();
any idea on what is causing this error?
Dean Marcussen
@deanmarcussen
are you querying a ContentItem or a SearchPage model ?
CrestApps
@CrestApps
SearchPage is derived from ContentItem
Dean Marcussen
@deanmarcussen
won't work.
CrestApps
@CrestApps
by I am pulling SearchPage
what will work?
Dean Marcussen
@deanmarcussen
ContentItems are composition not inheritance based, so you can't make a model that derives from them. so .Query<ContentItem, ... and delete the SearchPage model
CrestApps
@CrestApps
Got it! that worked. thank you
CrestApps
@CrestApps

I create a content type called "SearchPage" with "TitlePart", "Custom1Part", "Custom2Part" and "FlowPart".

I want to control how the content is rendered. so I created a view called "Content-SearchPage" and it looks like this

@using OrchardCore.Mvc.Utilities;

@{
    Model.Classes.Add("content-item");

    var contentTypeClassName = ((string)Model.ContentItem.ContentType).HtmlClassify();
    Model.Classes.Add(contentTypeClassName);
}

<div class="card bg-light mb-3 mt-3 @String.Join(" ", Model.Classes.ToArray())">

    @if (Model.Header != null)
    {
        <h1 class="card-title text-center text-info pt-3">@(Model.Header.TitlePart.Title)</h1>
    }
    <div class="card-body">
@* here I want to display the CustomPart1 and CustomPart2 *@
        @await DisplayAsync(Model.Content)
    </div>

    @if (Model.Footer != null)
    {
        <div class="card-footer text-muted">
            @await DisplayAsync(Model.Footer)
        </div>
    }
</div>

@* here I want to display the FlowPart *@

FlowPart seems to be rendeed via Model.Content. How can I render is outsize the html card instead?

AkshayDevkit
@AkshayDevkit
Hi, I have deployed a Orchard Core Project on Ubuntu 16.04 machine but for some reason Im getting this MVCSandbox page and the menu is also not visible but Im able to make the API calls. Admin dashboard is also not accessible since Im stuck on this MVCSandbox page. Thank you in advance for any help!
Richard Garside
@NogginBox
I want to show a list of content items from a query in a widget (or possibly just on a page).
I thought there would be a part (like a List) where you could choose a query and it would then show the content items from that query.
I can't find a part that does this. Is there another way?
Sébastien Ros
@sebastienros
@NogginBox Liquid Part using the Query helper to execute predefined queries (lucene or sql)
Arra Derderian
@aderderian
@MichaelPetrinolis I was wondering if you have seen the request to add the ability to append query string parameters to the OIDC authorize requests?
One person has a requirement to have a parameter called "instanceID " on the requests.
Richard Garside
@NogginBox
Thanks @sebastienros !!
aaronamm
@aaronamm

Just updated How to create a custom OrchardCore module document. I hope it will be useful. It has some fundamental of content type/content item and explain some important components in a module.

https://github.com/codesanook/Codesanook.Map

Ammar Al-Sayegh
@aalsayegh
Hello... I'm getting the following error while compiling Material Design theme: The type or namespace name 'IUser' could not be found. Which package provides IUser?
Sébastien Ros
@sebastienros
image.png
Ammar Al-Sayegh
@aalsayegh
image.png
Thank you @sebastienros for your pointer. I added the reference and was able to successfully compile Theme. However, I am not getting the "Material Design Theme" option in the Recipe list as shown in https://www.youtube.com/watch?v=KW3VjBS-Lhg. What did I miss?
Sébastien Ros
@sebastienros
First these are "Setup" recipes, there is a custom property to set. Then you need to reference the project from the main project.
Matteo Piovanelli
@MatteoPiovanelli-Laser
hey guys, is there a quick way to generate all nuget packages for the orchard core solution and have them all in a folder correctly referencing each other where they have to?
I'vre tried referencing the prerelease Application.Cms.Targets package in a .net5 application, and it fails when starting the default tenant because of the issue with IHtmlLocalizer.WithCulture due to versions of .net core.
Upgrading packages to a (locally built/packages) .net5 version one by one is tedious: upgrading one causes other errors to popup, that require me to upgrade another and so on.
Ideally, I would like to locally have the Application.Cms.Targets package, and only add that to my project.
10 replies
Simon
@simtr

Hi, I'm fairly new to OrchardCore and I'm trying to build a SPA that uses the GraphQL API for fetching content, I'm having some difficulties with GraphQL when querying fields in content items inside bags.
I have a custom "BagPage" content type with a "Bag" part that accepts "FaqItem" children. The "FaqItem" content type has two fields: "Question" (plain) and "Answer" (markdown).
When I try to run the following query:
snip
I get the content items, but the answer & question fields are not present:
snip
Is there something I'm missing?

This problem seemed to fix itself for no apparent reason when I ran the project again a few days later, I suspect some sort of caching issue

Ammar Al-Sayegh
@aalsayegh

First these are "Setup" recipes, there is a custom property to set. Then you need to reference the project from the main project.

@sebastienros, you are right. The theme project wasn't referenced in the main project. I referenced it and it worked out. Thank you very much!