https://discord.umbraco.com
Join Discord
[Solved] How to get an IMedia from a MediaPicker in a POC controller
c

Craig100

almost 2 years ago
Umb 10.6.1 In a controller, I'm deleting a content node and need to delete it's associated image held in a single image media picker. If I've got
var eventImage = eventItem.GetValue("eventImage")
giving me a key and a mediaKey as guids, I'm guessing that's the reference to the media picker. How do I get from there to an IMedia that I can use in mediaService.MoveToRecycleBin(IMedia, int32)? Thanks.
c
a
  • 2
  • 13
  • 184
Umbraco and Azure deployment slots
l

Luuk Peters (Proud Nerds)

9 months ago
Hi all, We're running multiple Umbraco 13 sites, but some sites take quite some time to boot. We've optimized as much as possible (like UsePagedSql to false, production runtime mode etc), but the NuCache takes some time to load on these larger sites in combination with our custom logic. I know Umbraco 15 will probably be a lot faster, but we want to use deployment slots for web apps in Azure to minimize downtime. By itself, deployment slots are not hard to understand, but the issue I'm having is that I'm uncertain what to do with the database. We're using SQL Databases in Azure and they are not part of the deployment slot. Umbraco or Umbraco form updates run migrations on the database that could potentially break the old Umbraco version that running in the active deployment slot. So in that case there is still downtime, which defeats the point of deployment slots. Anyone has experience with this in combination with Umbraco? Or with deployment slots in Azure in combination with databases in general? Thanks in advance!
l
k
+5
  • 7
  • 24
  • 181
MediaWithCrops does not contain a definition for URL
t

TigerMan

over 1 year ago
Hi I don't know what I'm doing wrong for a simple task. I created a composition with a property for an image. Select Media picker as the type. I create a home page which has a master page listed and all the properties data come through fine when I do @Model.PageName But as soon as I use @Model.PageImage.Url() Or .GetCropUrl("cropName") I get the error "MediaWithCrops does not contain a definition for GetCropUrl and no accessible extension method accepting a first argument of type 'MediaWithCrops' could be found. I've checked versions and all versions are the same for Umbraco 13 but I don't why this is happening?
t
s
  • 2
  • 1
  • 180
Headless preview in Core
a

Andrew McKaskill

9 months ago
I've been trying to get preview with NextJS working over the last day, and while I have seen Kenn's lovely post about how to get the NextJS side working, I can't for the life of me find anything about how to turn the "Save and Preview" button into something I can use that automatically opens the site and triggers the NextJS preview api. I tried searching for "preview" in the docs but it only produces the article about using ContentSendingNotification, which doesn't work in 14/15 anyway. Am I missing something or are we missing documentation somewhere? (In which case sounds like I need to write it up as a blog post once I've got it working ๐Ÿ˜ )
a
s
+3
  • 5
  • 11
  • 178
Session variables in server side- Umbraco 12
r

Ramya Devendiran

almost 2 years ago
I am working on COMPARE function in a product listing page. I created a UmbracoAPIController to maintain the session variables. I do a AJAXCALL to set, get and delete session variables. It is working fine in localhost. But it is not working in live website. Is my solution to use UmbracoAPIController correct? If not , please suggest an alternative solution.
r
r
+2
  • 4
  • 5
  • 178
AmbientContext error when trying to use ConentService within a Hangfire task
w

Wiggy

over 1 year ago
Has anyone come across this error before?
System.AggregateException: One or more errors occurred. (No AmbientContext was found.) ---> System.InvalidOperationException: No AmbientContext was found.    at Umbraco.Cms.Infrastructure.Scoping.AmbientScopeContextStack.Pop()    at Umbraco.Cms.Infrastructure.Scoping.ScopeProvider.PopAmbientScopeContext()    at Umbraco.Cms.Infrastructure.Scoping.Scope.<>c__DisplayClass100_0.<RobustExit>g__HandleScopeContext|2()    at Umbraco.Cms.Infrastructure.Scoping.Scope.TryFinally(Action[] actions)    --- End of inner exception stack trace ---    at Umbraco.Cms.Infrastructure.Scoping.Scope.TryFinally(Action[] actions)    at Umbraco.Cms.Infrastructure.Scoping.Scope.RobustExit(Boolean completed, Boolean onException)    at Umbraco.Cms.Infrastructure.Scoping.Scope.DisposeLastScope()    at Umbraco.Cms.Infrastructure.Scoping.Scope.Dispose()    at Umbraco.Cms.Infrastructure.Examine.ExamineUmbracoIndexingHandler.DeferedReIndexForContent.<>c__DisplayClass6_0.<Execute>b__0(CancellationToken cancellationToken)    at Umbraco.Cms.Infrastructure.HostedServices.QueuedHostedService.BackgroundProcessing(CancellationToken stoppingToken)
Trying to run a Hangfire task to update a node with the ContentService. Have tried a million things regarding scopes etc.
w
s
j
  • 3
  • 41
  • 177
Get CMS Culture
y

Yasein H. Burqan

over 1 year ago
How can I Get CMS Culture by code? I want to get the current language that is the user work in by C# like : if user work on English get English if user work on French get French ...etc ?
y
r
j
  • 3
  • 8
  • 176
[SOLVED] Multiple External Member Login Providers in .Net Core (v12)
a

andyc

about 2 years ago
I've been trying to get a v12 site working with multiple Azure AD accounts (something that's been running fine for years on v7) but I've hit a wall. Works fine with one and I can trigger the SSO process for more than one but the postback from the provider always fails for any provider but the first one. I suspect this is something to do registering the schemes in a certain way but can't find any helpful documentation. I know this is possible I just seem to be missing something. Among other things, I've tried adding multiple
builder.AddMemberExternalLogins()
and also multiple
memberAuthenticationBuilder.AddOpenIdConnect
within that and they both throw
Exception: Unable to unprotect the message.State
Any ideas?
a
d
  • 2
  • 9
  • 175
[SOLVED] Implementing forgot password in login screen in v13
b

Bishal Tim

about 1 year ago
i want to implement a forget password feature in umbraco login screen.im thinking i need to setup a middleware? but dont know where to start https://cdn.discordapp.com/attachments/1260274650613813299/1260275557162156082/Screenshot_2024-07-09_222311.png?ex=668eba93&is=668d6913&hm=6ab838ca4ce55ed590dfb0106c599848e1a69313e9015213a4f22180f05614d1&
b
m
+6
  • 8
  • 49
  • 174
How do i authenticate to the Content Delivery API with Swagger or Postman
n

Navorski

over 1 year ago
Can someone help me on my way? I created an API, an UmbracoApiController, with the [UmbracoMemberAuthorize] attribute. I Configured swagger to be able to authorize Everything seems to be in place and to work. But how do i authenticate with Swagger, or with Postman, or whatever? when i go to https://localhost/umbraco/swagger, i can see the swagger api, and when i want to authenticate, i have to fill in a client_id and a client_secret. But i have no idea where to get those? https://cdn.discordapp.com/attachments/1242595241077375058/1242595241219850310/image.png?ex=664e687f&is=664d16ff&hm=725f3c4adc068b9f71b6a1a0688cf566f11aabbd9de24c86de6bb9a52b3f319d&
n
d
+2
  • 4
  • 8
  • 174
Previous111213Next

Umbraco

A hub and casual space for you to interact with fellow community members and learn more about Umbraco!

Powered by