Fb like share box in drupal website - drupal

I am making a drupal website and have a content type "quotation". The standard way of taking input in drupal is going to the create content in the menu which is not very user friendly considering your normal user.
I want to have an option to create content (i.e quotation) like in facebook, twitter or any other social networking site. A share box where someone can type in his status and can directly create content.
Also, I have two vocabularies associated with my content type and I want to accommodate them as well while using minimum space. So, how should I go about the problem.
Is there any module in Drupal which can help me in doing so or I have to write Jquery code myself.

two vocabularies associated with my
content type and I want to accommodate
them as well while using minimum
space.
Lol, sounds tough. If you want to use minimal space you'll need to simplify the workflow, ie, remove a vocabulary or 2.
You can also do something like this:
$('#node-edit').focus(function (){
// set your node form vocab to display:none and then show them when user actually uses the form
$('.vocab-wrappers').show();
// set your node form buttons to display:none and then show them when user actually uses the form
$('#node-form buttons').show();
});
To hide the vocabularies/buttons until the user is editing the content.
To get a facebook like effect, I suggest you use: http://drupal.org/project/formblock
This should get you the form and the ability to place it anywhere.
You can use form alter to hide certain parts of the form, or a form alter module, there's various options if you look in drupal modules.
http://drupal.org/project/nodeformcols
You also want http://drupal.org/project/auto_nodetitle to make the title optional, and hidden from the form.
Lastly, theme the node form in CSS/JS, making the texarea smaller and whatever other stuff you would like, recommend setting display:none on the field labels.
This should give you the correct idea for making a decent facebook-like form setup.

This should be possible:
http://drupal.org/node/464906
I've never tried it myself though.

Related

How to "separate" image uploads while using multiupload image field

My client has a bizarre request which is making it difficult to build a slideshow on profile2 pages: The profile2 pages require 4 photos to be uploaded, and he does not believe that the users adding content to the site will "get" the multi-select method found in most file upload modules. The Field Slideshow module only works if you're using multiupload (which of course makes sense), and that's how I had it set up initially - which worked perfectly. I've tried using the field collection module, then creating a Slideshow view, but the image fields in the field collection field aren't being seen as a group. I think I had to select one of the 4 image fields to use instead of all 4. Any ideas?
he does not believe that the users adding content to the site will "get" the multi-select method found in most file upload modules
This hardly makes sense, I guess you tried to explain things to your client ?
Assuming you have several image fields on your content type, you could build a view which create a list (unformatted or HTML list) of these fields, maybe using a global field rewriting (you add all your image fields, exclude them from display, custom their display by removing field wrapper and field+label wrapper (in order to get only ), add a global text field in which you include image fields token), and then create your slideshow in a custom javascript file, using whatever library you like (Cycle2 is great).
Your global text field would look like :
<div class="wrapper cycle-slideshow">
[field_image]
[field_image_1]
...
</div>
(with cycle2 adding a cycle-slideshow class will initialize your slideshow)
...but you need token to do so.
I often find it more convenient to setup javascript things like that (slideshows, gmaps...) by myself instead of using views integration.
Hope I understood your issue correctly, good luke with this.
For every (custom) field you have option "Number of values" which you can set to fixed amount (i.e. 4) or unlimited. Can you use that?
Easier: Use Rules. Create an additonal (fifth) image field (multivalued) that will be the one consuming the slideshow. Create a new Rule, triggered on creation or update of your content with 4 actions: each one adding the content of one of the fields to the multivalued field list. You probably need to avoid showing that field but that depends on what are you using to display, so hide it using display suite or just not using it in the content template. This way, you show your users your 4 fields but makes the slideshow work based on a computing of the user inputs.

Different pages for showing different fields of a single node in Drupal 7

