How can I add List Selection into php description?

4 posts by 2 authors in: Forums > CMS Builder
Last Post: August 23, 2010   (RSS)

Re: [jonoc73] How can I add List Selection into php description?

By Jason - August 20, 2010

Hi,

If you could provide a link to one of your pages and attach a copy of the code you're currently using, I can take a look at it for you.

Thanks.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] How can I add List Selection into php description?

By (Deleted User) - August 20, 2010

Jason, email has been sent.

jono

Re: [jonoc73] How can I add List Selection into php description?

By Jason - August 23, 2010

Hi Jono,

You could try using this code:

<?php $currentSector = getLastNumberInUrl(); ?>

<?php foreach ($secRecords as $record): ?>

<li <?php if ($record['num']==$currentSector) echo " class=\"currentpage\""; ?>>

<a href="/sectors/<?php echo $record['url_keywords'] ?>-<?php echo $record['num'] ?>"><?php echo $record['list_title'] ?></a></li>
<?php endforeach ?>


This will work on any page. What it does is get the record number from the url. When it's outputting the different links, it will make the record that is currently selected have the class "currentpage"

Give that a try.

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/