Keyword

Only show leading on first page

  • Odin Mayland
  • Odin Mayland's Avatar Topic Author
  • Offline
  • Platinum Member
More
9 months 1 week ago #166568 by Odin Mayland
Odin Mayland created the topic: Only show leading on first page
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.

More
9 months 4 days ago #166605 by Krikor Boghossian
Krikor Boghossian replied the 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.

IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

---
JoomlaWorks
www.joomlaworks.net/

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

  • Odin Mayland
  • Odin Mayland's Avatar Topic Author
  • Offline
  • Platinum Member
More
9 months 4 days ago - 9 months 4 days ago #166638 by Odin Mayland
Odin Mayland replied the 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: 9 months 4 days ago by Odin Mayland.

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

More
9 months 4 days ago #166651 by Krikor Boghossian
Krikor Boghossian replied the 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.

IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

---
JoomlaWorks
www.joomlaworks.net/

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

Moderators: william white