by

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 01:41

    jtkech on patch-1

    (compare)

  • Apr 12 01:39

    jtkech on patch-1

    Update ZoneShapes.cs (compare)

PDF-SDK
@PDF-SDK
after upgrade to the latest RC, I got the above error when adding or registering a new user. Any idea?
PDF-SDK
@PDF-SDK
@agriffard Thank you. Below is the reason of the failure of the migration but I'm not sure how to resolve it...
2020-07-08 09:35:53.3380|Default||d8c9fe62-4e2ef615905f9882.||OrchardCore.Data.Migration.DataMigrationManager|ERROR|Error while running migration version 3 for 'OrchardCore.Autoroute'. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> Microsoft.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near the keyword 'if'.
at Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction)
at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at Microsoft.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean isAsync, Int32 timeout, Boolean asyncWrite)
at Microsoft.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource1 completion, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry, String methodName) at Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery() at Dapper.SqlMapper.ExecuteCommand(IDbConnection cnn, CommandDefinition& command, Action2 paramReader) in //Dapper/SqlMapper.cs:line 2797
at Dapper.SqlMapper.ExecuteImpl(IDbConnection cnn, CommandDefinition& command) in /
/Dapper/SqlMapper.cs:line 568
at YesSql.Sql.SchemaBuilder.Execute(IEnumerable1 statements) at YesSql.Sql.SchemaBuilder.AlterTable(String name, Action1 table)
at OrchardCore.Autoroute.Migrations.UpdateFrom3() in C:\projects\orchardcore\src\OrchardCore.Modules\OrchardCore.Autoroute\Migrations.cs:line 84
ClientConnectionId:cf32ff6d-9ca2-411b-9d6a-c27f1818c2a8
Dean Marcussen
@deanmarcussen
@PDF-SDK yes, we have seen that before on old versions of sql server 2014 perhaps? see this issue OrchardCMS/OrchardCore#6210
PDF-SDK
@PDF-SDK
@deanmarcussen yes, you are right. Thank you. Mine is 2012. It's time to upgrade. Thanks again!
Arjan Vermunt
@ArieGato
Is it possible to use images from the media library in a MarkdownBodyPart?
captmomo
@captmomo

@captmomo
I'm trying to create a part to display Json data in a html table and am really struggling with the concept of shapes and parts.
Typically if I wish to display such a view in normal MVC, I will just pass a model then render it. However, I would like to make it a re-useable part like the rest of orchard core.
My question is how do I pass a part to a view ?
I know the view for a part is using:

@model ShapeViewModel<DynamicViewModule.Models.DataTablePart>

but what about a view where I want to pass the part in and render it?

do I just call DisplayAsync? and how would the controller for the view look like?

      @await DisplayAsync(Model.Content)

