Hi,
I have a problem.
I try use one page divided in three segment additional Use query module to filter category
This is my template.
First the pagination and switch not work when I use a query
{if segment_2=="" AND segment_3==""}
List all portfolio items in the channel.
{if:elseif segment_2!="" AND segment_3==""}
{exp:query sql="SELECT cat_id FROM mot_categories WHERE cat_url_title = '{segment_2}'"}
{exp:channel:entries
channel="portfolio"
limit="9"
style="linear"
category="{cat_id}"
orderby="date"
sort="desc"
}
<article class="item {switch="|middle|third_entry"}">
<figure>
<a href="http://{title_permalink={segment_1}/{segment_2}}}">{portolio_cover}</a>
</figure>
<header>
<h1><a href="http://{title_permalink={segment_1}/{segment_2}}}">{title}</a></h1>
{if portfolio_year != ""}{portfolio_year format="%Y"}
{/if}
{if portfolio_url != ""}{fportfolio_url}
{/if}
</header>
</article>
{paginate}
Page {current_page} of {total_pages} pages {pagination_links}
{/paginate}
{/exp:channel:entries}
{/exp:query}
{if:elseif segment_3!=""}Second
when I use a different file for segment two and I get the page, this does not work
{if:elseif segment_2!="" AND segment_3==""}
{exp:query sql="SELECT cat_id FROM mot_categories WHERE cat_url_title = '{segment_2}'"}
{exp:channel:entries
channel="portfolio"
limit="9"
style="linear"
category="{cat_id}"
orderby="date"
sort="desc"
}
<article class="item {switch="|middle|third_entry"}">
<figure>
<a href="http://{title_permalink={segment_1}/{segment_2}}}">{portolio_cover}</a>
</figure>
<header>
<h1><a href="http://{title_permalink={segment_1}/{segment_2}}}">{title}</a></h1>
{if portfolio_year != ""}{portfolio_year format="%Y"}
{/if}
{if portfolio_url != ""}{fportfolio_url}
{/if}
</header>
</article>
{paginate}
Page {current_page} of {total_pages} pages {pagination_links}
{/paginate}
{/exp:channel:entries}
{/exp:query}
{if:elseif segment_3!=""}
<article class="portfolio-item">
{exp:channel:entries channel="portfolio" limit="1" disable="member_data|category_fields|pagination" url_title="{segment_3}"}
{title}
{/exp:channel:entries}when I use a different file for the segment, paging works, but this charge the segment 3 and all custom fields load empty
The ideal is use only file and use 3 segments.
Tks