Keyword

Only show leading on first page

  • Odin Mayland
  • Odin Mayland's Avatar Topic Author
  • Offline
  • Platinum Member
More
6 years 2 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

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
6 years 2 months ago #166605 by Krikor Boghossian
Replied by Krikor Boghossian on topic Only show leading on first page
Hello Jeff,
<?php if (JRequest::getInt('limitstart')) $paged = true; else $paged = false; ?>
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.

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
  • Odin Mayland's Avatar Topic Author
  • Offline
  • Platinum Member
More
6 years 2 months ago - 6 years 2 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?
<!-- 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 2 months ago by Odin Mayland.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
6 years 2 months ago #166651 by Krikor Boghossian
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.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum