Is Page variable UniqueId unique on filename only or directory/filename?

I’ve come across an issue with the non-uniqueness of this UniqueId when using the isTranslated variable.

On a site with a structure like this

/about/… (etc)
/services/… (etc)

When I include the partial example here I get issues because the services/ has the same UniqueId as the about/ and therefore they both thing they have a translation.

Same occurs for any other file.

The workaround at the moment is to make sure the filenames are unique across the whole site, but should the UniqueId not be “more” unique…

Many thanks for any thoughts,

The translations doesn’t use the UniqueID to detect translations. Please create an issue on GitHub so we could do something better about this.

@abourget implemented this logic so he may have some insight, but as I read his code:


All represents translations of the same content file. I see the problems in your case, but I’m not sure what the “correct” key would be here.

To answer your question: The UniqueID is built on path + filename, so that is unique.

1 Like

thanks bep - will do