[Support request] Are Elements Polylang compatible?

Home Forums Support [Support request] Are Elements Polylang compatible?

Home Forums Support Are Elements Polylang compatible?

  • This topic has 15 replies, 2 voices, and was last updated 2 years ago by Tom.
Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #747870
    Petr

    Hi,

    I’m wondering if GP Elements are Polylang compatible. It doesn’t seems so right now.

    Here’s my case:

    1. I’ve created CPT called Events.
    2. I’ve created 2 Elements, one for a Layout, one for a Header.
    3. Display rules for both are set to be used on all the Events posts.
    4. In original language, everything is fine, but for translated Events there are the default layouts and headers.

    How can I make it work for the transltions as well?

    Thanks.
    Petr

    #748240
    Petr

    And yet another unexpected issue with Polylang: in additional language, there’s a wrong link to home in the sticky header – see dev version: https://www.playday.cz/work/en/

    When you check the logo link in full header it points correctly to https://www.playday.cz/work/en/, but when you scroll a bit and check the link in the sticky header logo, it points to https://www.playday.cz/work/ (default language).

    This issue isn’t present when using WPML – see: https://www.playday.cz/ (recently I decided to switch to Polylang, I found WPML too bloated and tricky).

    #748245
    Petr

    And third time’s a charm…
    The logo link issue is present on the mobile menu as well (both default and sticky).

    #748259
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    1. So the Header and Layout are present on the English posts, but not any other language? As long as the post type is constant, Elements shouldn’t care. Is there a specific link where I can see this happening?

    2. The navigation and mobile header logos are set to link to the home page using this core WP function: home_url()

    I wonder if Polylang isn’t applying the updated URL to that function? Might be worth asking them.

    Let me know πŸ™‚

    #748270
    Petr

    Hi Tom,

    it’s 3 AM here, so I’m just heading to bed, but here’s a short answer, so you could do further investigation.

    Concerning the home link – please be aware that the logo link works correctly, when the header is in it’s default state, but it’s not working correctly when changed to sticky or mobile – so there has to be a difference – just check the links I provided.

    As for the Elements, I’ll look into them tomorrow, for now, there are no links I can show you, on affected pages I changed the settings manually per page.

    Thanks
    Petr

    #748279
    Tom
    Lead Developer
    Lead Developer

    The site logo when not sticky is a different element. The sticky logo is the navigation logo.

    However, both use the same function (home_url()) to output the link, so I’m not sure why Polylang would treat them differently.

    Perhaps their filter only applies to one instance of the function somehow? It’s likely something we’d need them to answer.

    We’ll get it figured out tomorrow – have a good sleep! πŸ™‚

    #748653
    Petr

    Hi,

    so here are some new pages:
    – Test Event in default language (Czech): https://www.playday.cz/work/akce/testovaci-akce/
    – Test Event in additional language (English): https://www.playday.cz/work/en/akce/test-event/

    Elements applied to default languages and not applied to additional:
    – Layout (pagebuilder container set to full, page heading and featured image are hidden)
    – Header (Site Header merged with Page Hero, featured image as a background of a Hero, custom H1)

    Concerning the Logo link:
    Yesterady I thought that the issue might be connected to the Header Element, but as can be seen on https://www.playday.cz/work/en/akce/test-event/ it is not. The Header Element is not applied there and the issue persists.

    I’m tending to this it must be something connected to the theme because in one instance the link is correct and in anoher it is not.

    If it’s a Polylang problem, could you please contact them, I’m not sure what to ask them for. And could you test it on your own dev install to see, whether this is only mine issue?

    It also worth mentioning, that the whole web was transfered from WPML to Polylang (which might cause some issues) and there are some legacy Page Headers there too (for HP and normal pages). On the the hand the Events pages use the recent (Elements) page headers.

    Thanks
    Petr

    #748933
    Tom
    Lead Developer
    Lead Developer

    So I just tested the first issue.

    I added two languages to my site and published posts under both languages.

    I then created a Header Element and applied it to all posts.

    The Header Element applies to both languages, as it should.

    Am I testing the above correctly? If so, does it work for you using regular posts?

    For the second issue, try this function:

    add_filter( 'generate_logo_href', function( $url ) {
    	if ( function_exists( 'pll_home_url' ) ) {
    		return pll_home_url();
    	}
    
    	return $url;
    } );
    #749199
    Petr

    Have you tried to make the translation to CTP? Because that was the initial problem…
    I’ll try the logo function tomorrow, and I’ll give you further feedback.

    Thanks
    Petr

    #749265
    Tom
    Lead Developer
    Lead Developer

    I haven’t yet, but posts are just a form of custom post type. Does it happen for you with posts? If not, I’ll add a CPT to test.

    #749851
    Petr

    Hi Tom,

    Logo link: code you provided worked just fine πŸ™‚

    Elements:
    Oh my, I’ve overlooked something very obvious – Elements are translatable, so I have to translate them!
    After translation, everything works fine. I’ve just supposed they are common for all languages.

    So both issues are fine now.

    But I’ve just discovered another one. In the Layout for Events I’ve set up Page Builder width to full (I’m assuming, they’ll be built with Elementor). But sometimes, there is a possibility to use simple default editor. This is the case of the Test event: https://www.playday.cz/work/en/akce/test-event/

    So on GP page settings I’ve selected Page Builder Content > Boxed, but it doesn’t seem to work – width is still 100% wide. It seems the Element Layout settings are still overriding the local ones.

    Note: I’m not sure about the Page Builder settings terms, I have them in Czech, so I hope I tranlated them correctly.

    Thanks again.

    #750198
    Tom
    Lead Developer
    Lead Developer

    Strange, the in-page metabox will overwrite the Layout Element.

    If you deactivate Elementor on that page, what happens?

    #750205
    Petr

    Elementor is not active on the page right from the beginning – that’s actually the point.
    When I activate Elementor on that page, everything is fine: the layout follows Elementor settings (and it’s max-width value).
    But when Elementor’s not active, I don’t want to use the full-width layout, just the standard boxed layout.
    If I deactivate Element Layout for that page (or select boxed layout there), everything is as it should be.

    It just seems, that local lyout settings are not applied over the global settings.

    #750841
    Tom
    Lead Developer
    Lead Developer

    Ah yes, this looks like a real issue. It’s not an easy fix, unfortunately, but I’ll look into it for GPP 1.8.

    For now, you would have to simply exclude that page from your Layout in the Display Rules section. That way the affected page/event would continue using the default layout.

    #2180494
    mohinish

    found the solution.
    Just writing here for any future reader.
    You just need to create elements for additional languages also. I added the elements (basically just added a header) and everything is now working as it shuold.

Viewing 15 posts - 1 through 15 (of 16 total)
  • You must be logged in to reply to this topic.