Answer the question
In order to leave comments, you need to log in
How to check page parameter in Yii and show text based on its value?
The site has a category in which there are 1000 posts
On one page 20pcs
It turns out 50 pages
Text is added at the bottom of the category, and it is duplicated on all 50 pages, which is clearly duplicate content
I need code / help in order to do this, that is, show text only on the first category page
Yii 1.1.17
Answer the question
In order to leave comments, you need to log in
You clearly do not understand that there is content duplication, but if necessary, then this:
if everything is implemented correctly, then pagination is done through the ActiveDataProvider, which means you can do this:
in Yii2:
$current = $dataProvider->pagination->page;
if($current == 0){
echo $someMyTextData;
}
$current = $dataProvider->pagination->currentPage;
if($current == 0){
echo $someMyTextData;
}
Can you look towards DataProvider'ov? They do it all themselves, the only question is to change the design of each line.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question