Support Forum » User Profile

Forum Replies Created

Viewing 15 posts - 46 through 60 (of 94 total)
  • Author
    Posts
  • in reply to: Display a translated setting value in a view #38243
    ArnoArno
    Participant

    Hi Long,

    Thanks, I will e-mail you.

    By the way, in my last post I meant to write "Even for English, this does NOT return a value".

    in reply to: Display a translated setting value in a view #38234
    ArnoArno
    Participant

    Follow up: I've done a few additional tests.

    The normal way to display a setting in a view works fine in English but not in German (no value is displayed):

    {% set group = attribute( site, 'site-configuration' ) %}
    {{ group.site_settings_texts_more_itineraries }}

    I can see that the text value of the 'site_settings_texts_more_itineraries' field is stored in the database table wp_options, in the record with option_name = 'site-configuration'. So, I tried to get the value through the WordPress get_option function (https://developer.wordpress.org/reference/functions/get_option/):

    {% set atext = mb.get_option('site_settings_texts_more_itineraries') %}
    {{atext}}

    Even for English, this does return a value. I would expect a standard function to access this data to work.

    So far, I could only fine one work around: using WPML, I can duplicate the view for German, give it a slug with the "-de" suffix, and then use a hardcoded string instead of the setting value.

    Do you have any suggestions, or would you like to take a look into a copy of the website?

    Thanks!

    in reply to: Display a translated setting value in a view #38230
    ArnoArno
    Participant

    Hi Long,

    Thanks, good to see that this should work. You only have one view, right? It's not duplicated for each language?

    Is there any other setting I need to check? Somehow I don't get the value in the secondary language, only in the default language.

    in reply to: How to safely change the taxonomy slug? #38140
    ArnoArno
    Participant

    It looks like it worked. Thanks!

    in reply to: How to safely change the taxonomy slug? #38133
    ArnoArno
    Participant

    Thank you. Ok, so you suggest to create a new taxonomy, then switch from the old to the new taxonomy, and finally delete the old taxonomy.

    in reply to: Twig merge to create the tax_query #38037
    ArnoArno
    Participant

    Much appreciated, thank you. Will try it out later.

    in reply to: Using rwmb_get_value on a multilingual website (WPML) #38028
    ArnoArno
    Participant

    Hi Long,

    Great, rwmb_meta works for me. I can pass the original post ID, so I don't need to request the translated post ID first. That's one less line of code 🙂 I'm not sure why rwmb_get_value() only works for English in my case.

    Thanks!

    in reply to: Twig merge to create the tax_query #38012
    ArnoArno
    Participant

    I can't find a way to solve this in Twig. The merge filter does not seem to work for this scenario. It looks like there are/were Twig "add" and "push" filters too, but they're not recognized in the view code.

    For others with this issue: I created a PHP function to compose the tax query. As arguments, it takes the relation (AND/OR), an array of taxonomy slugs, and an array containing an array of terms.

    function get_tax_query($relation, $taxonomy_slugs = array(), $term_ids = array()) {
    	$tax_query = array();
    	
    	if (count($taxonomy_slugs) > 1) {
    		$tax_query['relation'] = $relation;
    	}
    
        foreach ($taxonomy_slugs as $key => $taxonomy_slug) {
    		array_push($tax_query, array('taxonomy' => $taxonomy_slug, 'terms' => $term_ids[$key] ));
    	}
    	
    	return $tax_query;
    }

    So far this seems to work well.

    If you know a way to do this directly in Twig, please share.

    in reply to: Twig merge to create the tax_query #38008
    ArnoArno
    Participant

    I think what goes wrong with the Twig merge, is that it looks at the key-value pairs and overwrites the values already in the array. If this is in the array:
    taxonomy: "travel-tickets"
    and I want to add this:
    taxonomy: "activities"
    it will actually replace it. I think.

    in reply to: Twig merge to create the tax_query #38002
    ArnoArno
    Participant

    Hi Long,

    Thank you. Yes, your first example works. This is what I have and it works fine:

    {% set args = {
    post_type: 'promotion',
    numberposts: 3,
    orderby: 'meta_value_num',
    meta_key: 'content_popularity',
    order: 'DESC',
    meta_query: [{
    	key: 'promotion_start_date',
    	value: 'now'|date("Y-m-d H:i"),
    	compare: '<=',
    },
    {
    	key: 'promotion_end_date',
    	value: 'now'|date("Y-m-d H:i"),
    	compare: '>=',
    }],
    tax_query: { 
    	"relation": "OR", 
    	0: { 
    		taxonomy: "travel-tickets",
    		terms: "336" 
    	},
    	1: { 
    		taxonomy: "activities",
    		terms: "324" 
    	}
    }

    However, whatever I try, creating the tax_query dynamically with "merge" fails (no results). And I don't understand the "do" example in your second link, to be honest.

    in reply to: FacetWP listing does not show Meta Box field value #37488
    ArnoArno
    Participant

    That fixes the problem, thank you Long!

    in reply to: FacetWP listing does not show Meta Box field value #37473
    ArnoArno
    Participant

    Hi Long,

    Sure:
    https://pasteboard.co/HpFSq20HYOfB.jpg
    https://pasteboard.co/vlOG4ALyKpSX.jpg

    I can't show everything on a public forum, but this should be sufficient I think.

    The problem is that it does not show the field values.

    in reply to: WP All Import/Export Add-on #37458
    ArnoArno
    Participant

    I'd a appreciate an update from Meta Box staff about this.

    Also, an overview of what can and can't be done with WP All Import would be very welcome. I assume that simple custom fields (text, numbers) and taxonomies won't be a problem as they are native WordPress?

    in reply to: Translate fields in cloneable field group with WPML #37419
    ArnoArno
    Participant

    Hi Long,

    Ok, I understand. I found that ACF supports this for WPML. So, I think it's important for Meta Box to make sure that full compatibility is available soon. Personally I don't think it's new feature, but rather something that's missing despite the claimed compatibility with WPML.

    Hopefully you'll be able to make this happen soon. Thanks a lot!

    in reply to: Translate fields in Settings Pages with WPML #37373
    ArnoArno
    Participant

    Hi Long,

    Thanks a lot, that worked fine.

Viewing 15 posts - 46 through 60 (of 94 total)