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)

Mark Clark
@daerogami
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?
Niraj Soni
@ns8482e
may be I misunderstood- Model.ContentItem.Content is json data of content item that you created from admin - are you asking how to remove element from it?
or you just want to filter certain element?
e,g `FlowPart.Widgets[0] is content item that you can use to build shape as @deanmarcussen suggested using BuildDisplay
or you can use contentitem tag helper
Mike Paterson
@devlife
Yes I think you are misunderstanding. I am using custom rendering for the portion of the json and do not want it to be included in the typical rendering pipeline.
I am asking how to remove an element from it. specifically an element in an array
Niraj Soni
@ns8482e
just hide it using "place":"-" in placement
Jasmin Savard
@Skrypt
I won't be able to join the meeting. My puppy has a veterinary appointment :dog:
Dean Marcussen
@deanmarcussen
You got a puppy? Why haven’t I seen pictures? (Hope he/she is ok)
Sébastien Ros
@sebastienros
btw it's now
Jasmin Savard
@Skrypt
well it's a dog now but that's always a puppy ain't it?
:smile:
She is fine. Just normal appointment.
881189-free-download-black-lab-wallpaper-1920x1200-image.jpg
For Dean :P
Dean Marcussen
@deanmarcussen
:heart:
Antoine Griffard
@agriffard
Now, we want a picture of Dean's cat.
Dean Marcussen
@deanmarcussen
image.jpg
Jasmin Savard
@Skrypt
A little tiger :smile:
pbull001
@pbull001
Going a little nuts!! To enable user registration - enable feature in admin and then .....~/Register ? Appreciate any pointers.
7 replies
Dean Marcussen
@deanmarcussen
there's a setting to turn on after... but don't really know what you're asking
pbull001
@pbull001
Going a little nuts!! To enable user registration - enable feature in admin and then .....~/Register ? Appreciate any pointers.
RTM - need to update settings under Security and then bobs your uncle. Been a long couple of days ... brain is a bit mushy...
Mike Alhayek
@MikeAlhayek
Anyone online can explain why this isn't working?
var response = new LoginResponse() { UserId = "abc", Token = "123" };
var user = await _userManager.FindByIdAsync(response.UserId) as User;
user.Put(response);
var storedResponse = user.As<LoginResponse>();
I am expecting storedResponse.Token to be "123" but instead its null. In fact, user.Has<LoginResponse>() returns false
Sébastien Ros
@sebastienros
Does it work if user is not a ContentItem?
Mike Alhayek
@MikeAlhayek
@sebastienros user is not a ContectItem. I am not using the CMS in this case. User is IEntity and has a Properties object that I should be able to add anything to it