1/8/2024 0 Comments Kentico tinyurl apiPublic PageController(IPageUrlRetriever pageUrlRetriever) Controller constructor that receives an IPageUrlRetriever instance using dependency injection Private readonly IPageUrlRetriever pageUrlRetriever any language prefixes in the URL path or the domain in the absolute URL (see Configuring URLs for multilingual websites to learn more). The URL is automatically adjusted for the current culture, i.e. AbsoluteURL – the page's absolute URL, including the scheme and domain name.RelativePath – the virtual path of the specified page, which you can resolve to an application absolute path at runtime (for example using the UrlHelper.Content method).The IPageUrlRetriever.Retrieve method returns a PageUrl object, with properties containing the given page's URL: string containing a node alias path value, representing the page's location in the Xperience content tree.TreeNode object representing the page (or a specific page type class inheriting from TreeNode).Call the service's Retrieve method, and use one of the following parameter types to specify the page:.Obtain an instance of the IPageUrlRetriever service (for example through dependency injection in your controller constructor).To get the URL of a page in general code: You may need to get the URLs of retrieved pages in various scenarios, such as rendering navigation menus or other page links, performing redirects, etc. This allows content editors to create new pages or adjust the URLs of existing ones in the administration interface, without the need to update and redeploy the code of the MVC application. Pages in the content tree of Xperience websites can have their live site URLs generated by the system, either through content tree-based routing or according to URL patterns set for page types. This filter ensures that links added by content editors into page content work correctly, even if you do not explicitly handle URL resolving in your code. The URLs are processed on the side of the MVC application, based on the environment where the site is actually running. The system provides page output filtering functionality that automatically resolves all virtual relative URLs to their absolute form.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |