• Resolved Halit Ayarc?

    (@doktorramiz)


    Hello,

    The following code is from auto template to display an actor and his/her filmography
    actor_films is a bi-directional relationship field in actors pod

    [if actor_films]
    <ul class=”filmlist”>

    [each actor_films]

    • {@name} <br>Film Genre: <span style=”font-size:90%;font-weight:400;”>{@film_genre}</span>
    • [/each]

      [/if]

      The code works and brings the list and even when I call “count” in a different div it gives me the correct munber of films for that actor. But in the list for every “li” element an empty “li” is created right after th full one. So when an actor has 50 films the count says fifty but after every film title there is an empty “li” item.

      What may be causing this?

      Thanks

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @doktorramiz

    I’m fairly certain that this is a formatting issue. Maybe a missing closing character or opening character on the wrong location?

    The code you’ve posted isn’t formatted correctly, you should enclose it in code formatting (see comment editor top bar)

    Cheers, Jory

    Thread Starter Halit Ayarc?

    (@doktorramiz)

    Sorry, my mistake writing directly… The code is:

    [if actor_films]
    
    	<ul class="filmlist">
    		[each actor_films]
    			<li><a href="{@permalink,esc_url}">{@name}</a> <br>Film Genre: <span style="font-size:90%;font-weight:400;">{@film_genre}</span><li>
            	[/each]
            </ul> 
    [/if]
    • This reply was modified 2 years, 6 months ago by Halit Ayarc?.
    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @doktorramiz

    You are ending the <li> element also with an opening <li> tag instead of a closing tag: </li>.

    Cheers, Jory

    Thread Starter Halit Ayarc?

    (@doktorramiz)

    Oh my… I am so sorry… It has been days looking at this and not seeing ??
    Thank you very much

    Plugin Author Jory Hogeveen

    (@keraweb)

    No worries, happens to the best!
    Might be a nice help you get yourself a good IDE which will flush out such errors for you!

    Thread Starter Halit Ayarc?

    (@doktorramiz)

    You are absolutely right. Next item on todo list ?? Again, thank you very much

    Plugin Author Jory Hogeveen

    (@keraweb)

    No problem, good luck with your project!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘empty list element is created’ is closed to new replies.