Problem/Motivation

Currently a methof od sitemap variants generation not so evident.

Proposed resolution

I think we can add a kind of service, that should add the sitemap variant for each enabled domain.

User interface changes

I propose to add a button in domain sitemap settings page, that can run generating sitemap variantions for all enabled domains.

Comments

aleevas created an issue. See original summary.

aleevas’s picture

Status: Needs work » Needs review
StatusFileSize
new12.75 KB
new82.6 KB

Here is the patch that add what I proposed in description of the issue.
How it looks on BO:

settings page

aleevas’s picture

Assigned: aleevas » Unassigned
StatusFileSize
new13.01 KB

Looks like my patch have conflict with patch from # 3109916
So, I decided provide a patch that compatible with taht patch.


!!!WARNING!!!

Use that only if you use that patch from # 3109916

hamrant’s picture

Status: Needs review » Needs work

@aleevas Let's run this part in batch (separated batch operation for each active domain):

public function generateDomainSitemapVariants(array &$form, FormStateInterface $form_state) {
  $active_domains = $this->domainSitemapManager->setSitemapVariantsForEnabledDomain();
  if (!empty($active_domains)) {
    foreach ($active_domains as $active_domain) {
      $message = $this->t('Sitemap variant was created for domain @domain', [
          '@domain' => $active_domain->label()
      ]);
      \Drupal::messenger()->addMessage($message);
    }
  }
}
aleevas’s picture

Assigned: Unassigned » aleevas
aleevas’s picture

Assigned: aleevas » Unassigned
Status: Needs work » Needs review
StatusFileSize
new15.18 KB

@hamrant
thank you for you review!

Your suggestion make sense.

I've added a patch with suggested improvements.
Please review.

duozersk’s picture

Status: Needs review » Needs work
+++ b/domain_simple_sitemap.services.yml
@@ -2,4 +2,7 @@ services:
+domain_simple_sitemap.manager:

This is incorrect spacing - this line should be indented.

duozersk’s picture

Status: Needs work » Needs review
StatusFileSize
new15.19 KB

Here is a fixed patch, I hope.

hamrant’s picture

Looks ok, tested

  • hamrant committed 8d63410 on 8.x-2.x authored by aleevas
    Issue #3177343 by aleevas, duozersk, hamrant: Improving usability of...
hamrant’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.