Full Trust European Hosting

BLOG about Full Trust Hosting and Its Technology - Dedicated to European Windows Hosting Customer

Drupal 7 with Free ASP.NET Hosting - HostForLIFE.eu :: How to Create Your Own Drupal 7 Theme

clock June 1, 2015 07:09 by author Rebecca

Like other CMS platforms, Drupal allows us to create custom themes and templates. In this tutorial, you’re going to learn how to create a new theme and defining or configuring a theme in Drupal 7.

Theme Structure

To define a new theme in Drupal 7, you need to create folders and files according to Drupal’s rule.

So, we start by create the following folders:

Go to root folder of Drupal > Sites > All > Theme and create theme folders as below:

  • mytheme is the folder that contains themes and can be renamed to your theme’s name.
  • mytheme.info is file used to define theme name, version, core ,css, javascript.
  • screenshot.png is thumbnail of theme, which is showed in theme management section.

Defining theme using .info file

The .info file is a static text file for defining and configuring a theme. Each line in the .info file is a key-value pair with the key on the left and the value on the right, with an “equals sign” between them (eg:   name = my_theme ).

Now, open mytheme.info and start defining:

Theme name (required):

name = mytheme

Description:

description = tutorialdrupal.com how to create and define drupal theme

Theme version

version = 0.1

Core drupal

core = 7.x

Engine

engine = phptemplate

Screenshot

screenshot = screenshot.png

After finishing, we will have a new .info  file like this:
name = mytheme
description = tutorialdrupal.com how to create and define drupal theme
version = 0.1
core = 7.x
engine = phptemplate
screenshot = screenshot.png

Now save the file, go to theme management section, you will see the new theme you’ve just created:

Defining Drupal website’s regions

Region is section for showing Drupal website’s blocks. Regions are defined as follows:

regions[header] = Header
regions[highlighted] = Highlighted
regions[help] = Help
regions[content] = Content
regions[sidebar_first] = Left sidebar
regions[sidebar_second] = Right sidebar
regions[footer] = Footer

After you’re done, save the file and click on “enable and set default” to set this theme as default theme. Now go to Structure -> Block, you will see the new defined regions:

1. Include css file

stylesheets[all][] = style.css
stylesheets[print][] = print.css

2. Include javascript file

scripts[] = myscript.js

So, you’ve just created a new theme in Drupal 7. It's not a difficult task, right?

Drupal CMS with Free ASP.NET Hosting
Try our Drupal CMS with Free ASP.NET Hosting today and your account will be setup soon! You can also take advantage of our Windows & ASP.NET Hosting support with Unlimited Domain, Unlimited Bandwidth, Unlimited Disk Space, etc. You will not be charged a cent for trying our service for the next 3 days. Once your trial period is complete, you decide whether you'd like to continue.



Drupal CMS with Free ASP.NET Hosting - HostForLIFE.eu :: Fixing Drupal Fatal Error "Allowed memory size of A bytes exhausted (tried to allocate B bytes)"

clock April 24, 2015 07:30 by author Rebecca

Sometimes when working with Drupal, you suddenly see this error: 
Allowed memory size of A bytes exhausted (tried to allocate B bytes)
or

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 3669969 bytes) in ../public_html/includes/theme.inc on line 1987

How to handle this error? That error message tells you that Drupal needed more memory than PHP was allowed to give it. In this article, I will explain to you 3 methods to increase PHP memory size, pick one that you like:

1. Fix the error in Drupal 6/7 using php.ini file

You will probably see this error message when you install new modules/themes. By default, Drupal 6/7 allocates 64M (megabytes) of memory on your website and so, to fix this issue you need to increase memory limit to higher value (128MB is fine).

Here is the solution:

1. Connect to your Drupal web hosting using SSH/FTP connection

2. Check if there’s php.ini  file in root folder of your hosting

3. If it’s existing, open the file with text editor (notepad) and add the value  php_value memory_limit = "128M"

4. If there’s no  php.ini file in root folder, then you need to create one. Use notepate, wordpad or whatever can edit and save text file as .ini  file add the value  php_value memory_limit = "128M"

5. Save the file if check the error’s gone

(Note: remember to save file with name: php.ini, not php.ini.txt)

2. Increase PHP memory using .httaccess

Edit the .htaccess file in the Drupal root directory. Look for the section:

Override PHP settings. More in sites/default/settings.php

But the following cannot be changed at runtime

Now add the following line:
php_value memory_limit 64M
This method will only work if PHP is running as an Apache module.

3. Using settings.php

If Drupal is already installed, you can edit sites/default/settings.php. This method will affect only the site using this file.
Locate the PHP settings section and add the following line at the end of that section:
ini_set('memory_limit', '64M');

That’s all for today, hope you will solve this issue immediately after reading this!

Drupal CMS with Free ASP.NET Hosting
Try our Drupal CMS with Free ASP.NET Hosting today and your account will be setup soon! You can also take advantage of our Windows & ASP.NET Hosting support with Unlimited Domain, Unlimited Bandwidth, Unlimited Disk Space, etc. You will not be charged a cent for trying our service for the next 3 days. Once your trial period is complete, you decide whether you'd like to continue.



Drupal 7.3 Hosting UK - HostForLIFE.eu :: Using Drupal Feeds Module to Import Images

clock December 4, 2014 05:12 by author Peter

Importing text content utilizing Drupal feeds module is simple. Importing images utilizing feeds is simple as well however it needs a little function and it's not as straightforward as importing text content.

Initially you need to copy image files in your server, you are able to copy all of these anywhere within your web site directory, however I like copying it to public files directory (sites/default/files). When you've copied the images, you have to produce a CSV importer. Within which CSV importer we'll specify the trail from the image. Look into the feed importer :

Product images is the important subject during this feed importer. Product images is an image field. Right listed below is that the CSV importer :
"SKU";"Title";"Description";"Brief Description";"Taxonomy Terms";"Product Selection";"Product Images"

"IMPORTED-PRODUCT-1";"Imported product display one";"This is an imported product one. This is an imported product one.";"This is an imported product one";"Clothing";"IMPORTED-PRODUCT-1";http://mysite.local/sites/default/files/image1.jpg


When you have already uploaded the image towards the server then you are able to import data by using the CSV.
This was concerning importing images utilizing feeds. Suppose, the field accepts multiple images and you would like to import multiple images by using the importer, then you are able to use feeds tamper module for that. Look into the feeds tamper configuration to the images field:

 

You are able to alter the exploding character to anything, however be certain the character is unique and it is not present inside the URL of image. Right listed below is that the CSV importer for importing multiple images :
"SKU";"Title";"Description";"Brief Description";"Taxonomy Terms";"Product Selection";"Product Images"
"IMPORTED-PRODUCT-1";"Imported product display one";"This is an imported product one. This is an imported product one.";"This is an imported product one";"Clothing~Jackets";"IMPORTED-PRODUCT-1";"http://mysite.local/sites/default/files/compressed/image1.jpg~http://mysite.local/sites/default/files/compressed/image2.jpg"



European Drupal 7 Hosting - HostForLIFE.eu :: How to Fix Bootstrap Theme Error on Drupal 7

clock October 2, 2014 08:27 by author Peter

I installed Bootstrap Framework theme on Drupal 7 hosting site and enabled it to be my default theme. I noticed my firebug printing errors on my console and all my .js related features are disabled after the page reload,  which I started to suspect on my jQuery file version and eventually I confirmed that version of my file is the culprit.  Drupal 7.x installation comes with the jquery version 1.4.x but as per date 05/2014 it is version 1.11.x so obviously you know why you get that error! And here’s the step how to Fix How to Fix Bootstrap Theme Error on Drupal 7:

1. The preferred method to accomplish this task is to install the jQuery Update module. If using jQuery Update, you must also configure the jQuery Update setting to the appropriate version after it is installed. You must configure (admin/config/development/jquery_update) the version you need to make use of. Selecting from cdn i.e(jquery, google) will fix the error for sure, if not follow the other steps down.
2. Install Libraries API module and enable it , Install Bootstrap Libraries module and enable it.
3. Then download the latest version of bootstrap files from http://getbootstrap.com/ and extract the files in sites/all/libraries directory by renaming the folder “bootstrap”

4. Make any configurations you need in the page /admin/config/development/bootstrap_library and click save

The steps above will override all the old/existing jquery version and will be compatible with your bootstrap files.



About HostForLIFE

HostForLIFE is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes.

We have offered the latest Windows 2019 Hosting, ASP.NET 5 Hosting, ASP.NET MVC 6 Hosting and SQL 2019 Hosting.


Tag cloud

Sign in