Display pagination on both top and bottom K2 joomla - joomla

Pagination is working fine displaying on the bottom of the page.The issue is that I want to display pagination on both above & bottom of the page.
Help appreciated!!

You should be able to do this by adding in a template override. Copy the files in JOOMLA SITE/components/com_k2/templates into JOOMLA SITE/templates/YOUR TEMPLATE/html/com_k2. This means putting the pagination at the top will not be overriden in the event of a k2 update
Then just copy the pagination code to the top of the page.
e.g. for the category section (file default/category.php) you should find on line 252 (in version 2.6.1)
<!-- Pagination -->
<?php if(count($this->pagination->getPagesLinks())): ?>
<div class="k2Pagination">
<?php if($this->params->get('catPagination')) echo $this->pagination->getPagesLinks(); ?>
<div class="clr"></div>
<?php if($this->params->get('catPaginationResults')) echo $this->pagination->getPagesCounter(); ?>
</div>
<?php endif; ?>
Just by coping this code to the top of the page (circa line 131) you should get a second set of pagination!!

Related

Magento: how to display products on owl-carousel

I'm using magento 1.9.3 and I want to display featured products in home page in an owl carousel.
I have a method in the block of my module that returns me the collection I want to show in the carousel. I call it from my template like this:
$_productCollection=$this->getFeaturedProducts();
I found a previous question in stack overflow about this: Owl Carousel - Magento Products
and following this previous question I arrived to this in my template:
<div class="owl-carousel">
<?
$products = $this->getFeaturedProducts();
foreach ($products as $_product) { // iterate through the entire collection
echo '<div class="item"><img src='.$this->helper('catalog/image')->init($_product, 'small_image')->keepFrame(false)->resize($_imgSize).'></div>'; // print the image url inside of the required Owl markup
}
?>
</div>
But the div of owl-carousel is not displayed. If I inspect the page, the div is there, and the images inside too, but nothing is displayed. If I delete the owl-carousel class I see all the images displayed in list.
I installed the extension "Responsive Owl Slider" from magento connect, and I have another owl carousel on top of page made with the admin cms that shows image slides (not products) and it's working fine. The only one that fails is the one that I'm trying to do by code.
I see that the owl-carousel class has a display: none so obviously is not displaying anything, but if I delete the display: none it shows all the images at the same time, not a carousel.
How do I display my selected products in an owl carousel?
Please try this extension
https://www.magentocommerce.com/magento-connect/new-products-2.html
Hope it's helpful for you.
First go to the link >> https://magento.stackexchange.com/questions/83912/featured-products-on-homepage
Create all files to following answers.
Then open featured.phtml
copy and paste below code
<?php
$_helper = $this->helper('catalog/output');
$_productCollection = $this->getProductCollection();
?>
<div class="featured-products">
<ol class="featured-products-list owl-carousel" id="featured-products-list">
<?php foreach ($_productCollection as $_product): ?>
<li><img src="<?php echo $this->helper('catalog/image')->init($_product, 'thumbnail')->resize(200) ?>" alt="<?php echo $this->escapeHtml($_product->getName()) ?>" /></li>
<?php endforeach; ?>
</ol>
</div>
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery(".owl-carousel").owlCarousel();
});
</script>
Please don't forget create attribute and assign for products.

Joomla 3.36 - Browser Page title

Hi I go to menu page display and enter text into the Browser Page title field but
It does not change the browser page title.
Does anyone have any ideas what could create this issue?
I've had this situation occur most frequently with 3rd party components. Joomla stores these values when you specify them in the menu item, but it's up to the component whether or not they're used. Below is the code I've added to the template overrides. If you don't know how to override template output, you should read How to override the output from the Joomla! core first.
Put this code before any other HTML code in the template override file. It checks to see if you've specified to show the page headings or not, and if so, it will use that, otherwise it will use whatever the menu title is.
<?php if ($this->params->get('show_page_heading',1)) : ?>
<h1><?php echo $this->params->get('page_heading') ? $this->params->get('page_heading') : JFactory::getApplication()->getMenu()->getActive()->title; ?></h1>
<?php endif; ?>
To see how Joomla does it by default, look at components\com_content\views\article\tmpl\default.php
<div class="item-page<?php echo $this->pageclass_sfx?>">
<?php if ($this->params->get('show_page_heading', 1)) : ?>
<div class="page-header">
<h1> <?php echo $this->escape($this->params->get('page_heading')); ?> </h1>
</div>
<?php endif;

How do I add pages to menu?

I am new to Magento; now I am trying to develop a simple example site.
My question is this: how can we add pages to main menu?
create one static block with "Your page name"
Create new category with display mode "Static block only" and "include in navigation menu = YES" and select your cms block and save category. And see in front-end side this will be added in navigation item.
Here is the official Magento recommendation on how to do this: http://www.magentocommerce.com/knowledge-base/entry/adding-page-links-in-the-navigation-bar
To add a CMS page link to top navigation the hard way, you should override /mnt/www/x1886/app/design/frontend/default/default/template/catalog/navigation/top.phtml.
There are plenty tutorials out there about how to override files in Magento.
Change a change where I placed a comment:
<div class="header-nav-container">
<div class="header-nav">
<h4 class="no-display"><?php echo $this->__('Category Navigation:') ?></h4>
<ul id="nav">
<!-- ADD ADDITIONAL LINKS HERE -->
<?php foreach ($this->getStoreCategories() as $_category): ?>
<?php echo $this->drawItem($_category) ?>
<?php endforeach ?>
</ul>
</div>
<?php echo $this->getChildHtml('topLeftLinks') ?>
</div>

Product category name on product viewing page

I'm working on a website. Upon clicking the product it shows all the details of it. But my client want me to show parent category of categroy of the product at top, above the image. Please help me about it. I'm a budding developer.
Try this may be help someone else.
<?php $_helper = $this->helper('catalog/output');?>
<?php $_category_detail=Mage::registry('current_category');?>
<?php $_category_detail->getName();?>
<?php $_category_detail->getId(); ?>
You can get the category data from your product object: $_product->getCategory()->getName();. You will have to edit the template at template/catalog/product/view.phtml. In the template file look for <div class="product-img-box"> and add:
<div class="product-img-box">
<h4><?php echo $_product->getCategory()->getName(); ?></h4>
<?php echo $this->getChildHtml('media') ?>
</div>

Custom top level category landing page in magento

Within our magento site we have the root category for the shop (this is just "default category"). Under this we have set-up some top-level categories (let's for example call these "electronics" and "furniture"), with a bunch of sub categories.
So as an example our category structure might be
Electronics
DVD players
MP3 Players
Computers
Furniture
3 Piece's
Armchairs
Tables
Sofabeds
I have managed to edit the layout/template for the "sub categories" such as "dvd players" so that we display a custom product list view.
Now what we want to do, is for the top level categories (the very first categories under the root category), is display a custom grid of all the subcategories and their associated thumbnail images, not the product list!
How do i assign a completely different template just for those top level categories?
If someone could provide an insight on how to do this and the step's we need to take (i should be ok with the code itself, its just how to implement it such as custom modules and templates)
Thanks
Sounds like you want a custom page layout that you can apply to your top level categories. A page layout is essentially a named page template that you can select in a dropdown to apply to products or categories.
To define a layout, add it in the global/page/layouts node of a module's config.xml, like so:
<global>
<page>
<layouts>
<my_custom_layout_name translate="label">
<label>My Custom Layout</label>
<template>page/my-custom-layout.phtml</template>
<layout_handle>my_custom_layout</layout_handle>
</my_custom_layout_name>
<layouts>
<page>
<global>
Then you just need to create the page/my-custom-layout.phtml template file somewhere in the app/design template fallback chain.
The layout_handle node specifies the name of a new layout handle that will be added to any page that uses this layout, allowing you to target it in layout XML files with a <my_custom_layout> node.
The .phtml file you're referencing will be the template for the entire HTML page, so it should include <html>, <head>, <body> tags and anything else you'd find in one of the default page/*.phtml templates (1column, empty, 2columns-left, etc). Between this and targeted layout XML, you can completely customize this page from scratch.
The final step is just to select this new layout under the "Custom Design" tab when editing each of your parent categories in Catalog->Manage Categories. If you don't see your layout in the dropdown, make sure your XML is configured properly (see app/code/core/Mage/Page/etc/config.xml for reference) and refresh your cache.
One way to do this would be to create a new template which which will be your category grid, then call that template as a static block on your selected categories, which you will select via the CMS. See below.
Create the category grid template
Navigate to “app/design/frontend/default/TEMPLATE/catalog/navigation”
In this path, we will create a file call category_listing.phtml
This file will have the following code:
<?php $_maincategorylisting=$this->getCurrentCategory()?>
<?php $_categories=$this->getCurrentChildCategories()?>
<h2><?php echo $this->__('Browse Products') ?> </h2>
<div class="subcat-listing">
<ul class="subcat-products">
<? foreach ($_categories as $_category):?>
<? if($_category->getIsActive()): ?>
<?php $cur_category=Mage::getModel('catalog/category')->load($_category->getId()); ?>
<?php $layer = Mage::getSingleton('catalog/layer'); ?>
<?php $layer->setCurrentCategory($cur_category); ?>
<? if($_imageUrl=$this->getCurrentCategory()->getImageUrl()):?>
<li> <a href="<?php echo $this->getCategoryUrl($_category) ?>" title="<?php echo $this->htmlEscape($_category->getName()) ?>">
<img src="<?php echo $_imageUrl ?>" width="auto" alt="<?php echo $this->htmlEscape($_category->getName()) ?>" />
</a>
<h3><?php echo $this->htmlEscape($_category->getName()) ?></h3>
<? if($_description=$this->getCurrentCategory()->getDescription()):?>
<p class="category-description">
<?php echo $_description ?></</p>
<?php endif; ?>
<? endif; ?>
<? endif; ?>
<?php endforeach; ?>
</ul>
</div>
<?php $layer->setCurrentCategory($_maincategorylisting); ?>
Call this template in a static block
Go to the menu “CMS/Static block” and create new block.
Add this to the content section of the CMS block:
{{block type="catalog/navigation" name="catalog.categories" template="catalog/navigation/category_listing.phtml"}} . Then save the block.
Use this static block on category pages.
Go to the menu Catalog/Manage Categories
Now we need find the category that we want to show the new grid on
Select the categorie that you want, and in the tab“DISPLAY SETTINGS we set the following information:
DISPLAY MODE: STATIC BLOCK
CMS Block: Category Listing (the block that we create before)
Is Anchor: NO
Click SAVE. Remember that in the tab “Custom Design” you may need select your template. Remember also that the category much have an image assigned to it.

Resources