node_load_from_title()

Drupal: 

node_load_from_title() is a function for Drupal 7 to replace functionality lost in the changeover from Drupal 6.

Drupal 6 had a lot of functions with optional selection criteria. You could specify the id of the node or item you want or you could provide something else including the title. Drupal 7 replaces the selectivity of the node_load() function with a more complicated selection process. node_load_from_title() gives you a common requirement, the selection of a not by title, as a function.

api.drupal.org/api/drupal/modules--node--node.module/function/node_load/7#comment-19239 is a typical comment about the change.

  1. Down file node_load_from_title.zip.
  2. Expand the file and check all nine lines of the code to make sure I am not trying to destroy your computer.
  3. Copy the node_load_from_title to your /sites/all/modules/ directory.
  4. Switch on module node_load_from_title in /admin/modules/ directory.
  5. Start using node_load_from_title() in your modules.
  6. Remember to add dependencies[] = node_load_from_title to the .info file in your module.

You are free to use this module in any way you like under Drupal so long as you do not charge for the code. Use the GPL 2 licence as supplied with Drupal 7. If Ubuntu Linux had a decent Git user interface application, I would load this code into drupal.org. If Git had any decent user interfaces, including on Windows, I would load this code into Drupal.org.

Comments

Hey!

I came across this post in a Drupal.org comment and was surprised to hear your comments about git being unusable or indecent.

To upload this to drupal.org it's as simple as getting a git url from Drupal.org (I've never done anything on drupal.org but for any git repo/host you generally have a git remote URL)...

After that it's as simple as:

cd ~/Code/my_project
git init
git add . // at the start you add all files in your repo, then moving forward you add them individually
git commit -am "This is my first commit"
git remote add origin git@drupal.org/git/my_project.git
git push origin master // origin is the name of the remote you're pushing to, and master is the default branch in git

It seems a lot more complicated than it is, and I think you'd be surprised at how efficient git is and how much you're missing out by choosing not to learn it. (Really, those 6 or 7 commands are all you ever need, other than git reset to rollback to other branches)

If you need any help or have any questions you can contact me directly and I'd be happy to answer them for ya.

Cheers!

Hello Thomas, I remember the DOS box and do not want to go back to it even if it is called the command line. I am not going back to driving a manual car in city traffic or to washing clothes by beating them on a rock down at the river. The DOS/Unix teletype emulation box it gone. You do not need it when you have Filezilla, cPanel, and other modern tools.

I tested the latest NetBeans 7.1 PHP download and it has an excellent interface for both FTP and Git. You still need a Windows machine to generate your keys in PuttyGen. Everyone has a Windows notebook laying on the shelf doing nothing. Might as well use it. Once the keys are generated, you go back to Linux and rip into everything. net time I PuttyGen on Windows, I will generate ten sets of keys so I can use a different set for each system.

Thanks for the help I was also looking for the same.

Thanks