Multi list Pge question

9 posts by 3 authors in: Forums > CMS Builder
Last Post: April 17, 2009   (RSS)

hi, I have news list page that is sorted by date. Here is link to the list page created with the cms: http://www.synchronoss.com/newsList.php
Now I want to add a pull down option that lists the page by year.(Options would be: view all, 2009, 2008, 2007 and so on)
I'm not sure how to go about doing this. I would appreciate it if you can give me a step by stop instruction. Thanks!
Here is mockup of the page:[font "Times New Roman"] http://gjdemo.com/synchronoss/news.htm

Re: [greatjakes] Multi list Pge question

By Dave - April 15, 2009

Hi greatjakes,

No problem, you can use the built in search features as described here: http://www.interactivetools.com/docs/cmsbuilder/viewer_search.html

For example, you can show just 2008 records like this:
http://www.synchronoss.com/newsList.php?date_year=2008

And you can make a little javascript widget that redirects to the selected year like this:

<form method="get" action="?">
<select name="date_year" onchange="this.form.submit()">
<option value=''>&lt;select&gt;</option>
<option value=''>Show All</option>
<option>2008</option>
<option>2009</option>
</select>
</form>


Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Multi list Pge question

Dave, thanks for your help. It works great.
Couple of questions about the pull down.

1) Right now "<select>" is set as the default value. How do I make "Show All" the default value?
2) How do I make the selected option stay(sticky)? Right now, it reverts back to "<select>"

here is the link: http://www.synchronoss.com/newsList.php

Thanks!

Re: [greatjakes] Multi list Pge question

By Dave - April 15, 2009

I was trying to keep it simple for you. ;) Try this:

<form method="get" action="?">
<select name="date_year" onchange="this.form.submit()">
<option value=''>Show All</option>

<?php foreach (range(2000, date('Y')) as $year): ?>
<option <?php selectedIf(@$_REQUEST['date_year'], $year) ?>><?php echo $year ?></option>
<?php endforeach ?>

</select>
</form>


It should list all the years from the year in red (feel free to change that one) to the current year and maintains the last entered value on refresh.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Multi list Pge question

Thanks Dave for getting back back to me. I have one more question. Right now it lists the oldest year on the top. How do I reverse the order, so that it puts the most current year on the top? (It should be: Show all, 2009, 2008, 2007...)
Thanks again for all your help.

Re: [greatjakes] Multi list Pge question

By ross - April 16, 2009

Hi

To get that drop down going in the other direction, try using this as the foreach loop:

<?php foreach (range(date('Y'),2000) as $year): ?>

You basically just swap the two options so it starts with the current year and goes to 2000.

Let me know how you make out with this. Thanks!
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

Re: [ross] Multi list Pge question

Thanks Ross, Code works great!
I have one more question. In the editor section (for multi page list), is there a way to turn off the feature that allows user to delete multiple items at once? I want to give my client access to add/delete items, but don't want them to accidently delete all items at once. Also, is there a way to hide the "Advanced Commands" pulldown from showing on sublevel account?

Thanks again for all your help!

Re: [greatjakes] Multi list Pge question

By ross - April 17, 2009

Hi

There is probably going to be a way to remove the advanced commands thing at the bottom of the page. It would likely be a bit trickier to remove the checkboxes that let you select all the articles. I am thinking if we can just remove that advanced commands for low level accounts, you'll be fine.

There are a couple things to keep in mind here though. First, this change will need to be done in the interface templates and will because of that, it's something you would need to do each time you upgrade.

Second, also because it's the interface templates, it might end up being a little trickier than usual. We don't actually suggest or support interface changes but I can at least show you were to look.

Let me know what you think and we'll go from there. Thanks!
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/