2012-01-04 11 views
0

このコードでは、2つのレコードとページングのみを表示することができないのは何ですか?制限とページングが式エンジンで動作しないexp:query

{exp:channel:entries channel="article" status="open" orderby="date" sort="desc" 
search:entry_id="{embed:entry_ids}" dynamic="off" limit="1" paginate="bottom"} 

     {exp:query limit="1" sql="select count(*) as recordcount from exp_channel_data a where entry_id IN ({embed:entry_ids}) AND channel_id=8"} 
      <b> {recordcount} </b> articles found for:<b> {embed:author_name} </b> 
     {/exp:query} 
     <br /> 

     {exp:query limit="2" sql="Select B.field_id_29 as article_bodysubtitle,B.field_id_27 as bodytext, B.field_id_88 as iss_rel_id, D.title as articletitle, D.url_title as ut from exp_channel_data as B INNER JOIN exp_channel_titles D ON B.entry_id=D.entry_id where B.channel_id=8 AND B.entry_id IN({embed:entry_ids})"} 
      <br /> 
      <strong><a href="{path='article/index/{ut}'}">{articletitle}</a></strong>: 
      {exp:trunchtml chars="250" inline="..."} 
       {bodytext} 
       <br />       
      {/exp:trunchtml} 
      <br /> 

      {embed="backissues/embed_iss" iss_rel_id="{iss_rel_id}"} 
      <br /><br /> 
{paginate} 
<p>Page {current_page} of {total_pages} pages {pagination_links}</p> 
{/paginate} 

    {/exp:query} 

{/exp:channel:entries}  

答えて

0
{exp:query limit="2" paginate="bottom" sql="Select B.field_id_29 as article_bodysubtitle,B.field_id_27 as bodytext, B.field_id_88 as iss_rel_id, D.title as articletitle, D.url_title as ut 
     from exp_channel_data as B 
     INNER JOIN exp_channel_titles D ON B.entry_id=D.entry_id 
     where B.channel_id=8 
     AND B.entry_id IN({embed:entry_ids})"} 

     {paginate} 
     <p>Page {current_page} of {total_pages} pages {pagination_links}</p> 
     {/paginate} 

    {exp:channel:entries channel="article" status="open" orderby="date" sort="desc" 
    search:entry_id="{embed:entry_ids}" dynamic="off" limit="1" } 

    <strong><a href="{path='article/index/{ut}'}">{articletitle}</a></strong>: 
     {exp:trunchtml chars="250" inline="..."} 
      {bodytext} 
      <br /> 
     {/exp:trunchtml} 
     <br /> 
     {embed="backissues/embed_iss" iss_rel_id="{iss_rel_id}"} 
     <br /><br /> 

    {/exp:channel:entries} 
{/exp:query} 
+0

問題は方法ee解析していました。それが作業を開始しました。 – user1123399

0

最も外側のチャンネルエントリクエリでは、1つの結果しか返されないようにデータセットが制限されています。

limit parameterを変更してみてください:

{exp:channel:entries ... limit="2" paginate="bottom"} 

paginationを使用する場合は、limitパラメータは、ページごとに示したエントリの数を決定します。

+0

ありがとうrjb。私はlimit = "1"を行うことによって表示する必要があるいくつかの値を返します:entry_id = "{embed:entry_ids} :クエリが動作しますが、いくつかの私の上記のSQLクエリの結合では、制限= "2"をexp:クエリで受け取りません – user1123399

関連する問題