Enable Clean Url in Drupal 8 Ubuntu

Enable mod_rewrite for Apache

a2enmod rewrite

Now edit the 000-default.conf located at /etc/apache2/sites-available/

Sudo gedit /etc/apache2/sites-available/000-default.conf

Add the below mentioned lines just under DocumentRoot /var/www/html

    DocumentRoot /var/www/html
    <Directory /var/www/html>
        AllowOverride All
        Order Allow,Deny
        Allow from all
    </Directory>

This will add AllowOverride within the default website configuration

Make sure .htaccess is in the default web directory!

ls /var/www/html/.htaccess

Using Rules to publish/unpublish based on a Date field in Drupal

At /admin/config/workflow/rules/components/add

Create a “Action set”:
Name = Unpublish Content
Variables:
Data type = Node
Label = Node
Machine name = node
-Continue-

Actions:
  Node > Unpublish content
  Data selector = node
  -Save-

At /admin/config/workflow/rules
Create a “rule”:
Name = Unpublish Rule
React on event = Node > After saving new content
Restrict by type = your content-type
-Save-

Conditions:
  Content is published
  Data selector = node
  -Save-

Actions:
  Schedule component evaluation
  Component Value = Unpublish Content
  Scheduled evaluation date data selector = node:field-your-node-date-field
  Identifier value = Unpublish content ID [node:nid] ([node:title]).
  Node Data selector = node
  -Save-


Create a vocabularies through Entity Api Drupal

To create a vocabulary named cuisine we would use the following code

$data = array(
'name' => 'Cuisine',
'machine_name' => 'cuisine',
'description' => 'Contains terms representing different cuisines.',
);
$entity = entity_create('taxonomy_vocabulary', $data);
$wrapper = entity_metadata_wrapper('taxonomy_vocabulary', $entity);
$wrapper->save();

Scale and crop image programmatically in Drupal 7

// Load image file entity.
$file = file_load($fid);

// Load image by uri.
$image = image_load($file->uri);

// Use Drupal's scale and crop function to do the work for you.
image_scale_and_crop($image, $scale['width'], $scale['height']);

// Save image to file, you don't need to save the file entity.
image_save($image);

5 key features to be excited about in Drupal 8

1. Manage your site’s content…from your phone. 
Anyone that’s ever administered a website knows that it’s best done while using a desktop or laptop. Much of the backend functionality simply doesn’t work, or doesn’t support mobile platforms. The Drupal 8 Mobile Initiative is a group effort to make Drupal 8 a great platform for tablets, smartphones and other mobile devices. Not only will administration go mobile but themes that are available for Drupal 8, will be responsive. This means a better experience for not only administrators, but also mobile visitors to your site.

2. Take your website around the world.
Drupal 7 supports multi-lingual functionality, but not at the level that Drupal 8 will. Imagine translating your site’s content to any one of the 110 different support languages. You’ll be able to not only translate a page’s content for a specific language, but also build views and determine what blocks should appear for that language. Translation updates will also be pushed to the site automatically to make sure your site has the latest dictionary.

3. HTML5 takes the stage. 
HTML5 is a big improvement over the current XHTML that Drupal 7 uses. HTML5 represents a giant step forward in how content is structured and presented on the web. As Dries Buytaert explains, “simply put, it (HTML 5) can provide a much better user experience on both desktop and mobile devices, and could lead to a convergence between native applications and the mobile web.”

4. Change the parameters for your views without a developer.
Views are a set of parameters which determine what content is shown on a page, what field
should be shown, in what order etc. In Drupal 7, the Views module is separate from Drupal Core and has a dependency on the CT Tools Suite. The VDC initiative has built Views into Drupal 8 core so it is available with a fresh install. This means better integration. Drupal 8 also promises to make the application of Views much easier, meaning site administrators can take control rather than relying on a more technical development team.

5. Less modules for faster page loads and reduced server load. 
Each time a page loads on a Drupal 7 site, all of the enabled modules are loaded as well
while Drupal determines which ones implement a required “hook”. Every module may not be needed for each page, and this can lead to longer load time while the user peruses the site. As part of the overall transition to the Symfony framework, Drupal 8 will load only the modules which a page needs, and not more. This will mean faster page loads for your visitors, as well as a likely decrease in the amount of run time memory required for smooth performance.

These are just a few of the many changes which are coming with Drupal 8. Lastly, for those of you who are on Drupal 6 or 7 now, have no fear; Drupal 8 will support content import tools to make your migration much more smooth.

– See more at: http://www.acquia.com/blog/5-key-features-be-excited-about-drupal-8#sthash.MJcY2eqn.dpuf