Articles Anywhere

Articles in table

4 months 2 weeks ago #89489

Octav A's Avatar Octav A

Hello,
Please advise what is the correct syntax to display multiple articles using such tags

{articles category="Category1"}{/articles}
in a table like this:
<table>
<thead>
<tr>
<td>Title</td>
<td>Custom1</td>
<td>Custom2</td>
</tr>
</thead>
<tbody>
<tr>
<td>article1</td>
<td>custom_field1</td>
<td>custom_field2</td>
</tr>
<tr>
<td>article2</td>
<td>custom_field2</td>
<td>custom_field2</td>
</tr>
</tbody>
</table>

4 months 2 weeks ago #89490

Peter van Westen's Avatar Peter van Westen Admin

Place the {articles} tags around the section that you want to repeat.
So with lists (your other question) that was around the <li> element.
With a table, it is around the <tr> element.

4 months 2 weeks ago #89491

Octav A's Avatar Octav A

The <li> elements work just great. And i have tried the same logic with tables but it does not work.
I suppose you mean something like this:

<table>
<tbody>
<tr>
<td>title</td>
<td>Custom1</td>
<td>Custom2</td>
</tr>
{articles category="Category1" limit=10}
<tr>
<td>[title]</td>
<td>[custom_field1]</td>
<td>[custom_field2]</td>
</tr>
{/articles}
</tbody>
</table>
But this does not work. I am using JCE editor and it does not allow to insert anything in these places... It pushes the article tags out of table tags. Any ideas?

4 months 2 weeks ago #89492

Peter van Westen's Avatar Peter van Westen Admin

That is a JCE 'issue' (limitation). Not an Articles Anywhere issue.

You could use Sourcerer to output the tables code without JCE messing with it.

4 months 2 weeks ago #89493

Octav A's Avatar Octav A

Using sourcerer and above table syntax works. That will do, thanks!