Skip to content

Best practice to retrieve a Content Type in a Controller using the technical name or his alias #15336

Answered by MarGraz
MarGraz asked this question in Q&A
Discussion options

You must be logged in to vote

Hi everyone,

I read here "Refactor IContentAliasManager to IContentHandleManager" that the IContentAliasManager was refactored, and now it's been in use IContentHandleManager, that expose one GetContentItemIdAsync(string handle) method trhough it is possible to retrieve a Content Item by Id: "contentitemid:{the content idem id string}", by slug: "slug:{slug name string}", and by alias: "alias:{alias name string}".

I was interested to retrieve my Content Item by using the alias, and after adding the "Alias" content parts, in my "Index" content item, it was possible to retrieve the Id using the alias, and then search the specific "Index" content item. Here an implementation example (of cour…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@MarGraz
Comment options

@Piedone
Comment options

@MarGraz
Comment options

Answer selected by MarGraz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants