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)

Stu Ratcliffe
@sturatcliffe
:+1: working now, not sure why it didn't work ebfore, I must have bodged something else somewhere
I can't get the tabs to change order though
{
    "TitlePart_Edit": [
        {
            "place": "Parts:0#Metadata;0",
            "contentType": [
                "Page"
            ]
        }
    ],
    "TextField_Edit": [
        {
            "differentiator": "Page-Description",
            "place": "Parts:1#Metadata;0"
        }
    ],
    "HtmlField_Edit": [
        {
            "differentiator": "Page-Herobanner",
            "place": "Parts:0#Content;1"
        }
    ]
}
should this result in a Metadata tab followed by the Content tab?
Dean Marcussen
@deanmarcussen
looks alright. you might have to place everything in the content tab for it work though
Stu Ratcliffe
@sturatcliffe
I think the SEO tab was also causing some weirdness, once I placed that the tabs rearranged properly
1 reply
Sotiris Roussos
@urbanit
@deanmarcussen I am getting this exception, after upgrading: Shape type 'ShortcodeModal' not found
Any ideas?
I had to enable shortcodes... Is there any dependency?
Dean Marcussen
@deanmarcussen
@urbanit if you've reenabled it, it's no problem to worry about. I just renamed it from ShortCode to Shortcode and something is case insentive and causes upgrade problems.
Jasmin Savard
@Skrypt
Enable the ShortcodeModal feature
That's because it should be enabled as a dependency to a module you have enabled.
Yeah or you could update the Type in the database in the features list
Sotiris Roussos
@urbanit
Thanx all, it is working. But, why should I have shortcodes enabled? I mean I definitely di ot in any case, but why it is required? Just for faq reasons...
Mike Paterson
@devlife
How can I call .As<BagPart>() for a named part? I seem to only ever get back null
Sébastien Ros
@sebastienros
@devlife a bagpart is named, so you will need an extra argument with the name of the bagpart
the .As method assumes there is a single part named as the part
7 replies
Jasmin Savard
@Skrypt
@urbanit It's used in Wysiwyg/Mardown editors mostly.
Probably admin templates too
Jason Daly
@JasonDa84754102_twitter
I've noticed that unless using the OC modified Bootstrap CSS file (bootstrap-oc.css) the FlowPsrt inner shspes render on top of eachother vs. Adhereing to the width constraints applied via the flow editor. This prevents some Bootstrap templates from being usable as the base theme (SBAmin 2 for example which isn't compatible with bootstrap-oc.css). Is there a known way of handling this?
jordy-nl
@jordy-nl
Hi, is it possible to add a title above a content part in a content type?
Dean Marcussen
@deanmarcussen
In the editor @jordy-nl or in the front end? In the editor just drag it above the part in the settings.
jordy-nl
@jordy-nl
@deanmarcussen Ah easy, thnxs :)
BJury
@BJury
I dont suppose anyone has been able to have two 'autoroutes' for a content item?
4 replies
Simon Novak
@snovak7
@deanmarcussen if you add a field/part on a menuitem it says "ContentItem_Thumbnail" shape not found
Orchard Skills
@OrchardSkills
@psijkof Hi Sijmen I have documentation on my Orchard Skills repository. I can share it with you.
Richard Garside
@NogginBox
How do you render a MenuPart?
Nic-84
@Nic-84
Hi! I have a strange issue. I am using Orchard for a website. I am using Razor pages to pull in the content items. I have three levels of page navigation. I have a level one razor page, level two, and level three. I am using the @page directive to pull in slugs like this: @page "/{Slug1}" or @page "//{Slug2}" or @page "///{Slug3}" and then: await Orchard.GetContentItemByHandleAsync($"alias:{Slug1 (or Slug2 or Slug3)}"). This seems to work perfectly for my content items and it pulls in the correct content. However, this seems to break all of my image file references. The site seems like it thinks that an image file is actually a content item. If I put a direct image file path in the URL it's using one of these Level One/Two/Three razor pages instead of displaying the image. Any ideas or suggestions on how to correct this?
Andrii Chebukin
@xperiandri
<Project Sdk="Microsoft.NET.Sdk.Web">

  <Import Project="..\OrchardCore\src\OrchardCore\OrchardCore.Application.Cms.Core.Targets\OrchardCore.Application.Cms.Core.Targets.targets" />
  <Import Project="..\OrchardCore\src\OrchardCore\OrchardCore.Application.Cms.Core.Targets\OrchardCore.Application.Cms.Core.Targets.props" />
  <Import Project="..\OrchardCore\src\OrchardCore\OrchardCore.Application.Targets\OrchardCore.Application.Targets.targets" />
  <Import Project="..\OrchardCore\src\OrchardCore.Build\OrchardCore.Commons.targets" />

  <PropertyGroup>
    <TargetFramework>net5.0</TargetFramework>
    <AssemblyName>SecretCircle.Cms</AssemblyName>
    <RootNamespace>SecretCircle.Cms</RootNamespace>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="5.0.0-rc.2.*" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\OrchardCore\src\OrchardCore\OrchardCore.Application.Cms.Targets\OrchardCore.Application.Cms.Targets.csproj" />
    <ProjectReference Include="..\OrchardCore\src\OrchardCore\OrchardCore.Logging.NLog\OrchardCore.Logging.NLog.csproj" />
    <ProjectReference Include="..\BmwTheme\BmwTheme.csproj" />
    <ProjectReference Include="..\BmwTheme.View\BmwTheme.View.csproj" />
  </ItemGroup>

