LinenBot
09/21/2023, 11:19 AMMuhammadFayed
joined #help-with-umbraco.codesharepaul
09/20/2023, 9:24 AMCorné Hoskam
09/20/2023, 7:03 AMcraig100
09/19/2023, 2:41 PMjulietter6413
09/19/2023, 1:17 PMais6192
09/19/2023, 12:30 PMwebjaved
09/19/2023, 9:42 AMjeroenvisschers
09/19/2023, 8:57 AMryanhelmn
09/18/2023, 6:31 PMholm76
09/18/2023, 9:34 AMBjarne Fyrstenborg
09/18/2023, 9:14 AM[RuntimeLevel(MinLevel = RuntimeLevel.Run)]
//[ComposeBefore(typeof(Something))]
public class SubscribeToEditorModelEventsComposer: ComponentComposer<SubscribeToEditorModelEvents>
{
// This automatically adds the component to the Components collection of the Umbraco composition
}
public class SubscribeToEditorModelEvents : IComponent
{
// Initialize: runs once when Umbraco starts
public void Initialize()
{
MemberService.Saving += MemberService_Saving;
}
// Terminate: runs once when Umbraco stops
public void Terminate()
{
// Unsubscribe during shutdown
MemberService.Saving -= MemberService_Saving;
}
private void MemberService_Saving(IMemberService sender, SaveEventArgs<IMember> e)
{
foreach (var member in e.SavedEntities)
{
if (member.Id > 0)
return;
if (string.IsNullOrEmpty(member.Username) || string.IsNullOrEmpty(member.Email))
{
e.Messages.Add(new EventMessage("Error", "Remember to fill username and email.", EventMessageType.Error));
}
}
}
}
aultako
09/18/2023, 8:34 AM@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockGridItem<elementClass>>
SteveV
09/16/2023, 4:22 PMbishaltim
09/15/2023, 2:34 PMpascaleugster
09/15/2023, 11:32 AMrichhamilton
09/15/2023, 10:47 AMmistyn8
09/15/2023, 8:37 AMdeanleigh
09/15/2023, 6:29 AMAn error occurred during the compilation of a resource required to process this request. Please review the following specific error details and modify your source code appropriately.
Generated Code
One or more compilation references may be missing. If you're seeing this in a published application, set 'CopyRefAssembliesToPublishDirectory' to true in your project file to ensure files in the refs directory are published.
The type or namespace name 'Home' does not exist in the namespace 'Umbraco.Cms.Web.Common.PublishedModels' (are you missing an assembly reference?)
+
public class Views_Home : Umbraco.Cms.Web.Common.Views.UmbracoViewPage<ContentModels.Home>
I have added:
<!-- Referenced assemblies (DLLs) will be copied to the publish directory when you build and publish your Umbraco project -->
<CopyReferencedAssembliesToPublishDirectory>true</CopyReferencedAssembliesToPublishDirectory>
As instructed by the error message but I still get the same error.
A full import in Usync then a Rebuild (not a build) fixes it.
How can I prevent this in teh first place?Matt Wise
09/14/2023, 4:50 PMjeehaw75
09/14/2023, 3:46 PMsiempresteve
09/14/2023, 2:42 PMpascaleugster
09/14/2023, 1:36 PMhtml
<form method="get" action="@Url.Action("SearchPageQuery", "SearchPage")">
<div class="searchBar input-group mb-3">
<input id="search" name="search" type="text" class="form-control border-0" placeholder="Suche..." aria-describedby="button-submit">
<button class="btn btn-outline-secondary border-0" type="submit" id="button-submit"><i class="fas fa-search"></i></button>
</div>
</form>
Now i want my searchbar to redirect to my searchPage when clicking on the bar oder hitting enter.
I have a render controller for the searchpage. But my problem is that the rendercontroller function does not get hit and i dont know why...
cs
public IActionResult SearchPageQuery()
{
SearchPageViewModel viewModel = null;
if (!String.IsNullOrWhiteSpace("search"))
{
viewModel = ExecuteSearch("search", 1);
}
return CurrentTemplate(viewModel ?? GetDefaultViewModel());
}
Ive also tried it with a index function and the parameters....>
cs
[HttpGet]
public IActionResult Index([FromQuery(Name = "query")] string query, [FromQuery(Name = "page")] int page)
{
SearchPageViewModel viewModel = null;
if (!String.IsNullOrWhiteSpace(query))
{
viewModel = ExecuteSearch(query, page);
}
return CurrentTemplate(viewModel ?? GetDefaultViewModel());
}
JigitalCharlie
09/14/2023, 1:16 PMrichhamilton
09/14/2023, 8:52 AMRoy Berris
09/14/2023, 8:08 AMthrobbertm
09/14/2023, 8:08 AMbishaltim
09/14/2023, 3:32 AM