/city/london/1234 のような URL を作成することをお勧めします。最後の部分はドキュメントの ID です。Umbraco に組み込まれている UrlRewrite 関数を使用すると、URL を内部的に /city.aspx?name=london&id=1234 に書き換えることができます。/config/Urlewriting.config では、書き換えルールを追加できます。上記の場合、次のようなものが必要です。
<add name="city_rewrite"
virtualUrl="^~/city/(.*)/(.*)"
rewriteUrlParameter="ExcludeFromClientQueryString"
destinationUrl="~/city.aspx?name=$1&cityid=$2"
ignoreCase="true" />
これを整理したら、City.aspx マクロのコード ビハインドで次のコードを使用して、対応するドキュメントを取得できます。
// get the city Document Id from the querystring
string cityID = HttpContext.Current.Request.QueryString["cityid"];
if (!string.IsNullOrWhiteSpace(cityId))
{
// get the cityNode
Node cityNode = new Node(cityId);
// do whatever you want with this node, like display it's data
}
これは .NET マクロですが、もちろん XSLT や Razor コードでも同じことができます。