Page 1 of 1

Adding Articles Section

Posted: Fri Apr 23, 2021 12:51 am
by Dnj1964
Looking for a way to add an articles section with different topics.

Re: Adding Articles Section

Posted: Wed Apr 28, 2021 6:32 pm
by Kofod95
This comes to my mind - of course you'll need a front-end for it as well, which I don't remember to have seen anywhere yet.

app.php/addons/supporters_code/s05e02_i ... extensions

//Daniel

Re: Adding Articles Section

Posted: Thu Apr 29, 2021 7:54 am
by heatherbell
Kofod95 wrote: Wed Apr 28, 2021 6:32 pm This comes to my mind
app.php/addons/supporters_code/s05e02_i ... extensions
Yes, we used the folders extension to make something like that.
We created a new page and other files that go with it.
In that page, the relevant code to show links to pages within a specific folder ID we used is below.
This example shows the links as buttons:

Code: Select all

<div class="row">
  <?php
  $containment = info_pages::getContainer(['pd.languages_id' => '1',
  'p.folder' => '12', 'p.pages_status' => '1']); 

  foreach ($containment as $k => $v) {
    echo '<div class="col-12 col-md-6 my-2">' .  PHP_EOL;
    echo '<a class="btn btn-lg btn-block btn-primary" href="' . tep_href_link('info.php', 'pages_id=' . $v['pages_id']) . '">' . '<i class="far fa-file-alt"></i>&nbsp' . $v['pages_title'] . '</a>' .  PHP_EOL;
    echo '</div>' .  PHP_EOL;
      }
?>
</div>
It works for us.