Drupal: storing images and other module data - image

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

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.

How to populate image thumbnails (image grid) on my web page using JSP

I wants to populate image thumbnails (image grid) on my web page using JSP. Please suggest the best way. Also please suggest what should I store in the DB, image in binary format or path of the image in text format ?
The correct answer would be It depends on your project requirements
I would like to write my experience, if the images had to be prevented from un-authorized access then database would be a good option, but ASAIK I haven't developed any such application in past 3 years. I would just prefer putting up the images in a folder and then have their name in DB for reference purposes.
I just thing database has more important information to store & retrieve and I don't want to choke the database connections retrieving images.

Docpad design considerations

I'm coming from a php/mysql background. I'm most familiar with the Kohana PHP framework and I'm trying to learn Docpad. I have a loose understand at this point and I've built out my first website and blog. Static content makes a lot of sense to me on Docpad.
I'm working on my photography site where I want to be able to upload new images to a portfolio. The backend needs to handle an uploaded high-resolution image and create several different copies at different resolutions of the image. My biggest question is how do I keep track of the image meta data that I want to display? Do I generate a physical file for each image that has all the particulars I want to track and use those files as my searchable database, much like how blog posts are setup?
Or should I go the route of using something like MongoDB to store image data there where it can be queried and plugged into a layout?
Regarding handling POST or GET data, should I be reading up on the express.js docs? I'm not really sure where to turn for that.
Wordpress uses TimThumb to re-size it's images: How does WordPress.com resize images dynamically?
Then there is this re-sizing library for node: node package for file attachments and image resizing
If you wanted to created like 3 different image sizes and use the backbone collection in DocPad, then you'd add your different re-sized images to those three different collections/folders. For access the images you might just be able to do it via it's file name. So when you copy, re-size and rename the image, in the rename step, concat the image size at the end, like: coolPhoto-med.jpg and then you could just do hard links to get to the image like /spring-collection/med/coolPhoto-med.jpg or you could use query engine to access them.
The file model has a meta attribute: https://github.com/bevry/docpad/blob/master/src/lib/models/file.coffee#L17
I've yet to learn how to use it yet though.
I know we chatted yesterday on #docpad IRC but I just wanted to answer you here too. If you do code something that re-sizes images for DocPad, please do consider putting it up on Github to share with the community.

Joomla store files in database

I am using Joomla 2.5
I want to store user uploaded content (like images or general files) in the database instead of in the server.
Is there any existing setting which can be used to do this by default?
Note: I am interested in the user uploaded files. Joomla's own files can stay on the server or on in the database, either is fine by me.
The database doesn't store things like images, its stored information. Images and so on are always stored on the server. The only thing you could do is once an image is uploaded to the server, it stored information about it such as the format, dimensions etc in the database. Would be a good idea to use a gallery such as Phoca Gallery or JoomGallery. More can be found here.
If you are looking for a general file uploader then feel free to use my SWFUpload Component which is only for uploading in the admin backend however is a very simple component therefore will be easy to integrate into other components should you need to.

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.

Resources