Kentico UniPager Pagination bezwzględne linki URL

kit_ru kit asked on December 20, 2021 13:28

UniPager Pagination. Is it possible to put absolute links instead of relative ones in "PreviousGroupURL" and "NextGroupURL"?

<PreviousGroupTemplate>
    <a href="<%# Eval("PreviousGroupURL") %>">...</a>
</PreviousGroupTemplate>
<NextGroupTemplate>
    <a href="<%# Eval("NextGroupURL") %>">...</a>
</NextGroupTemplate>

Recent Answers


Brenden Kehren answered on December 21, 2021 16:47

In your transformation use something like:

<%# GetAbsoluteUrl(Eval<string>("NextGroupURL")) %>

From https://devnet.kentico.com/docs/11_0/api/html/Methods_T_CMS_Helpers_URLHelper.htm

0 votesVote for this answer Mark as a Correct answer

kit_ru kit answered on December 22, 2021 08:46

Brenden Kehren, I tried that way. it works for "PreviousURL" and "NextURL", but not for "PreviousGroupURL" and "NextGroupURL"

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on December 22, 2021 13:37 (last edited on December 22, 2021 13:37)

Define doesn't work. What are the results?

0 votesVote for this answer Mark as a Correct answer

kit_ru kit answered on December 22, 2021 14:55 (last edited on December 23, 2021 09:33)

Brenden Kehren, In my code I have this:

    <PreviousPageTemplate>
        <a href="<%# URLHelper.GetAbsoluteUrl(Convert.ToString(Eval("PreviousURL", true))) %>" >Previous</a>
    </PreviousPageTemplate>
    <NextPageTemplate>
                <a href="<%# URLHelper.GetAbsoluteUrl(Convert.ToString(Eval("NextURL", true)))%>">Next</a>
            </NextPageTemplate>
            <PreviousGroupTemplate>
                <a href="<%# URLHelper.GetAbsoluteUrl(Convert.ToString(Eval("PreviousGroupURL", true))) %>">...</a>
            </PreviousGroupTemplate>
            <NextGroupTemplate>
                <a href="<%# URLHelper.GetAbsoluteUrl(Convert.ToString(Eval("NextGroupURL", true)))%>">...</a>
            </NextGroupTemplate>

but in the source page I have html:

`<div class="pagination">                  
            <a href="http://local/en/test">Previous</a>                         
            <a href="/en/test">1</a>           
            &nbsp;           
            <span>2</span>           
            &nbsp;          
            <a href="/en/test?strona=3">3</a>                          
            <a href="http://local/en/test?strona=3" >Next</a>
            </div>`
0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.