LinkArray include category permalink

2 posts by 2 authors in: Forums > CMS Builder
Last Post: April 29, 2014   (RSS)

By JeremyHarrison - April 27, 2014

Hi, I'm having issues pulling in the _link field within a linkarray when listing categories assigned to each blog post.

My code currently looks like this:

<?php $linkArray = array_combine($record['category:values'], $record['category:labels']); ?>
<?php foreach($linkArray as $num => $title): ?>
<a href="/category.php?<?php echo $num;?>"><?php echo $title; ?></a>,
<?php endforeach; ?>

I'd prefer to pull the _link field from each category record as I'm using permalinks and don't want to have duplicate URL's. Manually adding each category to the permalinks db isn't feasible as the client will be constantly adding new categories.

I've always used linkArray to generate a list of assigned categories on the detail page for each blog post, but haven't tried it when using permalinks so it's proving a bit of a conundrum for my designer brain.

Any help you can offer would be greatly appreciated.

Cheers,

Jeremy.