This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

php syntax

Sorry, but I'm just getting started with php (I'm an old C programmer), and I can't figure out what's up with the # in front of all the API variable names. I've searched high and low, and I can't find a single word on this in the php manual. Can someone help me out here?

Thanks,
-eric

how to display html area in create contain page

hi
i am new to drupal but by mistake the html area is hide in create contanin page option so please anyone who know please help

Views module - How to use exported code directly in our script?

I found Views module is very powerful. I used it as a general purpose filter. Last time, I tried the export function of the module, and it generated some bunch of code.

Can we use the exported code directly in our scripts without importing it? So we can modify the view directly in our code.
I mean something like this:

trying to create a digital menu, need some advice

Well I had a guy make a digital menu system that was ok but it was added a blank link to the links section of every node and so I'm considering scrapping it bc that annoys me so much.

Anyways I'd like for a paying customer to post a menu node and then subsequent menu item nodes that will belong to the parent node. Then there would be a page that brings it all together in one pretty layout.

Connecting groups of images with a single node

I have a node type (something like story) where I can describe hospitals all over the country, but that single node should be tied up with groups of images, and I can put many photos inside a single group:
1. photos of doctors in a particular hospital
2. various photos of a hospital

I'm struggling with this problem for a while... can you give me a clue, please?
What's the best way to make these things done? CCK? Flexinode? Taxonomy?

Need HowTo for complex node types!

I created a new complex node type. It represents an aggregate object, which consists of several sub-objects, so the data is spread over several tables in the database. I construct my node object in hook_load like this:

function myNode_load($node)
{
	// switch database
        db_set_active('myDB');

        // create my object
        $myObject = db_fetch_object( db_query( ... ) );
        $myObject->subObject1 = db_fetch_object( db_query( ... ) );
        $myObject->subObject2 = db_fetch_object( db_query( ... ) );
        ...

        // switch back database
        db_set_active('default');

        // append myObject to node-object, and return the node
        $node->myObject = $myObject;
	return $node;
}

Note, that I return $node instead of $myObject. This way $myObject is not flattened into a set of properties an merged with $node, but it remains as an object that is attached to $node. This way I can use the object in other following hooks like I constructed it. For instance in hook_form:

$form['myObject']['subObject1']['latitude'] = array
(
    '#type' => 'textfield',
    '#title' => t('latitude'),
    '#default_value' => $node->myObject->subObject1->latitude
);

My problem is now, that $myObject is lost after submiting the form. As far as I understand, node_form_submit($form_id, $edit) in node.module creates a new node-object out of the data submited in the form elements. Therefore $myObject is lost and not attached to the $node object which is passed to hook_validate, hook_update and so on... The following doesn't work:

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions