Kentico 11, custom unipager

Stepan Ryabukhin asked on June 26, 2020 15:11

Hi all! I use a customunipager that inherits from the unipager. How to make the NextPageTemplate inaccessible if there are no further pages? I ovveride method OnInit and I configure NextPageTemplate so NextPageTemplate = TransformationHelper.LoadTransformation(this, "[<li class=\"paginator__item\"><a href=\"{%NextURL%}\">Next</a></li>]");

I configure the PreviousPageTemplate so

PreviousPageTemplate = TransformationHelper.LoadTransformation(
                    this, this.CurrentPage != 1
                        ? "[<li class=\"paginator__item\"><a href=\"{%PreviousURL%}\">Previous</a></li>]"
                        : "[<li class=\"paginator__item paginator__item--inactive\">Previous</li>]");

Image Text

I need such a result Image Text

Recent Answers

Brenden Kehren answered on June 27, 2020 05:27

I believe you can set a property by default to say hide or show next/prev automatically. I don't remember the property name but I know it exists so no need to rewrite the code

0 votesVote for this answer Mark as a Correct answer

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