Set node_reference type field in hook_node_presave

hi there)

friends please tell me - how to set value for node_reference type field ("field_88" in my case) programmatically .

I use for this hook_node_presave() , where wrote =

$node->field_88['und']['0']['value'] = 123;

(123 = some node nid)
but this code set NULL value for field_88['und']['0']['value'] (I've checked it with Devel module)
so - I can't understand - where is my mistake ?

Change form's design

Hello,

I'm sorry for my dumb question but I don't find how to change the design in a form. The CSS is not enough.
Thus I would like to make that in my theme, as I made for the display of the node's content. I tested various methods but nothing works correctly.

Thank you in advance. :)

How to get a filter criteria like "Taxonomy term : has related content" in views ?

Hello ! (sorry for my english I'm french)

I'm working on an e-commerce site which has products dispatched in categories. I'm trying to build a view which aim is to list categories of products. I would like to show only the categories which has products in it.

So I'm wondering if it is possible with a module or anything to get a filter criteria like "Taxonomy term : has related content" ?

Thanks in advance for your answers

Custom menu output?

Is there anyway of creating a menu which outputs html (or more specifically the submenus) that looks something like this:

<div id="main-menu">
    <div class="navigation">            
        <ul class="menu">
                <li><a href="#">Link one</a></li>
                <li><a href="#">Link two</a></li>
                <li><a href="#">Link three</a></li>
                <li><a href="#">Link four</a></li>

        </ul>                      
    </div>
    <div id="submenu">
        <ul>
            <li><a href="#">Link one item one</a></li>
            <li><a href="#">Link one item two</a></li>
            <li><a href="#">Link one item three</a></li>

        </ul>
        <ul>
            <li><a href="#">Link two item one</a></li>
            <li><a href="#">Link two item two</a></li>
            <li><a href="#">Link two item three</a></li>

        </ul>
        <ul>
            <li><a href="#">Link three item one</a></li>
            <li><a href="#">Link three item two</a></li>
        </ul>
    </div>
</div>​

images don´t show

Hi! please forgive me if i did post this wrong.

I have installed Drupal 7 on my web server everything is working like charm except that i can´t show any pictures/images just get some small box whit an X in it.
i have try upload some in articles and blog that´s not working, and i have installd the module "apps" whit levelten not even in that module it show images.

my adress is worldconn3ction

Adding a new data to a user's record in a module -- how do I tell the DB about the data type 1st?

Hi,

So far, I've been using Drupal pretty much out-of-the-box. New content created by a user gets automatically associated with the user creating it -- everything just works.

I'm taking the next steps and 'extending'. I wrote a module that pulls some info from the filesystem, presents it to the user, and gets them to select an item from a pulldown menu.

In the module, I put the data I retrieve into a $_SESSION['test_data'] variable, and the result of their menu selection into $SESSION['test_select'] and use both during their session. That works like I expect.

Now, I want to add that data to the User's permanent record in the database. What I'm looking to do is:

For the currently logged-in user, what's the value of 'test_data' and their selection of 'test_select', once they've MADE the selection, permanenetly add/record both pieces of data to their data record.

I've got a real basic understanding question --

Before I add the data for the User, I have to create the record type in the database, right? How do I do that? Do I have to do that outside of Drupal 1st, using mysql database admin? Do I do that using an API?

A simple example of how to programatically

(a) create a record type in the DB
(b) add the data to the user's record

Pages

Subscribe with RSS Subscribe to RSS - Drupal 7.x