Coder Social home page Coder Social logo

Comments (6)

yogoo avatar yogoo commented on July 28, 2024

Hi Spheerys,

I'll need a lot more info than that to help out out.

1.- What do you mean by: « it doesn't work »? Provide me with softwares versions, steps to reproduce, what you expect, what happens instead.

2.- Is the static content of the page loading at all?

3.- What happens when you try with a single basic call such as
[[sitemapFriend]]
or
[[sitemapFriend? &type=xml]]

from sitemapfriend.

Spheerys avatar Spheerys commented on July 28, 2024

OK.
I'm using MODX 2.2.7 with sitemapFriend 1.0.2

I'm confronted to the problem on this webpage : http://dev.jldenois.com/error404

The code I used to do this is :

  <div class="span4">
    <p>Plan du site Français</p>
    [[sitemapFriend? &startId=`50`]]
  </div>

  <div class="span4">
    <p>Sitemap in English</p>
    [[sitemapFriend? &startId=`96`]]
  </div>

..where the startId are the parent of each language.

As you can see, the generated sitemaps are the same, despite the differents startId.
If I try to make uncached call, the generated sitemaps switch to english. But I can't have the right two sitemap : french AND english.

Strange isn't it ?

from sitemapfriend.

yogoo avatar yogoo commented on July 28, 2024

Thanks for the details, I was able to reproduce the issue.

There's an odd behavior from Modx when calling $modx->getservice() multiple times on a single resource from within a snippet. It's unclear wether the bug originates from sitemapFriend or Modx. I'll need to investigate this further with the core team. It will take some time.

In the meantime and in your specific case, you could generate one 404 page for each language.
Since this organization would preserve the website's url scheme, it will be more consistent than having a single multi-language 404 page. It also scales better (think "more languages") and shrink better (think "independent languages", ie. less maintenance). Finally this might be an acceptable workaround until the issue is resolved.

Updates on the topic will be posted here.

from sitemapfriend.

Spheerys avatar Spheerys commented on July 28, 2024

Thanks for the analyse.
About the 2 error pages, one for each language : yes it should be the best idea, but I though MODx can only setup ONE error page (or maybe one per context, but I don't want to use context to manage bilinguism).

Anyway... I will wait for an issue, and for now I will keep only one french error page. It's best than no error page... :)

from sitemapfriend.

yogoo avatar yogoo commented on July 28, 2024

Another way to handle it is to serve a localized 404 page via a snippet that would look for the language string in the referer to set the startId and fall back to the browser locale in case the referer isn't set. If both fail, fallback to French.

from sitemapfriend.

yogoo avatar yogoo commented on July 28, 2024

Multiple calls can now be done on the same page (tested in modx 2.2.12-pl traditional). The issue was lying within modx.

from sitemapfriend.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.