[development] Re: [support] flexinode + i18n module

VJ vrao at misteam.net
Tue Mar 7 01:14:21 UTC 2006


if anyones interested, Im pasting the 'view' code from attachment module
in the template file itself.

foreach ((array)$node->attachments as $attachment) {
  if ($attachment['working']) {
    $file = module_invoke('filemanager', 'get_file_info',
$attachment['fid']);
    $workingurl = str_replace('&', '&', module_invoke('filemanager',
'url', $file, TRUE));
    $activeurl = str_replace('&', '&', module_invoke('filemanager',
'url', $file, FALSE));
    $node->body = str_replace($activeurl, $workingurl, $node->body);
    $node->teaser = str_replace($activeurl, $workingurl, $node->bteaser);
  }
}

$node->body = '<br /><a name="attachments"></a>' . theme('attachments',
$node);

print $node->body;


Im resetting the body cuz the fields are being printed induvidually. Im
not happy with this solution at all, so if anyone knows the correct way to
theme/translate flexinodes ..please let me know

Thanks,

V

>
> Actually, does anyone know how to print attachment module attachments
> using phptemplate ? I figured out how to print upload module attachments,
> but most of my nodes use attachment module.
>
> I am not doing print $content or print $node->body for reasons explained
> in earlier posts but some how $content and $node->body are able to get the
> attachments
>
> -v
>
>
>> Thanks for the pointer.
>>
>> I created a node-flexinode-1.tpl.php .
>>
>> I can pull a label (say label number 21), using
>> flexinode_load_field(21);
>> How do I print its spanish counterpart (using localization module), in
>> the
>> template?
>>
>> Also, if I want to print the whole node manually (without using print
>> $content; I am hitting a roadblock when I try to print attachments
>> (using
>> upload module or attachment module). How do I do that?
>>
>> This is probably more complex than it needs to be, we need native
>> support
>> for i18n in flexinode module.
>>
>> -v
>>
>>
>>
>>
>>
>>> Hi,
>>>
>>> A flexinode is like a node, and it's translation is much like the same.
>>> The
>>> question here, is that while in normal nodes the "labels" are static,
>>> in
>>> flexinode they are "dynamic".
>>> Like I said, I will take a look at it because I will need that
>>> functionality
>>> too :)
>>>
>>> You can create a node-flexinode.x.tpl.php (refer to drupal themes
>>> developer
>>> handbook for more info) and there you can define your labels and also
>>> use
>>> translation functions.
>>>
>>> As you can see in the "bugs/features list" both in flexinode and i18n,
>>> all
>>> the work I'm doing is sent as patches for version 4.6. Now, I hope that
>>> someone at least verify those patches and if they like it apply them to
>>> main
>>> tree. Of course, that would be nice that they could check and upgrade
>>> them
>>> to version 4.7!
>>> I can do that when I update my version to 4.7, but for know I'm being
>>> carefull enough to describe all my patches to apply them to my tree...
>>>
>>> Regards,
>>>   Fernando Silva
>>>
>>> On 2/26/06, VJ <vrao at misteam.net> wrote:
>>>>
>>>>
>>>>
>>>> Thanks. I was curious if there is a more correct way to translate
>>>> flexinode content. The module usually comes with some .po files. Is
>>>> there
>>>> a scoop on that?
>>>>
>>>> Or atleast, is there a way I can change content in node.tpl.php ?
>>>>
>>>> Im not keen on hacking the module itself, since I want to upgrade to
>>>> 4.7
>>>> and I can see potential problems with updating a hacked module
>>>>
>>>>
>>>> -v
>>>>
>>>> p.s Ive noticed that the localization interface sometimes has
>>>> duplicates
>>>> ,
>>>> is this a known bug?
>>>>
>>>>
>>>> > Hi,
>>>> >
>>>> > I am in this precise moment implementing a site with 3 languages so
>>>> I
>>>> will
>>>> > have to check that, and try to create a patch. I'm not maintainer
>>>> neether
>>>> > of
>>>> > flexinode or i18n, so meanwhile, it makes more sense go to the bug
>>>> report
>>>> > of
>>>> > i18n (it seems to me that this is a i18n problem) I try to get some
>>>> help.
>>>> >
>>>> > Regards,
>>>> >   Fernando Silva
>>>> >
>>>> > On 2/23/06, VJ <vrao at misteam.net> wrote:
>>>> >>
>>>> >>
>>>> >>
>>>> >> field labels : i.e 'label' column from the flexinode_field table
>>>> >>
>>>> >> For ex: I have a flexinode called project. I have a field label
>>>> called
>>>> >> Project Abstract. I translated it to Resumen del Proyecto using the
>>>> >> localization interface.
>>>> >>
>>>> >> Now if I go to website.com/es/add/node/flexinode-1 it shows up the
>>>> >> spanish
>>>> >> labels but once the node is submitted all the labels are displayed
>>>> in
>>>> >> english.
>>>> >>
>>>> >> It looks like flexinode creates the node body by calling the field
>>>> label
>>>> >> followed by field data and doesnt pay any attention to translated
>>>> >> labels.
>>>> >> I will have to hack the module and make it call the translated
>>>> labels
>>>> >> right? or is there a more correct solution?
>>>> >>
>>>> >> Thanks,
>>>> >>
>>>> >> VJ
>>>> >>
>>>> >>
>>>> >> > Can you be more specific? Are you talking about fields data, or
>>>> fields
>>>> >> > labels?
>>>> >> >
>>>> >> > Regards,
>>>> >> >   Fernando Silva
>>>> >> >
>>>> >> > On 2/22/06, VJ <vrao at misteam.net> wrote:
>>>> >> >>
>>>> >> >>
>>>> >> >> Hi,
>>>> >> >>
>>>> >> >> When I translate all the flexinode fields through localization,
>>>> it
>>>> >> shows
>>>> >> >> up under add->content. For example : Author name shows up under
>>>> >> >> /en/add/node/flexinode-1 and the corresponding spanish
>>>> translation
>>>> >> shows
>>>> >> >> up under /es/add/node/flexinode-1
>>>> >> >>
>>>> >> >> However, the node display always shows the fields in
>>>> english..even
>>>> if
>>>> >> it
>>>> >> >> was created through the spanish interface.
>>>> >> >>
>>>> >> >> Has anyone been able to come up with a solution where flexinodes
>>>> are
>>>> >> >> translated correctly?
>>>> >> >>
>>>> >> >> Thanks,
>>>> >> >>
>>>> >> >> VJ
>>>> >> >>
>>>> >> >>
>>>> >> >> --
>>>> >> >> [ Drupal support list | http://lists.drupal.org/ ]
>>>> >> >>
>>>> >> > --
>>>> >> > [ Drupal support list | http://lists.drupal.org/ ]
>>>> >>
>>>> >>
>>>> >>
>>>> >> --
>>>> >> [ Drupal support list | http://lists.drupal.org/ ]
>>>> >>
>>>> > --
>>>> > [ Drupal support list | http://lists.drupal.org/ ]
>>>>
>>>>
>>>>
>>>> --
>>>> [ Drupal support list | http://lists.drupal.org/ ]
>>>>
>>> --
>>> [ Drupal support list | http://lists.drupal.org/ ]
>>
>>
>>
>> --
>> [ Drupal support list | http://lists.drupal.org/ ]
>>
>
>
>
> --
> [ Drupal support list | http://lists.drupal.org/ ]
>





More information about the development mailing list