Showing posts with label Drupal. Show all posts
Showing posts with label Drupal. Show all posts

Friday

Drupal7 - Add source to feed item - Feed module -


Feed item doesn't show a link to the  source article (in the original website), to add a link to the source  (to view a full article) do the following steps:

1- add a new field to the content type: Feed Item (field_source)
2- go to Structure --> feed imporer

Saturday

Hiding message: The image was resized to fit within the maximum allowed dimensions ...

This message appears when uploading large images with dimensions exceed the allowed ones:
"The image was resized to fit within the maximum allowed dimensions ..."
To hide the message, open file:


Tuesday

Fatal error: Allowed memory size of 67108864 bytes exhausted

You may see this massage in updating drupal or when  enabling some modules.

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 14 bytes) in includes/theme.inc on line 978


Upgrade/Update drupal 7 to 7.2 or 7.4


1.  Go to Administration > Configuration > Development > Maintenance mode

Enable the "Put site into maintenance mode" and save.

2. Remove  old core files and directories, except for the 'sites' directory
+ any custom files you added.
If you made modifications to some core files, you will need to re-modify them after upgrading.

Friday

Drupal7: Hide and print contents and fields in "node.tpl.php"

Drupal defines the content as An array of node items($content). You can print all the array elements using render($content)  or print a subset as render($content['field_example'])


To print a subset of the elements, first hide this element:
hide($content['field_example'])  

Drupal 7: How to get rendered blocks in content region


Some modules are added by default to content (as rating and share modules), but others are not allowed to be rendered or added whiten contents or articles.

As an example, you may need to add "Related or Relevant" articles after the article,in this case this topic is what you need.

Sunday

Joomla vs. Drupal Terminology


Joomla and Drupal have different terms:


  1. Joomla Template = Theme in Drupal.
  2. Component = Module in Drupal.
  3. Module = Block in Drupal.
  4. Mambot/Plugin = Input filter in Drupal.

Joomla vs Drupal


 

  1. Drupal allows you to assign content to several Sections/Categories, while Joomla only supports one Section and one Category for each Article.
  2. Drupal supports multi-site setups, so a migration from " multi-site with Drupal" to Joomla must be put into a certain site.
  3. Drupal has built-in forum discussion and you don't need to install any additional modules.
  4.  "Blog" term in Joomla is actually a teaser of contents : Title, Introduction and a Read More link. It's not the same as blog in Internet dictionary.So, Joomla supports a 'Blog' by default,  but with a different meaning.
  5. Comments on contents are not available in Joomla by default, but Drupal supports comments for all content-types by default.
 Find more in drupal.org








Tuesday

Update Flippy module to show only Published nodes ( Articles)

Version: Drupal7



To filter the pager links to page only through published Articles:

open file:
sites/all/modules/flippy/flippy.module

Flippy module: Add previous/next pagers for content types

Version: Drupal7



Flippy module  generates previous/next pagers for content types so you can page through Articles or Blog posts.


How to use this simple module?

Monday

Notice: Undefined property: stdClass::$field in locale_field_node_form_submit() line 410 locale.module

Version: Drupal7

This notice may appear after after submitting or adding new content( as Article):

Notice: Undefined property: stdClass::$field in locale_field_node_form_submit() (line 410  locale.module

If every thing works fine and the form submit the data successfully, you may use the following temporary  solution:

Tuesday

How to assign fields for administrator only - Field Permissions

Version: Drupal 7
Sometimes we need to define fields that appears only for administrator, and not allowed other users to see or update the fields. Or in other cases, you may add "Author Name" field to "Add Article" form, and only show this field for anonymous user (if you allow unregistered users to add articles)

The Field Permissions module allows administrator to set permissions for fields, and control whom can edit and input value to this field.
 

Notice: Undefined index: alias in path_node_insert() line 188 of path.module

Version: Drupal7

This notice may appear after using Pathauto module:
Notice: Undefined index: alias in path_node_insert() (line 188 of / modules/path/path.module

Just open :modules/path/path.module
 

Friday

How to limit the number of characters in the Summary textarea field

Version: Drupal 7
  
You need to restrict the length of Article summary to avoid a very long one.
One way is to use this script:

Always show the summary field in "add content" form

Version: drupal 7
  
Its difficult for new users to notice the summary field in add article form or in adding new node.
You can edit the form to always show the summary field and hide Edit/Show Summary links.

Thursday

Adding a New Drupal Block Position

Version: drupal 7

This article describes a simple way to define a new region in your theme.
Let's assume that we need to place a block above the main menu, as advertisement or news bar.