Support

Account

Home Forums Search Search Results for 'WPML'

Search Results for 'WPML'

reply

  • Hi Elliot, I think I’ve figured out what was happening.

    Although in WPML > Translation Management > Multilingual Content Setup I had checked the radio buttons for each sub field within the Repeater to “Translate” I had not checked anything for the actual Repeater field itself. For that I checked the “Copy from original to translation”.

    This appears, at first play, to have resolved the issue. I shall report back in the next few days or so to make sure this is all working.

  • Hi. What do you mean about checking the option to translate independently?

  • Hi @elliot,

    When i create a new page/post with these new ACF values they do appear on the bottom of the page/post. but not in the WPML Translation Management plugin.

    yet the field key does show there.

  • Hi @greencode

    Have you selected the option to translate the data independently?

    If so, none of the custom field data will be duplicated to the translation including the repeater field.

    Could this be the issue?

    If so, this is not really a bug, just a limitation of WPML + ACF

  • Hi @serviceweb

    I tried looking at your url, however, there is no reference of <span class="list"> in your code.

    Also, please describe the issue with more clarity.

  • I’ve just done another test with a clean install of

    Wordpress 2.6
    Advanced Custom Fields 4.2.2
    WPML 2.9.1
    WPML Translation Management 1.7.1

    And the problem still exists. Basically the repeater field does not contain any rows and therefore content.

  • Hi @gongl

    Thanks for the bug report.

    Perhaps each language has it’s of taxonomy terms (different term_id). This would cause ACF to not work…

    Is there some sort of WPML function called ‘get_translated_term_ID’ or something like that?

    If so, ACF could use this function to load int he ‘current language’ term_id.

    I see no issue with adding this to the core.

    Thanks
    E

  • Hi @nytrm

    I believe you are looking at the meta data for a field group, not for a page or post.

    The row that shows field_72 is NOT a value, it is a field object. You must ignore it.

    If you go and save a value on a page or post, a new row should appear in your view which uses the field_name

  • @elliot

    Yes, please hide the metadata fields who are not able to be translated.

    It was not my post question, the field_72 as an example has a field_name.
    Why is not the field_name displayed instead of the field key?

  • Hi @nytrm

    In your last screenshot, the metadata you are looking at is metadata from an ACF field group (the field objects). This is not to be edited via WPML in this view.

    Is your original question asking if I can hide these from the view?

  • Hello Elliot,

    Here is what I did to make it work. It was more simple that what we thought 🙂
    1. I went to wpml /general settings / translation configuration.
    (Sorry if it’s not exactly like this in English, mine is in French..)
    2. I check the relationship field. I changed it from “copy of the orginal” to “to translate”.
    3. I went back in the post in the secondary languages where Advanced custom fields allow me to select the related posts. There, I removed the already selected post and I added them again. Then, I update my posts.
    4. I removed $posts = lang_object_ids( get_field(‘relation_sejour_chambre’), ‘post’ ); and I put back $posts = get_field(‘relation_sejour_chambre’);
    5. I went frontend and I updated the page. It worked 🙂

    I still have one problem and I’ve create a new ticket for it but I think it’s more something for wpml than for you 🙂 : http://wpml.org/forums/topic/wrong-link-to-the-translated-pages-relationship-field-wpml-adv-custom-fields/

    Anyway, if you have an idea 🙂

    Thank you for the help you gave me Elliot !

  • Hi elliot

    Thanks for your hints. This set me on the right track.

    I had to change two things. First i had to use
    $post_objects = get_field('snippet_list',false,false);
    to get the correct arry of post Ids

    Second i had to use

    foreach( $post_objects as $postID):
       $post = get_post($postID);

    to get the correct posts.

    So the whole code looks like this at the end:

    <div class="row product-single-row snippets">
      <?php $post_objects = get_field('snippet_list',false,false);
        if( $post_objects ): 
        $counter_tab = 0; ?>
      <div class="span12">
       <ul class="nav nav-tabs nav-snippets">
        <?php foreach( $post_objects as $postID):
          $post = get_post($postID); 
          $counter_tab++;
          setup_postdata($post); ?>
        <li><a href="#snippet<?php echo $counter_tab ?>" data-toggle="tab"><?php the_field('snippet_label'); ?></a></li>
        <?php endforeach; 
          $counter_tab = 0; ?>
       </ul>
       <div class="tab-content">
        <?php foreach( $post_objects as $postID):
          $post = get_post($postID); 
          $counter_tab++;
          setup_postdata($post); ?>
        <div class="tab-pane fade" id="snippet<?php echo $counter_tab ?>">
         <?php echo get_the_content(); ?>
        </div>
        <?php endforeach; ?>
       </div> 
      </div>
      <?php wp_reset_postdata();
        endif; ?>
     </div>

    I’m not sure, this is the optimal solution, but at least it works the way I expect.

    Thanks again. I realy appreciate your help.

  • Hello @elliot

    See the image i attached to this post to see how it looks like now.

    I have no clue what the field name of these keys are, since a few updates ago newly created custom fields display as keys instead of field names.
    So it used to be like post 1 attachment, but now its like this posts attachment.

    Also i am not sure if the longer field keys are repeater fields.
    Hope you see that now the field keys are displayed instead of the field names.

  • Hello Elliot,

    I think that I’ve found the solution. I come back to you later, I’ll make more tests first ! 🙂

    Thank you !

  • Hello Elliot,

    Thank you for your answer.

    I’ve changed the relationship field to return an array of ID’s.
    1. In french (main language), I got this result :
    “array(6) { [0]=> int(170) [1]=> int(169) [2]=> int(142) [3]=> int(141) [4]=> int(140) [5]=> int(138) } ”

    2. In the two secondary languages, I got this result : “array(0) { } ”
    It’s like it didn’t record the id’s of the posts in the secondary languages…

    What can I do ?

    Thank you for your help !

  • Hi @frg004

    I think the lang_object_ids function will work for you, however you are passing through the wrong parameter.

    When you use get_field, the relationship field will return an array of objects. That function requires an array of ID’s

    Can you please edit your relationship field to return an array of ID’s and make sure it does by debugging the returned ACF value.

    Thanks
    E

  • Hi @nytrm

    Sorry mate, I don’t understand what the issue is.

    I can see your previuosly attached image shows all custom fields in the wp_postmeta and you are able to select translations for them.

    You say:
    “with new fields created the field name is replaced with the field key.”

    ACF saves it’s values with the field name (features_link), the field key will look something like field_123567 but this is not to be translated

    Your image does show sub field items:
    features_links_1_features…

  • Hi @philipp

    Your first step is to debug variables:

    
    <?php
    
    // test field
    $post_objects = get_field('snippet_list');
    
    echo '<pre>';
    	print_r( $post_objects );
    echo '</pre>';
    die;
    
    //test post_id
    global $post;
    
    echo '<pre>';
    	print_r($post->ID);
    echo '</pre>';
    die;
    
     ?>
    

    Are these variables producing the correct data?

  • Hello Elliot,

    Here http://pastebin.com/3FxrprJr ,
    you can see the output of “var_dump(get_field(‘relation_sejour_chambre’) );”.

    I got all the data’s in French (Primary language) but none in the secondary languages (Nl and En)

    As you said, currently both French and En Url’s produce an empty array for both but only since yesterday when Andreas from WPML plugin has asked me to add :
    1. this function in my functions file : http://pastebin.com/V3v1UBvP
    2. Replace $posts = get_field(‘relation_sejour_chambre’);
    with $posts = lang_object_ids( get_field(‘relation_sejour_chambre’), ‘post’ );

    Since I did action number 2, I got this error :
    Catchable fatal error: Object of class WP_Post could not be converted to string in /homez.533/reloukin/vm/wp-content/plugins/sitepress-multilingual-cms/inc/template-functions.php on line 179

    And the result of this error is an empty echo array on the page in the main language french.

    If I let action number 2 as it was before, I got a nice arrow in french (main language) and “array(0) { } ” in the secondary languages…

    What do you think ?
    Thank you for your help !

  • Hello @elliot

    Look at the screenshot from earlier in this topic, notice this one is correct.
    with new fields created the field name is replaced with the field key.

    So i have no clue what the field name actually is.

    Also no field key or field name is displayed for repeater sub items.

  • Hi @nytrm

    Sorry, I don’t quite understand your last comment. Perhaps you could compose an image of what is the current problem and what the solution would look like?

    Thanks
    E

  • Hi @frg004
    Thanks for the code.

    Looking at both URL’s previously posted (fr and en), the var_dump produces an empty array for both…

    Are you able to get it working for one language or does it not work on both? If it does not work on both languages, it is possible that the issue could be something else like a spelling mistake on the field name…

  • Found out this meta box is created by WPML instead of ACF.

    Add the following code to make the list sorted on line:3768 (sitepress.class.php)
    asort($custom_keys);

  • Hello @elliot

    No, the fields do display.

    Only the field keys are visible instead of the field names, probably changed this in a recent update.
    When watching a list of keys its really a lot of work to find out what the field name of each key is.

    So i guess this is a new bug report.

    EDIT: Also only possible to tell the field key of a repeater to be translated, not the fields within the repeater.

  • Here we go : http://pastebin.com/yCHiXEFJ

    Thank you !

Viewing 25 results - 451 through 475 (of 495 total)