I'm reading Pro Drupal Development, Second Edition. It says that the following is necessary:
t("Your favorite color is !color", array('!color' => "$color"));
But it also says that the ! placeholder means that no transformation will be done on the string. So why not just:
t("Your favorite color is $color");
Thanks.
...
How Can i create a search for the CCK fields in Drupal? Currently using a Finder Module is giving some error. If there is some other way kindly help me with it . Also .. is it possible to have a drop down for the Location Module fields which are visible on the Nodes? Since if I use use them for search then in the search the "ABC" and "a...
To make sure my site is secure and all the permissions are set correctly, I am looking for a way to generate a list of every page that a specific user has access to. (So... every menu callback where user_access() returns TRUE for a given uid).
Something that would look like this:
$user->uid == 0
Home
Photos
Contact Us
$...
I want to add some additional formatting to my menu. I've been looking at menu.inc and am unsure which method would i override to do something like the following.
if content type = "fund"
print " some additional formatting "
...
My view holds a list of nodes ranked by rating (vote-API/Fivestar).
I wish user to hide nodes they do not wish to see in this view. Can this be done?
...
In my Drupal6 site, I have a field called "Short term attendance". I have it set so Anon users are not permitted to view this field. (This permission is granted by the profile_permission module). However, I have a View where short term attendance is one of the fields. When Anon is looking at this View, it sees that field, in addition to ...
For some reason, the "Create content" menu item was displaying for Anon, even though there was nothing in that tree or at that path. (Anon can only create a certain type of content, but that has been moved to its own top-level navigation item.)
To solve this, I used hook_menu_alter():
/**
* Remove "create content" from the menu if the...
I would like to have a Google Adwords conversion trigger when a new node is submitted on my Drupal 6 site, but cannot find a way to do this.
Basically I want a user to submit some details into a custom node type, let's call it "Player". When a new Player is added, I want to trigger an Adwords conversion. I have looked at the Custom (For...
Users on my site can add nodes of a custom type (let's call it "Player") but cannot publish them. Effectively they need moderating before posting. Once an admin / moderator has published them, I want the owner / publisher to be changed to an the relevant admin / moderator. This is so that the user is be unable to edit them and also so it...
Is it possible to suppress the status messages set by drupal_set_messages() for certain roles? One client does not want certain roles (anonymous) to see these messages.
...
For a certain content type, I want to alter the access denied error message. What is the best way to go about doing this?
function mytheme_preprocess_page(&$vars) {
if ($vars['title'] == 'Access denied' && $node->type == 'ODP') {
$vars['content'] = 'OMG WHAT R U DOING!1!?!!1';
}
I was hoping to do something like that. However...
I'm working with the Zen theme in Drupal and have discovered that I can get to the $body_classes variable through the _preprocess_page function in template.php.
What I'd like to know is exactly how that $body_classes variable is populated? Where do the terms such as one-sidebar, etc, come from?
Thanks
...
I have a few modules with some functionality overlap. In accordance with DRY, I'd like to move this out to another location, so I will have less code to maintain. Where is the best place to do this? If I just make a module (and make it a dependency of the ones that need it), will I be guaranteed that the constants, functions and variable...
One of the fields in my user profiles is a list of nodes. (This list is generated automatically, based on other data on the site.) Currently, it displays like this:
Nodes
nid1, nid2, nid3
I want it to look like this:
Nodes
$nid1->title, $nid2->title, $nid3->title
where each title is a link to its node. What is the ...
I have a solid image gallery going, using CCK, Views, and Imagecache. However, this currently requires users to upload images one at a time, which is unacceptably tedious for most people. What is the best way to implement mass image upload on Drupal?
...
I'm new to Drupal dev, and was trying to add an existing region variable to my module's preprocessor function.
Basically, I've created a new region for my site (here's the definition from within side my theme's .info file):
regions[feeds] = Feeds
From Administer->Blocks, I've added the blocks I want to the new "Feeds" region.
Then, ...
Hiya,
I'm building a recipe management system for a cooking website in Drupal, and I have to say the whole node / view / template thing is working very nicely! I've got one problem though and that is that I can't get a view to display JUST an image - it always comes bundled with it's title and a link through to the gallery.
Can anyone...
Hi,
Drupal is giving me an error message which says : "An illegal choice has been detected. Please contact the site administrator" on the site : http://naplesres.designbracket.com
Whats worse is that this error is preventing me from logging into the website . Each time i input the uname/pwd of any of the users it throws an error.(I have...
I have a custom 'Player' node type in Drupal with a CCK file field allowing multiple mp3 files to be uploaded (3 in this instance). Currently I have SWFTools installed and most of the players that supports. So far I have been using FlowPlayer3 for it, which does everything I want except display the track names. I've tried most of the oth...
Hiya,
I've got a site where individual pages might require some javascript or CSS files hooked into their heads. I'm trying to keep everything client side when it comes to managing this process, rather than getting on the FTP and sorting everything out in the code so I need to be able to upload css and js files.
I've got CCK filefield...