Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
I have noticed that only Nodes set to "English" appear with an alias, while all nodes setted to "Hebrew" appear only with a permalink...
I should note that all nodes whatsoever, whether in Hebrew or English, have an English alias.
Comments
Comment #2
gbyte CreditAttribution: gbyte as a volunteer and commentedHi, according to your screenshot your sitemap was generated successfully. In order to add more content you will have to go to entity bundle pages (for the node type, it would be 'page' or 'article'). There you can add all entities of that bundle. Please see the readme file in the module directory.
Feel free to reopen the issue if you need more support.
Comment #3
Benia CreditAttribution: Benia commentedHi. Thanks for the data. I ran cron and there was formed a sitemap seemingly including all the pages in the site.
Just one last question - It seems only a small portion of the node addresses includes aliases... Most node addresses include only the permalink (i.e node/123). Shouldn't it always be that way? The advantage I could see for including the permalink is that it's more stable and generally doesn't require redirects.
Comment #4
gbyte CreditAttribution: gbyte as a volunteer and commentedAliases would be the usual way to go; to do that you will have to set an alias manually while creating each node or install the pathauto module which will do it for you.
Comment #5
Benia CreditAttribution: Benia commentedBut all nodes in the site already has aliases which I set manually each time I create a node.
There are no nodes without aliases in the site.
Given that situation, I try to understand why permalinks appear in about 92% of the Sitemap links...
Comment #6
Benia CreditAttribution: Benia commented.
Comment #7
Benia CreditAttribution: Benia commentedComment #8
Benia CreditAttribution: Benia commentedClarification would be most appreciated about the permalink issue.
Comment #9
gbyte CreditAttribution: gbyte as a volunteer and commentedFrankly I have yet to face this issue. Maybe this has something to do with translation? Will have to do some investigation in the near future.
Comment #10
Benia CreditAttribution: Benia commentedYour suggestion is interesting. I have now noticed that only Nodes setted to "English" appear with an alias, while all nodes setted to "Hebrew" appear only with a permalink...
I should note that all nodes whatsoever, whether in Hebrew or English, has an English-alias.
Given that piquant information, do you have any idea why indeed Hebrew-categorized nodes are represented in the sitemap only with a permalink?
Ben,
Comment #11
gbyte CreditAttribution: gbyte as a volunteer and commentedI haven't investigated due to lack of time, but at first sight it seems setting the language on the URL object like so:
and then getting the URL string like so
returns an unaliased path. The above code is located here, I am happy to review patches.
Comment #12
Benia CreditAttribution: Benia commentedI am a humble PHP learner; I can read much of the PHP file quite comfortably and a bit change it per instructions but not really inventing or extending the modularity.
The moment you would tell me what to check in my side I will gladly do so; I suggest writing stepped instructions if more learners like me tries to check and report from their side...
Comment #13
Benia CreditAttribution: Benia commentedBTW, given the fact I just learn basic PHP, I want to ask you if its even problematic that Google get only the permalinks?
Do you think it is dangerous or problematic for non-English website owners to send Google an XML sitemap only (or mostly) with permalinks?
AFAIK, Google and any other major SE like Bing, always crawls a page and get its alias; I am sure 99% that it will happen this time and the SERP will display aliases, but I can't say for sure given the fact I never sent an XML sitemap that includes permalinks (in Drupa 7 it was always aliases).
Would thank you dearly for your take on this.
Comment #14
gbyte CreditAttribution: gbyte as a volunteer and commentedGoogle swallowing permlinks instead of the aliases is not problematic at all, in some cases it might even be beneficial. The question remains however why the URL class returns permlinks for localized paths instead of aliases...
Comment #15
Benia CreditAttribution: Benia commentedIndeed, and BTW what you say is very interesting to me. If you have spare 4 minutes, can you please tell me as a sidenote why it might be beneficial? I believe I will learn from it! Thanks !!!
Comment #16
gbyte CreditAttribution: gbyte as a volunteer and commentedSure, it's because the permlink doesn't change and the alias can be changed manually or automatically (through pathauto module etc) and the old indexed alias would lead to a dead page until next sitemap generation.
Comment #17
Benia CreditAttribution: Benia commentedOh yes, indeed. From Drupal 7 I am used to use (global)Redirect but indeed sending permalinks can save even that.
Great then, I'll use it as it is...
BTW, I humbly suggest adding an option (might be even the default) to send permalinks / Aliases. Or else, sending only permalinks in any case...
Comment #18
Benia CreditAttribution: Benia commentedInteresting discussion regarding the permalink/aliases issue in Stackexchange ProWebmasters:
http://webmasters.stackexchange.com/questions/98321/can-an-xml-sitemap-h...
Comment #19
gbyte CreditAttribution: gbyte as a volunteer and commentedThanks, I've looked at the stackexchange answers but am unable to find anything which would benefit this discussion.
I am not sure why core sometimes puts out permalinks instead of aliases, but maintain that this is an esthetic issue at most and is irrelevant to functionality, especially because the sitemap is meant to be viewed by bots only.
Hence closing as "won't fix".
Comment #20
Benia CreditAttribution: Benia commentedWith time, I've come to prefer a sitemap that puts only permalinks: Aliases can change, and not always we have redirects, hence, permalinks is best.
Would you make the module to create a only-permalink links?
This could solve any future language-problem.
Comment #21
Benia CreditAttribution: Benia commentedPlease see my comment above.
Comment #22
gbyte CreditAttribution: gbyte as a volunteer and commentedIn case an alias changes (which is rare), so does the link in the sitemap after next generation - no harm done. I would prefer to invest my time in other more pressing issues, but will gladly review patches if anyone would be willing to implement this as an optional feature triggered by a setting.
Comment #23
Benia CreditAttribution: Benia commentedI can guarantee it isn't that rare in many sites as I work much with content in different sites of different types and business contexts.
Moreover, when there isn't an efficient redirect mechanism, or even knowledge of the process of creating 301's in .htaccess, harm can indeed be made.
As you already got my recommendation to make the module send permalinks and not aliases, I think my job here is done. I am not a PHP-SQL programmer but if I were, I would patch this without any doubt.
Comment #24
gbyte CreditAttribution: gbyte as a volunteer and commentedThe module generates permlinks instead of aliases for non-default languages because of a core bug, see #2689459: If you don't want to translate your URL alias, the original URL alias won't work with your translations.
This has to be fixed in core. The workaround is to make aliases tranlatable and translate them.
Comment #25
gbyte CreditAttribution: gbyte as a volunteer and commentedComment #26
BarisW CreditAttribution: BarisW at LimoenGroen commentedJust found out the following:
- My nodes are Dutch
- If they have a Dutch alias, the permalink is used in the sitemap.xml
- If I change the alias to language undefined, the alias is used in the sitemap.xml
This seems like a bug in the module, right?
Comment #27
gbyte CreditAttribution: gbyte as a volunteer and commented@BarisW Did you take a look at the linked Drupal core issue and the workaround above?