QuestionQ12
Design and implement optimal solutions for Adobe Commerce to meet business needsAn Adobe Commerce Architect must scope a bespoke news section for a merchant’s Adobe Commerce storefront. The merchant’s SEO agency requests the following URL structure: news/\{date\}/\{article_url_key\}, where \{date\} is the article’s publication date and \{article_url_key\} is the article URL key.
The Architect determines that a news entity type will be created. The date and URL-key data will be stored on each record and generated automatically on save. Both values can be manually overridden.
The Architect needs to manage routing for this functionality while following best practice.
Which two options should the Architect consider to meet these requirements?
Choose two
- A Create a standard controller route and mapping the internal URLs (such as news/article/view/id/1) to rewrites that are generated on save and then stored in the URL rewrites table.
- B Create a custom router that runs before the standard router and matches the news portion of the URL, then looks for and loads a news article by matching the date and URL key parts of the URL.
- C Create a plugin that intercepts Magento\Framework\App\Action::execute(), looks for the news portion of the URL, and if it matches, loads the relevant news article by matching the URL date and URL key parts.
- D Create a standard controller route and an Index/Index controller class that loads the relevant news article by matching the URL date and URL key parts.
- E Create an observer that listens to the controller_front_send_response_before event, looks for the news portion of the URL, and if it matches, loads the relevant news article by matching the URL date and URL key parts.
Community Discussion