Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2008
    Location
    idaho
    Posts
    14
    Plugin Contributions
    0

    Default ezpage header <li> css id

    I'm trying to modify my ezpage heaer bar to assign li ids that I can modify via css.

    Dr Byte got me started here

    in tpl_ezpages_bar_header.php

    I think I should do this:

    Code:
    <li id="<?php echo $var_linksList[$i]['id']; ?>">
    but the <li> tags are outside the loop. I get an extra list item for each actual list item placing this inside the loop

    Code:
    <?php if (sizeof($var_linksList) >= 1) { ?>
    <div id="menu">
        <ul id="nav">
        <?php for ($i=1, $n=sizeof($var_linksList); $i<=$n; $i++) {  ?>
            <li id="<?php echo $var_linksList[$i]['id']; ?>">
            <a href="<?php echo $var_linksList[$i]['link']; ?>"><?php echo $var_linksList[$i]['name']; ?></a><?php echo ($i < $n ? EZPAGES_SEPARATOR_HEADER : '') . "\n"; ?>
    <?php } // end FOR loop ?>
    </li>
    </ul>
    </div>
    <?php } ?>
    any body have any ideas?

  2. #2
    Join Date
    Feb 2009
    Posts
    95
    Plugin Contributions
    0

    Default Re: ezpage header <li> css id

    The closing </li> tag also needs to be inside the loop.

  3. #3
    Join Date
    Feb 2009
    Posts
    95
    Plugin Contributions
    0

    Default Re: ezpage header <li> css id

    have you tried:
    PHP Code:
    <?php if (sizeof($var_linksList) >= 1) { ?>
    <div id="menu">
        <ul id="nav">
        <?php for ($i=1$n=sizeof($var_linksList); $i<=$n$i++) {  ?>
            <li id="<?php echo $var_linksList[$i]['id']; ?>">
            <a href="<?php echo $var_linksList[$i]['link']; ?>"><?php echo $var_linksList[$i]['name']; ?></a><?php echo '</li>';?><?php echo ($i $n EZPAGES_SEPARATOR_HEADER '') . "\n"?>
    <?php 
    // end FOR loop ?>
    </ul>
    </div>
    <?php ?>

  4. #4
    Join Date
    Dec 2008
    Location
    idaho
    Posts
    14
    Plugin Contributions
    0

    Default Re: ezpage header <li> css id

    It produces the excpected output, but with a special bonus empty <li>

    HTML Code:
    <ul id="nav"><li id="20"></li><li>         </li><li id="3"></li><li>         </li><li id="2"></li><li>         </li><li id="15"></li><li>         </li><li id="16"></li><li>         </li><li id="17"></li><li>         </li><li id="18"></li><li>         </li><li id="19"></li><li>         </li><li id="21"></li></ul>

  5. #5
    Join Date
    Dec 2008
    Location
    idaho
    Posts
    14
    Plugin Contributions
    0

    Default Re: ezpage header <li> css id

    Quote Originally Posted by jwitt98 View Post
    have you tried:
    PHP Code:
    <?php if (sizeof($var_linksList) >= 1) { ?>
    <div id="menu">
        <ul id="nav">
        <?php for ($i=1$n=sizeof($var_linksList); $i<=$n$i++) {  ?>
            <li id="<?php echo $var_linksList[$i]['id']; ?>">
            <a href="<?php echo $var_linksList[$i]['link']; ?>"><?php echo $var_linksList[$i]['name']; ?></a><?php echo '</li>';?><?php echo ($i $n EZPAGES_SEPARATOR_HEADER '') . "\n"?>
    <?php 
    // end FOR loop ?>
    </ul>
    </div>
    <?php ?>

    Perfect Thanks.

    My extra list item was in the EZ Pages Settings in the Admin.

  6. #6
    Join Date
    Feb 2009
    Posts
    95
    Plugin Contributions
    0

    Default Re: ezpage header <li> css id

    Strange.

    I'm guessing it's either looping one too many times or you have a blank ezpage with no name assigned.
    Look in your ezpages table and see if there is an entry with blank 'pages_title'

    Edit: I apparently took too long to finish my post, glad you got it.
    Last edited by jwitt98; 28 Mar 2009 at 01:45 AM. Reason: posted too late

 

 

Similar Threads

  1. v151 Stuck on a CSS and ezPage header bar styling
    By ray-the-otter in forum General Questions
    Replies: 2
    Last Post: 5 Nov 2012, 09:08 PM
  2. ezpage sidebar header
    By Kountessa in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 31 Jul 2010, 02:18 AM
  3. Images to replace links in ezpage header
    By ForPhoneUnlock in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 13 Mar 2009, 03:08 AM
  4. EzPage Header
    By chris32882 in forum General Questions
    Replies: 1
    Last Post: 13 Nov 2008, 06:26 AM
  5. CSS for EzPage
    By ericpeng in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 18 Sep 2006, 01:27 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg