You're well aware that they might affect your site's performance. That it will take its pages more time to “assemble” their whole overloads of content blocks and yet....You just need more blocks, a whole lot more!
You just need to add more blocks to your Drupal site!
And who could blame you for that? They practically make such a handy means of nicely structuring your custom content and put together a nice, engaging layout! Put together they just turn that complex, yet user-friendly content architecture into reality!
Here a block here, there a block, each one enabling you to put together the perfect puzzle for your website.
What do you do when you've apparently reached some sort of a limit of maximum blocks that you can add to your Drupal site? Well, you increase that maximum number! And you turn this apparent dead end into an incentive to keep improving your Drupal website's layout! Here's how:
1. But First: A Few Words About Blocks
To boil it down to just a few words: blocks are content containers!
They can “hold” text lines, images, lists, full body texts etc. And, the great thing(s) about them is that once you automatically enable them, as you install core or contributed modules on your site, you can easily adjust them to your liking. Decide upon their size, shape and where you'd like to place them on your site!
Where can you view your blocks? Right here:
Administer >> Structure >> Blocks
Which are the regions (sidebar, footer etc.) on your site that you can place them?
Well, it depends on your Drupal site's theme(s), in fact! More themes “spoil” you with the chance to place your blocks differently for each theme.
It's in your Block Admin page that you can decide on their vertical sort-order per region. It's there that you'll find your checkboxes, as well, and the link leading you to your blocks configuration page.
“Empowered” with these checkboxes to check as you wish and the configuration page, you get to “indulge” in customizing your blocks' visibility to your liking!
2. How Do You Add More Blocks to Your Drupal Site?
You're still here, in the block management screen, trying to figure out how to create a new block.
It's easy! You go to:
Administer >> Structure >> Blocks >> Add
See? As simple as that! The management screen comes with a “surprise” “Add block” link for you!
Take it from there: fill in your description box, then your block body, pick the region that you'd like this new block to be “sent” to by “wandering about” your “Region Settings” and... end with a click on your “Save block” link!
There you have it: Drupal site building made easy with blocks! Feel free to move them around, to drag and drop them in specific regions of your site's theme.
3. But What If You Need More Blocks, A Lot More?
Things get a bit “trickier” when your blocks adding “ambitions” go beyond from the “average” ones.
When your business website's full functionality depends on being able to carry many, many more “content holders” ( 50-100 or even more). You risk the chance of getting some frustrating error messages, that's for sure!
“Trickier”, yet not impossible!
There still are a few methods for increasing the limit, the number of maximum blocks that you can add to your Drupal site. Let's point them out:
1. Increase your maxium input size in your .htaccess file
It's the ideal solution to take when it's a Drupal multi-site installation that you're dealing with!
Here's how you do it:
Access the directory where you Drupal site resides >> insert these lines to your .htaccess file:
<ifmodule mod_php5.c="">php_value max_input_vars 2000</ifmodule>
Tip: make sure you're on command line or that the editor you're using has been set up to show “hidden files”!
Another tip: if you don't have access to your .htaccess file, since your website is on a shared host, contact your web hosting provider for editing this file for you!
2. Increase your maximum input limit in your php.ini file
Since the default value in max_input_vars is set for 1000, feel free to increase it. Double or nothing or... even more?
Here's how you do it:
Access the php.ini file >> insert the following line:
max_input_vars = 2000
Tip: in most cases this file resides at /etc/php5/php.ini on web servers!
3. Increase your site's maximum input limit in your settings.php file
This is the most “versatile” solution of all three. Most Drupal web developers can fix the “I need to add a lot more blocks to my Drupal site” issue with this easy “trick”:
Access your settings.php file >> there, under the “PHP settings”, insert this line:
ini_set('max_input_vars', 2000);
Tip: you'll find your settings.php file at /sites/default or /sites/all in your Drupal website's root directory
Why is it that this fix is the most recommended one? It's because you won't be “impacting” your PHP stack, but rather handling this specific issue only: lots of blocks (loaded with data, too, obviously), that you need to insert on your Drupal site.
How about you? What other fixes do you rely on when you're dealing with an “overload” of content blocks that you need to add to your Drupal site? How do you “break the limits”?
We do Drupal development
Go to our Drupal page!