```

Or render the template for my part in the cshtml?
captmomo
@captmomo
@model dynamic
@inject OrchardCore.ContentManagement.Display.IContentItemDisplayManager ContentItemDisplayManager


<div class="columns is-centered">
    <div class="column is-half">
        <div class="box">
            <div class="content">
                    @await DisplayAsync(Model.Content)

            </div>
        </div>
    </div>

</div>
ok so i got the Model.Content. how do I get the template to render? sorry for all the questions. this is just quite frustrating.
Dean Marcussen
@deanmarcussen
@captmomo it sounds like you are trying to mix decoupled (but with controllers?) and templated, ie. display management techniques, which are two different approaches to design. They can overlap, but with some pain, and work. In short you need to call BuildDisplay on a content item if you want to use shapes, then you call DisplayAsync on the result. But at that point, why even have a custom controller at all?
captmomo
@captmomo
thanks Dean, yea I begin to realise what i want is easier achieved with a viewmodel
but I also want a useable part that can be rendered for example as part of a page or form
Dean Marcussen
@deanmarcussen
yep, regardless how you do it, if you want to use templating bits, you need to call BuildDisplayAsync on a content item (not a part, it doesn't work that way)
3 replies
    @foreach (var contentItem in Model.BagPart.ContentItems)
    {
        var item = await ContentItemDisplayManager.BuildDisplayAsync(contentItem, Model.BuildPartDisplayContext.Updater, Model.Settings.DisplayType ?? "Summary", Model.BuildPartDisplayContext.GroupId);
        @await DisplayAsync(item)
    }
an example from the bagpart, or look in the Contents.ItemController to see how it works in the standard controller
DJ Megarry
@djdev101_gitlab
Can anyone advise how i delete a specific contentItem in a workflow? I can delete all of a custom content type but I can't get the javascript expression right to delete just one item based on its content. I access all of the content type items via a query but I can't filter the resulting object.
Kévin Chalet
@kevinchalet
@/all if you use the OpenID module and the latest nightly builds, don't miss this important announcement: OrchardCMS/OrchardCore#6608
Jus
@Jus56288672_twitter
When trying to add razor pages to my theme based on the Blog Theme, i get this error:
he 'Microsoft.NET.Sdk.Razor' SDK is required on Themes and Modules for Razor files to be precompiled.
anyone have experience with this?
I did add that exact nuget package to all projects, and the error persists
Jean-Thierry Kéchichian
@jtkech
@Jus56288672_twitter you don't need to reference it as a package, you need to specify it as the project sdk by using the following line as the 1s line of your module / theme project file
<Project Sdk="Microsoft.NET.Sdk.Razor">
Ben Staley
@bastaley
@captmomo yes thats what i followed. I followed that tutorial, then added your overload and everything broke. Do you have a working example i could look at?
John Amarante
@jam88881
why is menu item I added Status Reports different from the other ones?
Capture.PNG
Jus
@Jus56288672_twitter
@jtkech thank you it works

whats the liquid equivilent to

<partial name="LoginMenu" />

Jus
@Jus56288672_twitter
to include a razor page partial into a liquid template i mean
Jean-Thierry Kéchichian
@jtkech
@jam88881 try to rather use a Link Menu Item as these are the ones whose shapes are well overriden in the agency theme
@Jus56288672_twitter so to render a partial mvc view, not a shape, i don't remember if we can do this through liquid, will try it as i have time ;)
Jean-Thierry Kéchichian
@jtkech

@Jus56288672_twitter so because somewhere a shape template file is rendered as a partial view, and because here the LoginMenu doesn't need any specific view model, just try the following that works

{% shape "LoginMenu" %}

But because it has to be discovered as a shape put the LoginMenu.cshtml directly under your theme views folder, not under a child Shared folder as done in TheTheme, to separate shape template file you can also use a Views/Items/... subfolder.

Then as soon as you use a razor view, you need the right sdk in your project file, you may need a _ViewImports.cshtml e.g. to add tag helpers, and if you not only use mvc tag helpers (e.g. our tag helpers), to make them working in prod your module / theme needs to reference the projects / packages that define these tag helpers, this because in prod we use precompiled razor views that are precompiled in the context of your module / theme.

Jus
@Jus56288672_twitter
Thank you that worked perfectly.
Larrem Panganiban
@larremp
Folks, we are postponing the July 11th Theming in OC Workshop. We are moving it to September 2020. Final dates are not set yet. We've sent a separate email to those of have signed up. Sorry for this change in schedule. We will keep you posted. Thanks.
captmomo
@captmomo

and if I use Liquid would it be

{{ Model.Content | shape_render }} for my example?

captmomo
@captmomo
            services.AddContentPart<DataTablePart>();
            services.AddScoped<IDataMigration, Migrations.Migrations>();
        public int Create()
        {
            _contentDefinitionManager.AlterPartDefinition(nameof(DataTablePart), part => part
            .WithDescription("Provides input field properties with additional extensions."));

            _contentDefinitionManager.AlterTypeDefinition($"DatatableWidget", type => type
                .WithPart("FormInputElementPart")
                .WithPart("FormElementPart")
                .WithPart(nameof(DataTablePart))
                .Stereotype("Widget"));
            return 1;
        }
what am I missing?
Also which namespace do I use for O@Orchard.LogConsole
captmomo
@captmomo
//controller
        public async Task<IActionResult> DisplayAsync(string jsonData)
        {
            var contentItem = await _contentManager.NewAsync("DatatableWidget");

            // Explicit syntax
            var testPart = contentItem.As<DataTablePart>();
            testPart.JsonData = jsonData;
            contentItem.Apply(testPart);


            return View(contentItem);
        }
//view
@model dynamic
@inject OrchardCore.ContentManagement.Display.IContentItemDisplayManager ContentItemDisplayManager


<div class="columns is-centered">
    <div class="column is-half">
        <div class="box">
            <div class="content">
                @{
                var item = await ContentItemDisplayManager.BuildDisplayAsync(Model.Content.DataTablePart, Model.BuildPartDisplayContext.Updater);
                await DisplayAsync(item);
                }
            </div>
        </div>
    </div>

</div>
captmomo
@captmomo
        public async Task<IActionResult> DisplayAsync(string jsonData)
        {
            var contentItem = await _contentManager.NewAsync("DatatableWidget");

            // Explicit syntax
            var testPart = contentItem.As<DataTablePart>();
            testPart.JsonData = jsonData;
            contentItem.Apply(testPart);
            var model = await _contentItemDisplayManager.BuildDisplayAsync(contentItem, _updateModelAccessor.ModelUpdater);
            return View(model);
        }
@using OrchardCore.ContentManagement
@using OrchardCore.Mvc.Utilities
@{
    ContentItem contentItem = Model.ContentItem;
    //Html.AddPageClassNames("preview", "detail-" + contentItem.ContentType.HtmlClassify());
}
@await DisplayAsync(contentItem)

then I get this

DatatableWidget (4ja56fkxmz24s2a5f3j5n36bxt)

lol at this point I'm really considering giving up

if I use @DisplayAsync(Model), I just get an empty widget body
Jus
@Jus56288672_twitter
Does anyone have a workflow for content approval / revisions that actually uses the CMS "New->" menu ? I already know about the IDesposable article, and that relies on being able to create the content as a custom POST request (PUT for revise) and that just doesn't work when using the CMS UI for content creation. Thank you in advance
captmomo
@captmomo
image.png
it works as expected when i use it in a form or page, but I want to use it dynamically. it seems that the best option is to just use the mvc approach
NRGadade
@NRGadade

Hello,

Can anybody help me here to explain the steps of Azure AD migration for ORCHARD CMS tool.
We tried with multiple ways with my existing application, But not getting the exact way-
From where and How to start to Azure AD migration for my old application?

Strongly need your help here........

Vitaly
@vitalybrandes

IndexProvider question
How can i setup index for array of content items id.
i have Enum with X values and for each of them i want to make the IndexProvider?

stuck with that ;-(
who can help me, pleeease

Jus
@Jus56288672_twitter
Does anyone have content approval / revision workflow that actually uses the CMS "New->[ContentType]" menu ? I already know about the IDesposable article, and that relies on being able to create the content as a custom POST request (PUT for revise) from a completely custom form and that just doesn't work when using the CMS UI for content creation.
Jus
@Jus56288672_twitter
I'm also trying to implement a Comments Section module as a ContentPart. Has anyone already written a Comments module or is there a guide for creating these custom modules?
Monti Design
@montidesign
Howdy, folks. I'm ready to tear what little hair I have left out. I'm trying to create layout alternates for discrete pages in my theme. I've read the documentation on alternates and tried to follow what I see prescribed there, but nothing appears to be working. I'm missing something. For example, the page that's serving as my home page I've named Homepage in the Manage Content area. The URL is set to domain.com/homepage. I've also designated this content item as the homepage on my site. But creating a /Views/Layout-homepage.cshtml in my theme does nothing.
Jus
@Jus56288672_twitter

Alright im working on my custom Comments API, decided to just make it an independent service instead of coupling it to orchard in any way. It'll just never happen.

**I am using a razor view in my modified BlogTheme as the comment section component, but I'll need to be able to gather the ContentItemId from whatever liquid template is rendering the CommentSection as a shape
So say in the Content-BlogPost.liquid, I am rendering the comment section (CommentsSection.cshtml) like {% shape "CommentsSection" %}
Is it possible to make CommentsSection aware of the BlogPost's ContentItemId?

Jean-Thierry Kéchichian
@jtkech
@Jus56288672_twitter just for the fun let me try something ;)
@using OrchardCore.ContentManagement.Routing
@inject IAutorouteEntries Entries

@{ 
    Entries.TryGetEntryByPath(Context.Request.Path.Value, out var entry);
}

Current content item id: @entry?.ContentItemId
Jus
@Jus56288672_twitter
@jtkech Wow that worked perfectly. Thank you. I don't understand this fully. We're querying the content management system for an item that has the Autoroute property based on the current URL? Does this still return the same ID if the URL changes?