I’m trying to getAliasbyId but be context-aware. I saw that we used to have an extra called aliasId that appears to have had this functionality. But it’s no longer available.
Below is a version of the solution from the previous thread. In attempts to do what I’ve described above, I’m trying to set placeholders for the resources within each context all based on the alias so that I can return the ID and possibly other information like pagetitle.
For example: I have a page called “Home” in each context that I want to set as the site_start for each context. Things that I’ve tried have all come back with the ID of that page in the web context.
I used an “ad hoc” chunk, because I was too lazy to create an actual chunk. This might be faster than calling getChunk(), but using str_replace(), rather than process() or getChunk(), would be faster still. It would also be more “correct” to use an outer Tpl like the following, but it would be slower.
I’m not sure I understand exactly what you are trying to do. But if you are trying to query a resource based on its alias and context, then code like this should work: