Custom submitted by in tpl files
Here is a line of code to override Drupal's submitted by elements in node.tpl.php file.
created, 'custom', "F d, Y"); print ' | ' . theme('username', $node); print ' | ' . $node->comment_count . ' Comments'; ?>
Here is a line of code to override Drupal's submitted by elements in node.tpl.php file.
created, 'custom', "F d, Y"); print ' | ' . theme('username', $node); print ' | ' . $node->comment_count . ' Comments'; ?>
While developing a custom module, I needed to validate the following date time format:
1987-11-22T23:52:12
The following code was used to create a pattern for the preg_match and to test the results. (Can be used as is.)
Lately I was assigned with the task to display all terms assigned to a node, grouped by their parent. To better explain this, let's say for example that we have the Vocabulary 1 assigned to Content Type A, with the following terms:
Parent 1
-- term 1
-- term 2
-- term 3
Parent 2
-- term 4
-- term 5
Parent 3
-- term 6
-- term 7
etc.
If we need to display a block in user pages, and not in /user/login or /user/register etc pages, we need to field in some custom php code under the Page specific visibility settings, we select the radio "Show if the following PHP code returns TRUE (PHP-mode, experts only)" and we fill in the following code:
After a fresh drush installation, drush status returned this error message:
sudo mkdir /usr/local/share/
sudo mkdir /usr/local/bin/
And now it time to download and extract drush. Make sure that you have the latest version available and replace the url in the command accordingly.
We also create a symlink so that we can use it everywhere without typing the parent path all the time...
While working on an extra requirement for metalera.gr, we needed to do the following:
When viewing node/xxx, we would like to display all nodes that have terms that belong to the same parent as the one we currently visit. Let's say for example, that we have the following parent:
Colors
--red
--blue
--green
Node/xxx has the term green assigned. We need our view to display all nodes that have red or blue as well.
To achieve that, we first create a new view, then:
In Drupal 6 there is a very easy way to exclude the current node from the views output.