Copied to clipboard

Flag this post as spam?

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


  • Jorge Ribeiro 29 posts 213 karma points
    Oct 19, 2020 @ 11:33
    Jorge Ribeiro
    0

    Get content from external source

    Hi

    I have an umbraco CMS site and need to get some content from external SQL database. I guess I have to make a controller that will display data retrieved from external source, qhen the user navigates to that part of my site. So far so good.

    My only problem is that I need to make that data available in umbraco search. I already have implemented search, using Examine engine and Lucene queries, and it is configured to search content of several document types.

    How can I include data from other sources in that search?

    Pretty urgent this one...

    Best regards,

    Jorge

  • Michael Nielsen 82 posts 362 karma points
    Oct 19, 2020 @ 14:04
    Michael Nielsen
    0

    Hi Jorge

    You'll need to retrieve the external content from the external SQL database, and then put that into either the built-in external-index, or create a new index and use that.

    The docs should get you on your way on how to either extend existing, or setup a new index https://our.umbraco.com/documentation/reference/searching/examine/indexing/

    You could then also use the index for retrieving the content, so the only time you'll need to connect to the external SQL database, is when it needs to be indexed.

  • Jorge Ribeiro 29 posts 213 karma points
    Oct 26, 2020 @ 23:22
    Jorge Ribeiro
    0

    thanks for your reply Michael

    I've created the index and populate it with external data. so far so good...

    but now i really need to transform those results in "virtual" nodes in order to use them in my macros...

    let me explain better: i have a macro that receives a list of nodes (multinode picker) and renders them as cards in a grid. I now need to do the same but, instead of umbraco nodes, I need to create those "virtual" ones with data collected in the index and pass them to be rendered by my macro...

    I'm pretty sure I'm not doing thinks perfectly but its my first umbraco project.

    I build a set of macros to make our site fully customizable with layouts and macros wherever an whenever we feel like it. Today one grid here, the next day grid out and another macro in...

    This one renders a grid with cards made from common content extracted from nodes (title, image, and so on). Now I really need to incorporate the data retreived from external database, as if they were nodes fetched from umbraco db. Is this even possible? I think controllers could not help me here as they return views and I don't want the view just the node data.

    Can you please help me here? deadline next friday :(

    Thanks in advance

    Jorge

  • Jorge Ribeiro 29 posts 213 karma points
    Oct 29, 2020 @ 18:33
    Jorge Ribeiro
    100

    I found that its not possible... took me 2-3 days to change my all approach... Built several controllers and put the code that where in macros in my controllers. One of my controllers renders a card from data collected outside the site.

    So far so good...

Please Sign in or register to post replies

Write your reply to:

Draft