Giter Club home page Giter Club logo

Comments (8)

iamdey avatar iamdey commented on July 17, 2024

@mente suggests to add a host option to dumper command in #16 .
The filesystem generation (I mean the dumper command) is currently not compatible with multiple hosts since each host needs its own sitemap.

What is the size of your sitemap ? May be the dynamic sitemap generation + cache will feet your needs.

from prestasitemapbundle.

Koc avatar Koc commented on July 17, 2024

Problem not in sitemap size, just our SEO-man needed different sitemaps for different subdomains).

Dynamic sitemap generation is very interesting, but we need to know in generator listener what subdonain used.

from prestasitemapbundle.

mente avatar mente commented on July 17, 2024

You can dynamically inject request instance to your listener and check for host. Starting from 2.3.0 Symfony you can use synchronized parameter and request will be dynamically updated depending on current scope. Consider reading scopes doc

from prestasitemapbundle.

Koc avatar Koc commented on July 17, 2024

This works, but we have small problem with code.

There are:

  1. main site main.com
  2. other site with subdomains other.com, ololo.other.com

So I've created routes:

# -------------------- sitemap start
SprosPrestaSitemapBundle:Sitemap:index:
    pattern:  /sitemap.{_format}
    defaults: { _controller: PrestaSitemapBundle:Sitemap:index, sitemap: metallspros }
    host: "%base_host_other%"
    requirements:
        _format: xml

SprosPrestaSitemapBundle:Sitemap:section:
    pattern:  /sitemap.{name}.{_format}
    defaults: { _controller: PrestaSitemapBundle:Sitemap:section, sitemap: metallspros }
    host: "%base_host_other%"
    requirements:
        _format: xml

SprosPrestaSitemapBundle:Sitemap:index_subdomain:
    pattern:  /sitemap.{_format}
    defaults: { _controller: PrestaSitemapBundle:Sitemap:index, sitemap: metallspros }
    host: "{subdomain}.%base_host_other%"
    requirements:
        _format: xml

SprosPrestaSitemapBundle:Sitemap:section_subdomain:
    pattern:  /sitemap.{name}.{_format}
    defaults: { _controller: PrestaSitemapBundle:Sitemap:section, sitemap: metallspros }
    host: "{subdomain}.%base_host_other%"
    requirements:
        _format: xml

PrestaSitemapBundle_section:
    pattern:  /sitemap.{name}.{_format}
    defaults: { _controller: PrestaSitemapBundle:Sitemap:section }
    requirements:
        _format: xml
# -------------------- sitemap end

as you see - I've added new attribute - metallspros. It needed for detecting in listener, what concrete sitemap to generate (we shouldn't generate sitemap for other.com when opening main.com/sitemap.xml).

How it possible do it more clear?

from prestasitemapbundle.

Koc avatar Koc commented on July 17, 2024

Also we cann't use cache because cache key depends only on section name. But we should depends on hostname too

from prestasitemapbundle.

nicolas-bastien avatar nicolas-bastien commented on July 17, 2024

8 month and nothing so what is the plan ?

Continue / close ?

from prestasitemapbundle.

yann-eugone avatar yann-eugone commented on July 17, 2024

@Koc do you want me to work on this ?

from prestasitemapbundle.

yann-eugone avatar yann-eugone commented on July 17, 2024

Closing due to a lack of activity.
Please feel free to reopen if you want to work on this.

from prestasitemapbundle.

Related Issues (20)

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.