Forums / General Questions / Sorting EZ_Page Footer links into columns?

Sorting EZ_Page Footer links into columns?

Locked

Views: 670

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
3 Oct 2009, 7:20 PM
#1
bumba000 avatar

bumba000

Totally Zenned

Join Date:
Feb 2007
Location:
Pennsylvania
Posts:
858
Plugin Contributions:
0

Sorting EZ_Page Footer links into columns?

Hi All,
Just curious to know if there is a way (from the admin) to have the ez_pages in the footer show up in three or four predetermined columns?

For example:
Sales Pages sort = 1 ( there are 5 of them )
Informational Pages sort = 2 ( there are 3 of them )
External Link Pages sort = 3 ( there are 5 of them ).

So the front side out put would be:

Col-One | Col-Two | Col-Three
sale 1 | Info 1 | link 1
sale 2 | Info 2 | link 2 etc. . .
sale 3
sale 4
sale 5

Thanks,
John

3 Oct 2009, 10:09 PM
#2
kobra avatar

kobra

Black Belt

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

Re: Sorting EZ_Page Footer links into columns?

Not from the admin but a coded standard ul will list vertically

	<ul>
	<li><a href="xxxxxx">Text</a></li>
	<li><a href="xxxxxx">Text</a></li>	 
	<li><a href="xxxxxx">Text</a></li>
	<li><a href="xxxxxx">Text</a></li>
	</ul>

Zen-Venom Get Bitten

3 Oct 2009, 10:43 PM
#3
bumba000 avatar

bumba000

Totally Zenned

Join Date:
Feb 2007
Location:
Pennsylvania
Posts:
858
Plugin Contributions:
0

Re: Sorting EZ_Page Footer links into columns?

Hey Kobra,
Thanks for the quick reply! That is my plan in the end for styling. The problem is getting the ezpage links to go into the footer, in three separate columns. Which column they are placed in is based on their sort order.

I'm working on a fix for this but there is a problem with my code. Pretty green when it comes to the php still but am giving it a bash.

This is from includes/templates/mytemp/templates/tpl_ezpages_bar_footer.php

<?php
include(DIR_WS_MODULES . zen_get_module_directory('ezpages_bar_footer.php'));

 if (sizeof($var_linksList) >= 3) { 
$i = 0;

while(!$var_linkList->EOF) {
$i++;
$ezpContain = array('','','',);
switch($i) {
    case 1:
        $ezpContain[0] .= $var_linkList;
        break;
    case 2:
        $ezpContain[1] .= $var_linkList;
        break;
    case 3:
        $ezpContain[2] .= $var_linkList;
        $i = 0;
        break;

}// closes switch($i)
 

} // closes while (!$var_linkList->EOF . . .

} // closes if (sizeof($var_linkList . . . 

?>

<table><tr>

<td><?php
for ($i=1, $n=sizeof($ezpContain[0]); $i<=$n; $i++) {  ?>

  <a href="<?php echo $ezpContain[0][$i]['link']; ?>"><?php echo $ezpContain[0][$i]['name']; ?></a>
  
<?php } // end FOR loop ?>

</td>

<td><?php
for ($i=1, $n=sizeof($ezpContain[1]); $i<=$n; $i++) {  ?>

  <a href="<?php echo $ezpContain[1][$i]['link']; ?>"><?php echo $ezpContain[1][$i]['name']; ?></a>
  
<?php } // end FOR loop ?>

</td>

<td><?php
for ($i=1, $n=sizeof($ezpContain[2]); $i<=$n; $i++) {  ?>

  <a href="<?php echo $ezpContain[2][$i]['link']; ?>"><?php echo $ezpContain[2][$i]['name']; ?></a>
  
<?php } // end FOR loop ?>

</td>

</tr></table>
3 Oct 2009, 11:39 PM
#4
kobra avatar

kobra

Black Belt

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

Re: Sorting EZ_Page Footer links into columns?

That is contained/required by tpl_footer.php and other control in modules/ezpages_bar_footer.php

Zen-Venom Get Bitten

4 Oct 2009, 12:06 AM
#5
bumba000 avatar

bumba000

Totally Zenned

Join Date:
Feb 2007
Location:
Pennsylvania
Posts:
858
Plugin Contributions:
0

Re: Sorting EZ_Page Footer links into columns?

Okay, I have a solution! I had to modify the modules ezpages_bar_footer.php and the includes ezpages_bar_footer.php as well.

This is from lines 27, 28 & 29 in the modules

 $page_query_list_footer[$rows]['id'] = $page_query->fields['pages_id'];
      $page_query_list_footer[$rows]['name'] = $page_query->fields['pages_title'];
      $page_query_list_footer[$rows]['altURL'] = '';
```I replaced it with
```php
 $page_query_list_footer[$rows]['id'] = $page_query->fields['pages_id'];
      $page_query_list_footer[$rows]['name'] = $page_query->fields['pages_title'];
      $page_query_list_footer[$rows]['sort'] = $page_query->fields['footer_sort_order'];
      $page_query_list_footer[$rows]['altURL'] = '';

Here is a new includes

<?php
   
  include(DIR_WS_MODULES . zen_get_module_directory('ezpages_bar_footer.php'));
?>
<?php if (sizeof($var_linksList) >= 1) { ?>



<table><tr><td>
<?php for ($i=1, $n=sizeof($var_linksList); $i<=$n; $i++) { 
if($var_linksList[$i]['sort'] == 1){ 
?>
  <a href="<?php echo $var_linksList[$i]['link']; ?>"><?php echo $var_linksList[$i]['name']; ?><?php echo $var_linksList[$i]['sort']; ?></a>
  <?php  }  } // end FOR loop // end if ?>
</td>


<td>
<?php for ($i=1, $n=sizeof($var_linksList); $i<=$n; $i++) { 
if($var_linksList[$i]['sort'] == 2){ 
?>
  <a href="<?php echo $var_linksList[$i]['link']; ?>"><?php echo $var_linksList[$i]['name']; ?><?php echo $var_linksList[$i]['sort']; ?></a>
  <?php  }  } // end FOR loop // end if ?>
</td>


<td>
<?php for ($i=1, $n=sizeof($var_linksList); $i<=$n; $i++) { 
if($var_linksList[$i]['sort'] == 3){ 
?>
  <a href="<?php echo $var_linksList[$i]['link']; ?>"><?php echo $var_linksList[$i]['name']; ?><?php echo $var_linksList[$i]['sort']; ?></a>
  <?php  }  } // end FOR loop // end if ?>
</td>


<td>
<?php for ($i=1, $n=sizeof($var_linksList); $i<=$n; $i++) { 
if($var_linksList[$i]['sort'] > 3){ 
?>
  <a href="<?php echo $var_linksList[$i]['link']; ?>"><?php echo $var_linksList[$i]['name']; ?><?php echo $var_linksList[$i]['sort']; ?></a>
  <?php  }  } // end FOR loop // end if ?>
</td>

</tr></table>




<?php } ?>
4 Oct 2009, 3:29 AM
#6
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Sorting EZ_Page Footer links into columns?

Just for fun...
/includes/templates/mytemp/templates/tpl_ezpages_bar_footer.php```php
include(DIR_WS_MODULES . zen_get_module_directory('ezpages_bar_footer.php'));
//sort links into ul lists according to first digit of sort order
//allows ordering links within columns - use 101, 102, 201, 202...
if (sizeof($var_linksList) >= 1) {
for ($list_col=1; $list_col<=9; $list_col++) {
$col_links = 0;
$col = '<ul class="ezpagesFooterCol">';
for ($i=1, $n=sizeof($var_linksList); $i<=$n; $i++) {
if(substr($var_linksList[$i]['sort'], 0, 1) == $list_col){
$col .= '<li><a href="' . $var_linksList[$i]['link'] . '">' . $var_linksList[$i]['name'] . $var_linksList[$i]['sort']/<--why is this here?/ .'</a></li>';
$col_links = 1;
}
}
$col .= '</ul>';
if ($col_links == 1) echo $col;
} // end FOR loop
} // end if ?>

4 Oct 2009, 4:36 AM
#7
bumba000 avatar

bumba000

Totally Zenned

Join Date:
Feb 2007
Location:
Pennsylvania
Posts:
858
Plugin Contributions:
0

Re: Sorting EZ_Page Footer links into columns?

Thanks Glenn. Very efficient. I'll be there someday.

John