Is it possible to elegantly do this? The idea is, a node of content type "project" has a lot of fields, its url is something like node/5. I want to show some of the fields on that page, and others on node/5/extra, kind of an "extended" page that the user only loads if he is interested in that content (lots of images, in my case, that would slow down the main node page considerably).
I tried the Display suite module, unsuccessfully (it seems it's not really meant for doing what I want). I also saw this blog post, which explains how to add a custom display mode to a content type (other than the Default and Teaser ones that come by default), but I can't get it to work the way I want to either.
I guess you could create a view having the node ID as a default argument from URL. Then you can choose which fields to show or hide

How to display blocks of text in drupal?

I'm trying to build a module that lets users with a certain role post messages that will be displayed for users with a different role. I'd like this to simply be one module that handles both these things, however, the furthest I've gotten is setting up the form to post messages.
I'd like to show the posted messages on the same page as the input form (and hide the form for the unauthorised users), but I just can't figure out what I have to do to show the messages. How hard can it be to display some simple text?
So far I've added an item to the menu that links to the page with a form on it.
You could make use of the boxes module to have online editing of this text that other users will see. If you're set on Using your custom Form you could put your text in a block.
The Content Access module will let you restrict view permission for a given content type to users having a certain role.
For setting up the layout, you might want to put the posted messages in a block or use Panels.

drupal replacing default nodes with views page

I have created a page view using field style to display a list of teasers as I want. fields configuration in views allows us to link the field to it's node. but what if we have created view for node detail page and want field to link to it's relevant view.
I had the same question, and after a bit of research this is what I've concluded:
The views module isn't intended to replace a default node view. I say this because of the level of difficulty involved in doing this and the lack of information on how to accomplish this. Ryan Weal has posted a way to accomplish this by editing your node template that doesn't look too difficult to accomplish, and here is the link.
However, it seems that a more popular solution, especially if you are like me and don't like to get into editing theme files. You can use the Display Suite module to effectively reformat the default node content as you would like.
I'm not sure if I understand you properly, but it sounds like you are wanting to display a view in a page view of a node?
In order to do this, you could:
create a small module, using hook_nodeapi() or one of the D7 replacements for this function in order to insert the output of the embedded view into this page's content, by conditionally adding a $content element when the node is of the appropriate id
or (easier, but requires allowing input type PHP) embed the view right on the page.
http://thedrupalblog.com/embedding-view-drupal-6-using-views-embed-view for information on embedding views

Drupal: Content in blocks from node_reference fields?

After only a few weeks of working with Drupal I've come up with a recurring problem, which I don't really have an optimal solution to, so I'm hoping that someone here might be able to give some best practice pointers.
What I have is a region inside my node.tpl.php, which is populated with blocks that display content from two different CCK fields of the type node_reference. This works fine when displaying a single node. The problem appears when I need to use a view.
For example, lets say I have a news listing, and a single news item view. When I display the single news item I can use the news node node_reference field to reference whatever material I would like to have in my sidebar, but when on the news listing view I would like to reference nodes separately. What would be the best practice to solve this?
I'm having a few ideas, but none seem like the logical choice, how would you do?
My understanding of your problem is that you don't want the blocks to display on the view page and you want the block information displayed inline with the node.
The first part is easy, you can modify the block visibility settings to not show up on the path where you have the view.
The second part will depend on how you set up your view. If you are using fields you can simply add fields for the node_reference and they should display. If you are using a node view, you will have to override the template and create a template which displays the node reference field.
If you want further explanation please comment and I can clarify
After reading my question I realize that it was explained pretty badly, so I'll try again, and also tell how I solved it.
The Problem
On normal "pages" (when displaying only a single node), I have a sidebar that shows something similar to banners, which are either random, or I can select one or many that should always be displayed on the sidebar. This is solved easily when displaying a single node, using a CCK node_reference field. The problem is when using a View that displays multiple nodes, for example a news listing-
The Solution
In my case I could solve this by creating additional fields on my default Page content-type. These fields were called view, display and arguments. In my tpl.php I then embedded the news listing view inside a page, lets call it News. This way I gained great flexibility, and also helps the News page to know where it is located in menu structure.
Final comments
I have yet to discover if there are any drawbacks or dangers in doing this way, but if there are, feel free to share them with me :)
I tend to want to create my own modules, which create blocks and reference the database directly. Then I put the blocks inside of panels, this seems to be more flexible for me than using views and cck fields etc ...

Resources