Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work with properly with translated URLs #37

Closed
Verbat opened this issue Aug 31, 2016 · 23 comments
Closed

Does not work with properly with translated URLs #37

Verbat opened this issue Aug 31, 2016 · 23 comments

Comments

@Verbat
Copy link

Verbat commented Aug 31, 2016

Just wanted to let you know that translated URLs are not shown properly.
Based on the language selection it shows either the standard language or the translated language URLs but not both of them.

@daftspunk
Copy link
Member

Seems to be working over here. Always provide evidence to support your claims. Also make sure you are using the latest version of October and plugins. As per the contribution guidelines, please provide the exact steps you are taking for the issue to occur. This will be used for peer review.

@Verbat
Copy link
Author

Verbat commented Sep 5, 2016

Soory for not being clear.
Edge Updates are enabled.
I'm running October with
Core: 364
Pages: 1.2.10
Sitemap: 1.0.6
Translate: 1.2.4 (forceURL = 0)

Here my steps to reproduce this issue.

  1. Create static pages in English and German, using the URL translation as described in the readme of the translate plugin
  2. Generate a Sitemap with the plugin.
    Add Sitemap Item -> Type: All static pages -> Save

Previewing the Sitemap with the link displayed at the backend it only shows the the urls from the default language, secondary translated language URLs are not included.

I also cleared my cache and logged out of the backend.
If I'm opening domain.com/sitemap.xml it shows only the default language urls.

If I'm switching to my secondary language and open domain.com/sitemap.xml it only shows the urls from the secondory language but not the urls from the default language.

I think no matter what language is selected at the frontend it should always show all URLs (default and additional languages) combined at a single sitemap.xml file.

If i did something wront it would be great if you can point me to the right direction.

Thanks

@kgirzadas
Copy link

kgirzadas commented Oct 19, 2016

+1
Sitemap plugin don't work as expected with Translate plugin and for now it's not usable in multilanguage site.

If translation for page is available sitemap should be generated following these guidelines: https://support.google.com/webmasters/answer/2620865?hl=en

@daftspunk
Copy link
Member

Thanks @Kunilt. We could perhaps tie this in with #40 where there is a need to have multiple sitemaps.

@mariavilaro
Copy link

I really need this functionality for a multilanguage site!

@daftspunk
Copy link
Member

The sitemap plugin needs some significant enhancements, consider submitting a bounty to have this issue addressed sooner.

@mariavilaro
Copy link

mariavilaro commented Dec 1, 2016

Sorry I'm not sure how this bounty thing works, can you point me in the right direction? I need it ASAP for a production site that I developed for a customer so I am more than happy to pay you for it.

Edit: I managed to do it. Thank you for your work.

@mariavilaro
Copy link

Hi, I fixed this in pull request #43 can you review it?

@LukeTowers
Copy link
Contributor

Functionality will be implemented in #52

@CptMeatball
Copy link

Is this implemented yet? Because I can't seem to find any ML references in the generated sitemap?

@LukeTowers
Copy link
Contributor

@CptMeatball Waiting for me to have time to finish reviewing #55

@mariavilaro
Copy link

And for me to have time to make a little modification to work ok with rainlab/translate-plugin#318

@chocolata
Copy link

chocolata commented Jul 9, 2018

Hi guys, what would be the roadmap for allowing multilingual sitemaps in production? This is an important feature when convincing a client to go for an October CMS solution, as Wordpress has lots of plugins that do this out of the box. I appreciate all your work.

@LukeTowers
Copy link
Contributor

@maartenmachiels if you'd like me to take some time to review all of the proposed solutions and get reacquainted with the code on this so I can merge in a final approach to this issue then perhaps you'd be willing to sponsor that. Outside of that, you can use the PR in progress that @mariavilaro has put a lot of work into or wait for me to get around to finalizing the changes.

@mariavilaro
Copy link

Hi @LukeTowers, I posted a bounty on this issue some time ago, if you can take some time to review and merge my changes, please feel free to claim the bounty https://www.bountysource.com/issues/37451356-does-not-work-with-properly-with-translated-urls

