herrsaidy February 2016

Fluid, Pagebrowse with VHS-Viewhelper

I use the VHS ViewHelper "v:page.menu.browse". So I can click through pages that are on the same level. This also works just fine. However, what is not working, that I get the navigation elements appear only if more than one page is available. I've already tried with f:count query whether more than one page is available. Unfortunately, he shows me the items still on. Does somebody has any ideas?

<v:page.menu.browse>
        <f:if condition="<f:count>{menu.prev}</f:count> > 1">
            <f:then>
                <li><a href="{menu.prev.link}"><span class="icondetail-icon_prev"></span></a>1</li>
            </f:then>
            <f:else>
                <f:if condition="<f:count>{menu.prev}</f:count> > 1">
                    <f:then>
                         <li><a href="{menu.last.link}"><span class="icondetail-icon_prev"></span></a>2</li>
                    </f:then>
                    <f:else>

                    </f:else>
                </f:if>
            </f:else>
        </f:if>
        <li><a href="javascript:history.back();"><span class="icondetail-icon_uebersicht"></span></a></li>
        <li><span class="icondetail-icon_mail"></span></li>
        <f:if condition="<f:count>{menu.next}</f:count> > 1">
            <f:then>
                <li><a href="{menu.next.link}"><span class="icondetail-icon_next"></span></a>3</li>
            </f:then>
            <f:else>
               <f:if condition="<f:count>{menu.next}</f:count> > 1">
                    <f:then>
                         <li><a href="{menu.first.link}"><span class="icondetail-icon_next"></span></a>4</li&        

Answers


Viktor Livakivskyi February 2016

You can't use tag notation within the attributes, like you have here:

<f:if condition="<f:count>{menu.prev}</f:count> > 1">

Instead you should use inline notation:

<f:if condition="{menu.prev -> f:count()} > 1">

or

<f:if condition="{f:count(subject: menu.prev)} > 1">


herrsaidy February 2016

This is my solution

   <v:page.menu.browse>         
            <f:if condition="<f:count>{menu}</f:count> == 3">
                <f:then>
                    <li><a href="{menu.up.link}"><span class="icondetail-icon_uebersicht"></span></a></li>
                    <li><span class="icondetail-icon_mail"></span></li>
                </f:then>
                <f:else>
                    <f:if condition="{menu.prev.link}">
                        <f:then>
                            <li><a href="{menu.prev.link}"><span class="icondetail-icon_prev"></span></a></li>
                            <li><a href="{menu.up.link}"><span class="icondetail-icon_uebersicht"></span></a></li>
                        </f:then>
                        <f:else>
                            <li><a href="{menu.last.link}"><span class="icondetail-icon_prev"></span></a></li>
                            <li><a href="{menu.up.link}"><span class="icondetail-icon_uebersicht"></span></a></li>
                        </f:else>
                    </f:if>
                    <f:if condition="{menu.next.link}">
                        <f:then>
                            <li><span class="icondetail-icon_mail"></span></li>
                            <li><a href="{menu.next.link}"><span class="icondetail-icon_next"></span></a></li>
                        </f:then>
                        <f:else>
                            <li><span class="icondetail-icon_mail"></span></li>
                            <li><a href="{menu.first.link}"><span class="icondetail-icon_next"></span&g 

Post Status

Asked in February 2016
Viewed 2,948 times
Voted 14
Answered 2 times

Search




Leave an answer