2014-09-30, 17:30:18
Hi, I hope I've come to the right place for a little help with PHP that i'm using on GetSimple. Thank you for taking the time to read this.
I have a Getsimple install which I'm using for my personal site. My intention is to have a single front page with all articles I've added. I would then like to have two pages one which shows all articles with the tag 'code' and another for 'writing' to separate the articles a bit more.
I have the following code to pull the pages onto the front page, which i'm happy with:
My question is how do i add the "contains tag 'code' to the if statement so that i can further filter the pages for the page called 'code' that will show all of the other pages tagged with 'code'.
I hope that makes sense, any help would be greatly appreciated, and please let me know if i need to provide more information.
thank you,
Chris.

I have a Getsimple install which I'm using for my personal site. My intention is to have a single front page with all articles I've added. I would then like to have two pages one which shows all articles with the tag 'code' and another for 'writing' to separate the articles a bit more.
I have the following code to pull the pages onto the front page, which i'm happy with:
PHP Code:
<?php
global $pagesArray;
$pagesSorted = subval_sort($pagesArray,'menuOrder'); // or 'title', 'menu', 'url', ...
foreach ($pagesSorted as $page)
if ($page['url']!='index'
&& $page['menuStatus']=='Y'){
$pag = $page['url'];
?>
<a name="<?php echo $pag; ?>"></a>
<div class="pagecontent <?php echo $pag; ?>">
<a href="<?php echo $pag; ?>"><h2><?php getPageField($pag,'title'); ?> </h2></a>
<?php getPageContent($pag); ?>
</div>
<?php
}
?>
My question is how do i add the "contains tag 'code' to the if statement so that i can further filter the pages for the page called 'code' that will show all of the other pages tagged with 'code'.
I hope that makes sense, any help would be greatly appreciated, and please let me know if i need to provide more information.
thank you,
Chris.