@LukeTowers LukeTowers assigned LukeTowers and unassigned daftspunk Sep 23, 2018
@mariavilaro
Copy link

I developed a multi-lingual Seo plugin that takes care of multi-lingual sitemaps https://octobercms.com/plugin/utopigs-seo

@LukeTowers
Copy link
Contributor

@mariavilaro in an effort to steal people's money, BountySource has just announced that they're going to be keeping any bounties older than two years unless the bounty poster emails them at support@bountysource.com to redirect the bounty to another issue.

See below that was just emailed out today:

2.13 Bounty Time-Out.
If no Solution is accepted within two years after a Bounty is posted, then the Bounty will be withdrawn and the amount posted for the Bounty will be retained by Bountysource. For Bounties posted before June 30, 2018, the Backer may redeploy their Bounty to a new Issue by contacting support@bountysource.com before July 1, 2020. If the Backer does not redeploy their Bounty by the deadline, the Bounty will be withdrawn and the amount posted for the Bounty will be retained by Bountysource.

If you would be willing to email support@bountysource.com to redirect your bounty to the Laravel 6 upgrade instead, that would be greatly appreciated: https://www.bountysource.com/issues/75392602-move-to-laravel-6

Alternatively, if you would be fine with me submitting a claim on the original bounty (despite you having written your own plugin as a solution), just let me know and I'll do that.

@mariavilaro
Copy link

No prob, I just sent the email redeploying to Laravel 6 upgrade

@LukeTowers
Copy link
Contributor

Thanks @mariavilaro, I appreciate it!

@daftspunk
Copy link
Member

This should be fixed in the latest version. Ping my username if it is still an issue.

@chocolata
Copy link

chocolata commented Feb 24, 2022

Hi @daftspunk #, I'm on version 1.1.1 and October 2.1.31 but it doesn't seem like the sitemap.xml document picks up the different languages of the site. The URLS don't seem to include the language parameter, and the URL's of the default language are shown. Is there a setting I'm overlooking?

@daftspunk
Copy link
Member

Hey @chocolata, this sitemap plugin supports alternate_locale_urls but by extension only (3333718). There isn't any native support for translated URLs in this plugin.

This issue resulted in the creation of a new plugin that you can use instead. Here is a link:
https://octobercms.com/plugin/utopigs-seo

Alternatively, in future releases, we will recommend building a sitemap like any other CMS page. For example, here is a proposed blog RSS feed. This should give you far greater control over the contents and might be something to consider.

##
url = "/blog/rss.xml"
title = "Blog RSS Feed"

[section blog]

[resources]
headers[Content-Type] = 'text/xml'
==
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>{{ this.page.meta_title ?: this.page.title }}</title>
        <link>{{ 'blog/index'|page }}</link>
        <description>{{ this.page.meta_description ?: this.page.description }}</description>
        <atom:link href="{{ 'blog/rss'|page }}" rel="self" type="application/rss+xml" />
        {% for post in blog %}<item>
            <title>{{ post.title }}</title>
            <link>{{ 'blog/post'|page({ slug: post.slug }) }}</link>
            <guid>{{ post.slug }}</guid>
            <pubDate>{{ post.published_at_date.toRfc2822String }}</pubDate>
            <description>{{ post.featured_text }}</description>
        </item>
        {% endfor %}
    </channel>
</rss>

Note in earlier versions you may need to set the header using PHP code instead of the resources component:

function onStart()
{
    $this->setResponseHeader('Content-Type', 'text/xml');
}

I hope this helps

@chocolata
Copy link

Thanks @daftspunk
I was using the utopigs solution, but mistakenly thought multilanguage support now was integrated into the Rainlab Sitemaps plugin. The utopigs solution is okay, except that it comes with a bunch of other functionality that we're not using.

Will definitely look into creating a sitemap file manually using your proposed solution. Thanks a bunch for your insights.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants