Forums / Templates, Stylesheets, Page Layout / Adding images to next and previous arrows?

Adding images to next and previous arrows?

Started by sports_guy on 17 Nov 2012, 6:55 PM · Views: 1,638

Results 1 to 5 of 5
17 Nov 2012, 6:55 PM
#1
sports_guy avatar

sports_guy

Totally Zenned

Join Date:
Apr 2007
Location:
Dayton, Ohio
Posts:
682
Plugin Contributions:
0

Adding images to next and previous arrows?

I would like to replace text with images, for the next and previous pages (when viewing category pages). This is located on top and bottom of my products for my category pages. One can be seen here: http://www.lasilhouettelingerie.com/store/hosiery-c-141/?page=2&sort=20a

I am not sure which template page to find look for these arrows. I do have this file in my template folder: includes/template/MYTEMPLATE/templates/tpl_products_next_previous.php which I suspect could be the page to find the div definitions.

Here is the code in this file:

<div class="navNextPrevWrapper">
<?php
// only display when more than 1
  if ($products_found_count > 1) {
?>
<p class="navNextPrevCounter"><?php echo (PREV_NEXT_PRODUCT); ?><?php echo ($position+1 . "/" . $counter); ?></p>
<div class="navNextPrevList"><a href="<?php echo zen_href_link(zen_get_info_page($previous), "cPath=$cPath&products_id=$previous"); ?>"><?php echo $previous_image . $previous_button; ?></a></div>

<div class="navNextPrevList"><a href="<?php echo zen_href_link(FILENAME_DEFAULT, "cPath=$cPath"); ?>"><?php echo zen_image_button(BUTTON_IMAGE_RETURN_TO_PROD_LIST, BUTTON_RETURN_TO_PROD_LIST_ALT); ?></a></div>

<div class="navNextPrevList"><a href="<?php echo zen_href_link(zen_get_info_page($next_item), "cPath=$cPath&products_id=$next_item"); ?>"><?php echo  $next_item_button . $next_item_image; ?></a></div>
<?php
  }
?>
</div>

If I just want to put one arrow at the beginning for previous (when there are more pages before), and arrow after for next (when there are more pages after). I can figure out how to add the CSS to my stylesheet, I just don't know where to find the page that holds these definitions. Second I want to make sure these arrows that show now are not coming from within my control panel setting (like in configuration>product listings. But I do not see it anywhere so I suspect css controls these arrows.

Please point me to the correct file, so I can modify these css definitions to add my images.

Building a better web, one site at a time: Dayton Web Design

19 Nov 2012, 3:47 AM
#3
sports_guy avatar

sports_guy

Totally Zenned

Join Date:
Apr 2007
Location:
Dayton, Ohio
Posts:
682
Plugin Contributions:
0

Re: Adding images to next and previous arrows?

I appears my template has some sort plugin built in for previous/next. For one I found this file under: ../MYTEMPLATES/templates/tpl_products_next_previous.php. In the header of this file I have this:

/*
 WebMakers.com Added: Previous/Next through categories products
 Thanks to Nirvana, Yoja and Joachim de Boer
 Modifications: Linda McGrath [email protected]
*/

I could not find that module in the plugins. I can see on my product category detail page a: previous, listing, and next button. I also see some settings in my control panel under: configuration> product info

Previous Next - Button and Image Status 
Previous Next - Navigation Includes Category Position
Previous Next - Navigation Includes Category Name and Image Status
Previous Next - Navigation Bar Position
Previous Next - Button and Image Settings
Previous Next - Sort Order
Previous Next - Image Width?
Previous Next - Image Height?

This all controls the previous and next on the product listing page. I would like to add images to the previous/next on the product category page (showing multiple products). Will this recommended script interfere with my already established previous/next plugin? If I could find this plugin, there might be built in functionality for what I need already built in.

Building a better web, one site at a time: Dayton Web Design

19 Nov 2012, 4:21 AM
#4
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Adding images to next and previous arrows?

Will this recommended script interfere with my already established previous/next plugin?
You will need to merge the alterations into one file

Zen-Venom Get Bitten

20 Nov 2012, 3:31 AM
#5
sports_guy avatar

sports_guy

Totally Zenned

Join Date:
Apr 2007
Location:
Dayton, Ohio
Posts:
682
Plugin Contributions:
0

Re: Adding images to next and previous arrows?

OK Kobra, I hate to install a full module that has many coding changes. Even with merging, I am not sure I can do it; my file is much different than the plugins. It seems like a lot to change 2 simple images. I was thinking I can find this code and make the change. It sounds easier to me.

In looking at my source code I found the english file at: /includes/languages/MyTemplate/english.php around lines #286 and #287. For now I changed the text.

define('PREVNEXT_BUTTON_PREV', 'Previous');
define('PREVNEXT_BUTTON_NEXT', 'Next');

I know this is the defining code because the text changed where I wanted it to change. Looking up the: PREVNEXT_BUTTON_NEXT in my Developers toolkit I found several hits. But only one made sense and this is the code:

[B]/MyRoot/includes/classes/split_page_results.php[/B]
Line #[B]109[/B]  :     if ($this->current_page_number > 1) $display_links_string  .= '<a href="' . zen_href_link($_GET['main_page'], $parameters .  $this->page_name . '=' . ($this->current_page_number - 1),  $request_type) . '" title=" ' . PREVNEXT_TITLE_PREVIOUS_PAGE . ' ">' .  PREVNEXT_BUTTON_PREV . '</a>  '; 

In the same file I found this:

Line #[B]134[/B] :     if (($this->current_page_number <  $this->number_of_pages) && ($this->number_of_pages != 1))  $display_links_string .= ' <a href="' .  zen_href_link($_GET['main_page'], $parameters . 'page=' .  ($this->current_page_number + 1), $request_type) . '" title=" ' .  PREVNEXT_TITLE_NEXT_PAGE . ' ">' . PREVNEXT_BUTTON_NEXT .  '</a> '; 

This is the code that displays these buttons right? All I need to do is get my image locations in these areas to display my images? I am a little unsure as to how to put html image code in this PHP.

Building a better web, one site at a time: Dayton Web Design