Coder Social home page Coder Social logo

About getFeedItemLink method about feedbundle HOT 6 CLOSED

eko avatar eko commented on July 20, 2024
About getFeedItemLink method

from feedbundle.

Comments (6)

eko avatar eko commented on July 20, 2024

Hi,

Yes, good idea. I will think of it in the next days because I'm currently on holidays for the rest of the week.

Thank you for your analyze and don't hesitate to send me a pull request if you have a particular idea on this topic.

from feedbundle.

topwebstudio avatar topwebstudio commented on July 20, 2024

I am looking at a similar bundle - https://github.com/prestaconcept/PrestaSitemapBundle
It's done externally when looping through results, maybe this is the way to go here too?

public function boot()
    {
        $router = $this->container->get('router');
        $event  = $this->container->get('event_dispatcher');

        //listen presta_sitemap.populate event
        $event->addListener(
                SitemapPopulateEvent::onSitemapPopulate, 
                function(SitemapPopulateEvent $event) use ($router){
                    //get absolute homepage url
                    $url = $router->generate('homepage', array(), true);
                    //add homepage url to the urlset named default
                    $event->getGenerator()->addUrl(new UrlConcrete(
                            $url, 
                            new \DateTime(), 
                            UrlConcrete::CHANGEFREQ_HOURLY, 
                            1), 'default');
                });
    }

from feedbundle.

eko avatar eko commented on July 20, 2024

Thank you, I think I will implement something similar but I need to let people able to use a custom URL so if people want to use a custom one, they were be able to, otherwise they will just need to put the route name in the configuration of their feed.

I'll let you know about this!

from feedbundle.

topwebstudio avatar topwebstudio commented on July 20, 2024

Okay thanks!

from feedbundle.

eko avatar eko commented on July 20, 2024

Hi, thanks to @RobMasters contribution you can now use the Symfony router component in the bundle to generate your items links.

Thank you for your suggestion and have fun with it :)

from feedbundle.

topwebstudio avatar topwebstudio commented on July 20, 2024

Looks great I'll try it! Thanks!

from feedbundle.

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.