با سلام وخسته نباشید خدمت شما
من جدولی رو در یک صفحه به نام doreh.tpl ایجاد کردم .(عکسش رو گذاشتم)
ابتدا از پنل مدیریت صفحه ی اضافی ساختم. بعدش بهش گفتم از قالب doreh.tpl بخونه. که قالب دوره دارای کد های پایین همین صفحه هست.
این جدول از "عنوان" رو در یک ستون ، "تاریخ"رو در ستون دیگر و... رو توسط تگ ها ی {title} و... میخونه.
مشکل اینجاست که هر تعداد باری که من کدها رو تکرار کنم، به همان نسبت تعداد سطر ها بیشتر می شود. به این معنا که در عکس هم مشاهده می کنید،
من 4 بار کد را تکرار کردم و سپس دیتالایف 4سطر را نمایش داد.
می خواهم بدانم که چگونه این تعداد سطر ها را به دست خود دیتالایف بدم و نسبت به تعداد مطالبی که می زارم (مثلا بعدها شاید 100 مطلب بشه) خود دیتالایف سطر ها رو افزاریش بده و تاره اینکه این 100 مطلب رو تقسیم بندی کنه و در هر صفحه ی سایت 10 تاش رو نمایش بده.
ممنون میشیم راهنمایی کنید که چگونه این کار رو انجام بدم.
کد صفحه ی doreh.tpl که ساخته ام :
<!DOCTYPE html> <html> <head> <style> .responstable { margin: 1em 0; width: 100%; overflow: hidden; background: #FFF; color: #024457; border-radius: 10px; border: 1px solid #167F92; } .responstable tr { border: 1px solid #D9E4E6; } .responstable tr:nth-child(odd) { background-color: #EAF3F3; } .responstable th { display: none; border: 1px solid #FFF; background-color: #167F92; color: #FFF; padding: 1em; } .responstable th:first-child { display: table-cell; text-align: center; } .responstable th:nth-child(2) { display: table-cell; } .responstable th:nth-child(2) span { display: none; } .responstable th:nth-child(2):after { content: attr(data-th); } @media (min-width: 480px) { .responstable th:nth-child(2) span { display: block; } .responstable th:nth-child(2):after { display: none; } } .responstable td { display: block; word-wrap: break-word; max-width: 7em; } .responstable td:first-child { display: table-cell; text-align: center; border-right: 1px solid #D9E4E6; } @media (min-width: 480px) { .responstable td { border: 1px solid #D9E4E6; } } .responstable th, .responstable td { text-align: right; margin: .5em 1em; } @media (min-width: 480px) { .responstable th, .responstable td { display: table-cell; padding: 1em; } } h1 { font-family: Verdana; font-weight: normal; color: #024457; } h1 span { color: #167F92; } </style></head><body> <h1>دوره ها</h1> <table class="responstable"> <tbody><tr> <th>عنوان دوره</th> <th>توضيحات</th> <th>توضيحات</th> </tr> <tr> <td>{custom category="3" template="doreh-radio-title" from="0" limit="1"}</td> <td>تاريخ انتشار:{custom category="3" template="doreh-radio-tozihat1" from="0" limit="1"}</td> <td>بازديد:{custom category="3" template="doreh-radio-tozihat2" from="0" limit="1"}</td> </tr> <tr> <td>{custom category="3" template="doreh-radio-title" from="0" limit="1"}</td> <td>تاريخ انتشار:{custom category="3" template="doreh-radio-tozihat1" from="0" limit="1"}</td> <td>بازديد:{custom category="3" template="doreh-radio-tozihat2" from="0" limit="1"}</td> </tr> <tr> <td>{custom category="3" template="doreh-radio-title" from="0" limit="1"}</td> <td>تاريخ انتشار:{custom category="3" template="doreh-radio-tozihat1" from="0" limit="1"}</td> <td>بازديد:{custom category="3" template="doreh-radio-tozihat2" from="0" limit="1"}</td> </tr> <tr> <td>{custom category="3" template="doreh-radio-title" from="0" limit="1"}</td> <td>تاريخ انتشار:{custom category="3" template="doreh-radio-tozihat1" from="0" limit="1"}</td> <td>بازديد:{custom category="3" template="doreh-radio-tozihat2" from="0" limit="1"}</td> </tr> </tbody></table> <script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.js"></script> </body></html>