Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • muchiazumi 2 posts 72 karma points
    Oct 11, 2023 @ 09:14
    muchiazumi
    0

    Searching content in blocklist

    How to create a search examine function but the all the website contents are in BlockList?

    I have try many methods but it is still not functioning. I have created the models, services, controllers and view model but still unable to get the output. I am currently using Umbraco v10 and Visual Studio 2022.

    I am new to Umbraco and I'm hoping someone will guide me from A-Z. Your cooperation is muchly appreciated!

  • Huw Reddick 1932 posts 6722 karma points MVP 3x c-trib
    Oct 11, 2023 @ 10:42
  • muchiazumi 2 posts 72 karma points
    Oct 12, 2023 @ 02:45
    muchiazumi
    0

    i already follow the instructions however, I am confused with this part.

    private string SearchableText(BlockListModel blocklist) { var searchableText = new List

    foreach (var block in blocklist)
    {
        if(block.Content is CallToAction)
        {
            var typedBlock = block.Content as CallToAction;
            searchableText.Add(typedBlock.Text);
        }
    

    Based on the codes above, the "CallToAction" must be based on the generated modelsbuilder models (CallToAction.generated.cs) but mine is the normal builder which is (CallToAction.cs) . Is it still possible to get the output?

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies