1

Hello I have some php which is generating a list for me. I added the

  • bits myself and was quite pleased with it actually doing something than giving m a php error

        <?php
        $termid = arg(2);
        $terms = taxonomy_get_related($termid, $key = 'tid');
        //print_r($terms);
        foreach($terms as $term){
    
           $link = url('taxonomy/term/'.$term->tid);
           echo '<li><a href="'.$link.'">'.$term->name.'</a></li>';
         }
      ?>
    

    I was wanting to style my list though and tried -

        <div class="sidey"><?php
        $termid = arg(2);
        $terms = taxonomy_get_related($termid, $key = 'tid');
        //print_r($terms);
        foreach($terms as $term){
    
           $link = url('taxonomy/term/'.$term->tid);
           echo '<li><a href="'.$link.'">'.$term->name.'</a></li>';
         }
      ?></div>
    

    with-

       .sidey .inner ul li, .sidey .view-content div.views-row {
        border-bottom-color: #DDDDDD;
    list-style-image: none;
    line-height: 130%;
        padding: 5px 0;
     border-bottom-style: solid;
        border-bottom-width: 1px;
    }
    

    but to no effect. Should this work or am i missing something very fundamental here? I think i am. Also tried this but again to no avail-

        <?php
        $termid = arg(2);
        $terms = taxonomy_get_related($termid, $key = 'tid');
        //print_r($terms);
        foreach($terms as $term){
    
           $link = url('taxonomy/term/'.$term->tid);
           echo '<div id="sidey"><li><a href="'.$link.'">'.$term->name.'</a></li></div>';
         }
      ?>
    

    Could anyone point me in the right direction? Thanks

  • 1
    • If you assign an ID (<div id="sidey">) then in your CSS you must use #sidey instead of .sidey. Commented Jan 27, 2013 at 22:32

    2 Answers 2

    3

    You are missing the beginning and ending of unordered list <ul></ul>

    Sign up to request clarification or add additional context in comments.

    2 Comments

    sorry that was my mistake re the Div ID Alberto. i changed that when i was trying class and ID sorry. The CSS is just not having any effect Zar. Should it all be ok? thanks
    thanks vodich thats done the job. pretty fundemental huh? lol
    0

    If you are going to assign an ID to the div then make sure you open and close your UL (like someone mentioned below), then your CSS should be:

    div#sidey ul li {
        border-bottom-color: #DDDDDD;
        list-style-image: none;
        line-height: 130%;
        padding: 5px 0;
         border-bottom-style: solid;
        border-bottom-width: 1px;
    }
    

    Comments

    Your Answer

    By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

    Start asking to get answers

    Find the answer to your question by asking.

    Ask question

    Explore related questions

    See similar questions with these tags.