Copied to clipboard

Flag this post as spam?

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


  • Magnus Söderlund 19 posts 79 karma points
    Nov 15, 2013 @ 09:57
    Magnus Söderlund
    0

    Embedding Umbraco?

    Hello.

    I've just begun working with .net, web and Umbraco. My main area has been iOS until now. Im curious about a specific case ive stumbled upon, more specifically if this is actually doable, if there is a better way recommended for these kinds of problems etc.

     

    Lets say i wanted to use Umbraco and setup templates etc. for adding books to a book collection. I want to create a nice looking search-functionality as the only front end point of entrance for regular users. Textstring search, filters of different kinds etc. using Examine. Meanwhile still using the normal admin interface to add new books and edit existing ones.

    So far so good if i understand things correctly right?

    Lets say i wanted to embed this search-page on a totally different webpage somewere else. This would be possible in a set of ways ranging from using the iframe tag to embed tag right? With the search functionality working and everything running smoothly.

    Is there a way if i embed a page like this to also use a custom CSS file for the search-page? Nothing more fancy then changing colors or something like that?

     

    Thank you in advance.

  • Ismail Mayat 4511 posts 10091 karma points MVP 2x admin c-trib
    Nov 15, 2013 @ 10:08
    Ismail Mayat
    1

    Magnus,

    Why use iframe? What you could do is expose the search using webapi so you could then call it using ajax via jquery etc.

    Not to long ago we worked on a site where we were using the umbraco backend to create data nodes it was for company that is an umbrella for dental practices. So the data to be provided to over 200 dental practices was to be stored in this one Umbraco instance and they would pull in the data via jquery calls to webapi. It all worked very nicely. Take a look at webapi (http://www.asp.net/web-api) and umbraco webapi (http://our.umbraco.org/documentation/Reference/WebApi/) to see how to wrap your search functionality which would still be examine.

    Regards

    Ismail

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Nov 15, 2013 @ 10:18
    Dennis Aaen
    0

    Hi Magnus and welcome to Our,

    You could do it by using an iFrame, and i the file that contains the content for the iFrame you could add a reference to an external stylesheet or use inline styles.

    <iframe name='iframe1' id="iframe1" src="empty.htm" width="300" height="300" frameborder="0" border="0" cellspacing="0"></iframe>

    So in the example above the content to the iFrame is located in a file named empty.htm. In this file you could add a external stylesheet or use inline styles. If you want you use external stylesheet use this:

    <html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <link rel="stylesheet" type="text/css" href="mystyle.css">
    </body>
    </html>

    Remember to change the path to your css file with the styles.

    If you want to use inline styling you use this way:

    <html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <style type="text/css">
       <!-- Add your css selectors here  -->
        </style>
    </body>
    </html>

    I hope this makes some kind of sense, and helps you further.

    /Dennis

  • Magnus Söderlund 19 posts 79 karma points
    Nov 18, 2013 @ 12:38
    Magnus Söderlund
    0

    Thank you for two good and quick responses. 

    Ismail:

    One reason is that i would like to take advantage of the tools in Umbraco. It seems to me (after some fiddeling about with Umbraco) that i can easily create markup, search result pages etc. using the Document Type properties that i would either way setup for administrators to be able to add new content (or edit existing content).

    Ive been messing around a bit with the REST api and it does seem like an easy solution as well but for instance if i added an image property to my content nodes, examine search results would only return an ID to that media file and i would have to construct the URL's my self when displaying search results if i'd ever want to show the images, correct?

    What are the pro's and con's for using REST vs embedd an Umbraco page in this case?

    Thank you both again. 

  • Ismail Mayat 4511 posts 10091 karma points MVP 2x admin c-trib
    Nov 19, 2013 @ 09:27
    Ismail Mayat
    0

    Magnus,

    With regards to image ids. In the exmaine index you will have id. However you can implement gathering node event and then inject into the index the full path of the image with host name and then you can return that back so you get image being displayed.

    I guess the advantage of using the rest service is you return back json and you can then in your client format however you like, also any future potential clients / websites etc can also make use of the service and again format however they like in fact it does not even need to be a website as a client, could be windows app, mobile app etc etc with webapi you have separated data from layout which is a good thing.

    Regards

    Ismail

  • Magnus Söderlund 19 posts 79 karma points
    Nov 19, 2013 @ 09:51
    Magnus Söderlund
    0

    Good point about separating data from layout. I think i will go with the REST api.

Please Sign in or register to post replies

Write your reply to:

Draft