An Adobe Commerce Architect needs to scope a bespoke news section for a merchant's Adobe Commerce storefront. The merchant's SEO agency requests that the following URL structure:
news/{date}/{article_url_key}l where {date} is the publication date of the article, and {article_url_key} is the URL key of the article.
The Architect scopes that a news entity type will be created. The date and URL key data will be stored against each record and autogenerated on save. The values will be able to be manually overridden.
The Architect needs to manage routing this functionality and adhere to best practice.
Which two options should the Architect consider to meet these requirements? (Choose two.)
Correct Answer: A,E
Explanation
creating a custom router involves several steps, such as:
* Creating a routes.xml file to declare a custom route ID and front name
* Creating a Router.php file to define the custom router class that extends Magento\Framework\App\Router\Base
* Creating an etc/di.xml file to register the custom router class with a specific sortOrder
* Creating controller classes and action methods to handle the requests Based on these steps, I would say that two possible options that the Architect should consider to meet these requirements are:
* A. Create a standard controller route and an Index/Index index controller class that loads the relevant news article by matching the URL date and URL key parts.
* E. 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.