trying to get clean URLs for list items in reddot CMS

188 views Asked by At

We have the following code used to present a list of URLs:

<reddot:cms>
                                                  <foreach itemname="childPages" object="Context:Indexes.GetIndexByPageId(Guid:021743AA8509473C9615A4BA5C2BAC32).SubIndexes" countername="pageCounter">
                                                    <htmltext><dd><a href="<%!! Store:childPages.GetUrl(Bool:True)  !!%>"><%!! Store:childPages.Headline !!%></a></dd></htmltext>
                                                  </foreach>
 </reddot:cms>

and want to return clean urls from <%!! Store:childPages.GetUrl(Bool:True) !!%> so http://www.mysite.com/thispage.htm is published as http://www.mysite.com/thispage I have tried:

 <reddot:cms>
                                                  <foreach itemname="childPages" object="Context:Indexes.GetIndexByPageId(Guid:4595E6AE30D243E6AB11DAE0553A90B7).SubIndexes" countername="pageCounter">
                                                    <htmltext><dd>
<%
 DocSectionURL = "<%!! Store:childPages.GetUrl(Bool:True)!!%>"
 DocNewSectionURL = Replace(DocSectionURL,".htm","")
%>
<a href="<% response.write(DocNewSectionURL) %>"><%!! Store:childPages.Headline !!%></a></dd></htmltext>
                                                  </foreach>
</reddot:cms>

but www.mysite.com/thispage.htm is still returned. Could anyone help suggest the best way to try to do this please? I have manged to use a similar method with placeholders but with this RQL it does not work. Many thanks in advance.

1

There are 1 answers

0
Hilmar Bunjes On

you cannot do this within PreExecute or Rendertags. The final URL is created after the RenderTags and PreExecute has run.

Either you could publish your files without ".htm" as extension (just insert a "." as extension in the settings) or you adjust the URLs via PHP/ASP/ASPX/... on the delivering server (Apache, IIS, DS, ...).

Best, Hilmar Bunjes