- Posts: 404
COMMUNITY FORUM
Only show leading on first page
- Odin Mayland
- Topic Author
- Offline
- Platinum Member
Less
More
6 years 9 months ago #166568
by Odin Mayland
Only show leading on first page was created by Odin Mayland
Is there a way to only show the leading item on the first page?
First page example:
www.racmonitor.com/monitor-mondays-podcasts
I do not want the leading article to show on all the following pages like:
www.racmonitor.com/monitor-mondays-podcasts?limit=5&start=5
First page example:
www.racmonitor.com/monitor-mondays-podcasts
I do not want the leading article to show on all the following pages like:
www.racmonitor.com/monitor-mondays-podcasts?limit=5&start=5
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
6 years 9 months ago #166605
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Only show leading on first page
Hello Jeff,
This snippet will determine if you are in the first page or not.
This way, in your overrides you can show/ hide or alter elements.
<?php if (JRequest::getInt('limitstart')) $paged = true; else $paged = false; ?>
This way, in your overrides you can show/ hide or alter elements.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Odin Mayland
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 404
6 years 9 months ago - 6 years 9 months ago #166638
by Odin Mayland
Replied by Odin Mayland on topic Only show leading on first page
This looks awesome!
Can you confirm where this should go? If in category.php, then which line?
Can you confirm where this should go? If in category.php, then which line?
<!-- Item list -->
<div class="itemList">
<?php if(isset($this->leading) && count($this->leading)): ?>
<!-- Leading items -->
<div id="itemListLeading">
<?php foreach($this->leading as $key=>$item): ?>
<?php
// Define a CSS class for the last container on each row
if((($key+1)%($this->params->get('num_leading_columns'))==0) || count($this->leading)<$this->params->get('num_leading_columns'))
$lastContainer= ' itemContainerLast';
else
$lastContainer='';
?>
<div class="itemContainer<?php echo $lastContainer; ?>"<?php echo (count($this->leading)==1) ? '' : ' style="width:'.number_format(100/$this->params->get('num_leading_columns'), 1).'%;"'; ?>>
<?php
// Load category_item.php by default
$this->item = $item;
echo $this->loadTemplate('item');
?>
</div>
<?php if(($key+1)%($this->params->get('num_leading_columns'))==0): ?>
<div class="clr"></div>
<?php endif; ?>
<?php endforeach; ?>
<div class="clr"></div>
</div>
<?php endif; ?>
Last edit: 6 years 9 months ago by Odin Mayland.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
6 years 9 months ago #166651
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Only show leading on first page
That file, yes. I would place it above the <!-- Item list comment.
Then you can control your layout with the $paged variable (boolean) with an if/ else statement.
Then you can control your layout with the $paged variable (boolean) with an if/ else statement.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.