</Project>
What do I do wrong?
App does not start at all
Added Orchard Core as submodule
Added all projects to solution
ibiza240
@ibiza240
image.png
Hi @sebastienros, this looked promising to me,
I tried the .As<> as follow: I defined a class MyContentItem with all the properties of a content item and then tried to use the .As<> with my type (see image above)
But then I get an error:
InvalidCastException: Unable to cast object of type 'OrchardCore.ContentManagement.ContentItem' to type 'MyModels.MyContentItem'.
Dean Marcussen
@deanmarcussen
@ibiza240 the .As<HtmlBodyPart>() is to extract a content part from a content item, it doesn't let you hard type a class to define the entirety of a content item.
ibiza240
@ibiza240
oh ok thanks @deanmarcussen
Sébastien Ros
@sebastienros
@deanmarcussen refresh my mind, how would one do that? With strongly typed classes and parts/fields in it, do we have a doc like this? "Class first content modeling" ...
@NogginBox there is a menu tag helper, or liquid tag. It's used in all themes we ship, in the layout, and require the name of the menu.
@Nic-84 sounds like a bug, can you file one? and a repro?
Dean Marcussen
@deanmarcussen
@sebastienros we have an issue for it, but the pr I did never got merged :( It's tricky, I tried it using castle proxies, to proxy it a ContentItem to another type of class, but there could be other ways. I actually just use nswag to generate dto's dynamically and cast them back and forth with json, which isn't ideal for performance, but can make life way easier
Sébastien Ros
@sebastienros
I thought it would just work oob, there was someone who showed us how to do it. And in theory it's just about deserializing the Data property of the content item to a class. So maybe we could even provide some extension methods to do it.
Dean Marcussen
@deanmarcussen
no, that only applies to ContentPart not ContentItem. The content item converter of any deserialization attempts to another class
if you try and do it directly. some extensions might achieve it. I liked my proxy class builder. no serialization costs, but the cost of a dynamic proxy
but the real goal might be to describe these content items via code, and have the code apply them into a code content definition (as well). otherwise you're dependant on someone not changing the definition in the ui. So fluent content modeling
Nic-84
@Nic-84
@sebastienros Where can I file a potential bug? Sorry, I am very new to Orchard and this Orchard Gitter forum. I am not exactly sure where all of the resources are. Thanks for checking in to my issue!
Jean-Philippe Tissot
@jptissot
@Nic-84 https://github.com/OrchardCMS/OrchardCore/issues create a new issue there
ibiza240
@ibiza240
is it possible to use app.UseCors() with app.UseOrchardCore()? I am getting Configure your application startup by adding app.UseCors() inside the call to Configure(..) in the application startup code. The call to app.UseAuthorization() must appear between app.UseRouting() and app.UseEndpoints(...). even though I added app.UseCors() and services.AddCors()
ibiza240
@ibiza240
Order seems important...The call to app.UseAuthorization() must appear between app.UseRouting() and app.UseEndpoints(...) Can I achieve that?