Access Umbraco 7 Content from UmbracoApiController - umbraco7

I have some trouble accessing Umbraco 7 Content from a UmbracoApiController.
This is my ApiController, with sample data, and i want to get real data from the Umbraco Content. How can i access the Umbraco Content?
This is how my Content is structured.
The solution if further readers would like to know, with help from http://creativewebspecialist.co.uk/2013/07/16/why-i-think-your-doing-it-wrong-umbraco-alttemplate-data-views/comment-page-1/

You can access it using Umbracos Content Service.
Services.ContentService.GetById(nodeId);
You can access the media nodes in a similar way using the MediaService. Hope this helps.

Related

How to add search to my static laravel site?

I'm building my first ever website using laravel 5.2. Right now, I'm only serving static content with a few API requests for things like the current weather. I've never built a website before, but I'm running my own droplet at DO, so there's no shared hosting limitations.
How would I implement a search that allows users to search my site's content from the main screen? Currently there's no interaction on a DB, it's all just Blade/HTML. I want to avoid using Google Custom Search as there should be no ads, and I want to learn along the way.
Please advise.
It depend on the amount of static contents you have in your site. Maybe you could try implementing it the following way.
Create lookup of the views pages with the most relevant keywords
When user search for keyword which match to any of my relevant keywords, I would load the respective view page.
I would store the the lookup in json format. It would be similar to contents with multiple tags on them.
Here, creating json file is going to be tedious and needs to be done manually.

MVC 3 working with images

I'm trying to save images locally and retrieve them to my view. My problem is that i'm really new to MVC and all that I've tried doesn't seem to work.. If there are sites, samples or code snippets that work with locally stored images please feel free to pass on the knowledge...
Thank you
Start out with HttpContext.Server.MapPath("/") in your Controller to get the folder that you are currently working in. Watch where that gives you, and adjust accordingly if you want to maintain any sort of organization.

How to ensure ajax content hosted on S3 gets indexed?

I have a number of sites that are completely hosted on Amazon S3 but the page is generated via JavaScript. I would like to make sure these sites are indexed by Google, but since they are hosted on S3 I don't seem to have a mechanism to serve up _escaped_fragment_ versions of the page. Does anyone have an idea on how I could get the Ajax content indexed? I would prefer to not have to replicate my templating server side.
Here is an example of one of my sites:
http://www.web608.org/
There is no real easy way to do this. I'd suggest you read Google's recommendations on this topic:
https://developers.google.com/webmasters/ajax-crawling/
The best practice I have seen is progressive enhancement. Create a working page in plain html and then use JavaScript to make it cool.

Is it possible to display and search data using orchard cms from an external datasource?

I'm just starting to play around with Orchard CMS. I like what I see so far, but I need to be able to create pages that display record details for data stored in another system. Does any one know if that is possible?
I have a SQL Server database that hold real estate property record information. This information gets displayed on the web. On that same website are informational content pages (FAQs, Contact Us, Home, etc...) What I would like to to is leverage the CMS portion of Orchard for the content pages. Then I would like to write a module using the Orchard that would get the real estate info, allow users to search parcels, and display detail pages for each parcel.
If you view the site http://www.sc-pa.com/search you can search by last name "smith" and select one record. That may help illustrate what I need Orchard to do.
Yes, that is possible, but your scenario is way too vague to get into any specifics. Can you elaborate on exactly what you are trying to do: what does the external data look like, where is it stored, how do you want to integrate it into Orchard, do you need any integration with content types and parts, or with search, etc.
One alternative is to expose ur data as web service or odata endpoint and then use jquery to do asynch call to get json data. Then ur home free.
Create a page and put the javascript in that or include a ref to js file.

Drupal: storing images and other module data

Suppose we have a module that displays tables of employees. Each employee has a photo. What is the best way to store this photos and display them?
I mean, is there some kind of content repository in drupal? I don't want to do this manually, maybe there is an API that can store images and then generate links to them and so on.
Thanks.
The Content Construction Kit(CCK) / Fields in core is what you want to explore.
Using CCK you can attach an image, a number field, a file, some text, a reference to content, etc to another piece of content.
In Drupal 7 you can add fields to any entity (Content, User...your custom one(Employee)), in Drupal 6 you might want to explore Content Profile
Further Reading:
http://drupal.org/node/717120
There is a kind of content repository in Drupal: both in the database and as storage (disk).
The API for that is documented in a special File upload section.
If you want inspiration, the core module called upload.module can serve as example. But be aware that Drupal core, for several reasons, is far from the best and cleanest examples to learn from.
What you are looking for is CCK module with file-field and image-field modules for handling the image upload action.
And for the display of those uploaded images you should use Image-cache

Resources