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?
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.
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.
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:
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?
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.
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.
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
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.
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:
Remember to change the path to your css file with the styles.
If you want to use inline styling you use this way:
I hope this makes some kind of sense, and helps you further.
/Dennis
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.
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
Good point about separating data from layout. I think i will go with the REST api.
is working on a reply...