You can do it as David suggested. I would maybe add .TopN(1) parametrization or, you could just select page in given NodeAliasPath or, with given NodeParentNodeID and use the .ClassName("className") parameter. Please see the API examples
If you want to use macros, here are some samples to give you some ideas, but keep on mind the performance!
- If the page of type A will be always the first child:
{% Documents["/folder"].Children.FirstItem.AbsoluteURL %}
- In case there are more pages of the same type, use the FirstItem for example or, you will need to specify which item to select:
{% Documents["/folder"].Children.ClassNames("page.type.A").WithAllData.FirstItem.AbsoluteURL %}
- And if you want go fancy, you could use something like this: {
%Documents .Columns("<set the page type A fields you want to use separated by comma>") .ClassNames("page.type.A") .WithAllData .Where("NodeAliasPath LIKE '/folder/%'") .OrderBy("NodeID DESC") .ApplyTransformation("transformation.code.name"); |(recursive)true#%}
The Columns should list the columns from the page you want to display in the transformation - it is similar to e.g. repeater web part Columns property. I would recommend using at least these ones as some of the transformation methods need them: NodeAliasPath, DocumentURLPath, NodeAlias. And the transformation could be just standard ASCX or txt transformation as you would use with a repeater.
You can also replace the /folder node alias path with a macro if you want to have it dynamic too. But it adds more complexity and I just wanted to list some macro examples.