Page 1 of 1
Form-style drop down menu help [SOLVED]
Posted: Thu Jul 23, 2009 10:19 pm
by atomickarma
Hi
I need to build a drop down menu that includes all news items, and is configurable to show news items based on category.
It needs to be a form-style drop down rather than a css drop down.
I've had a good browse and found a couple of form menus for pages, but don't seem to be able to adjust these to show news, only pages.
I'm using 1.5.4 "Carolina"
thanks,
Christian
Re: Form-style drop down menu help
Posted: Fri Jul 24, 2009 12:14 am
by Dr.CSS
You may want to look into learning drop downs here...
http://www.w3schools.com/default.asp
This is where I picked up how to do a menu template to be a drop sown to pick selections...
http://www.medtechglobal.com/ upper right corner is a menu template drop sown to pick the section of the page structure, and w/o the w3school help a long time ago I never would have learned enuf to do the main menu for that site...
Re: Form-style drop down menu help
Posted: Fri Jul 24, 2009 8:56 am
by atomickarma
Dr. CSS wrote:
You may want to look into learning drop downs here...
http://www.w3schools.com/default.asp
This is where I picked up how to do a menu template to be a drop sown to pick selections...
http://www.medtechglobal.com/ upper right corner is a menu template drop sown to pick the section of the page structure, and w/o the w3school help a long time ago I never would have learned enuf to do the main menu for that site...
Hi - I think you've misunderstood my request - I'm quite capable of constructing a drop down menu. The problem isn't this it is with picking up the news items titles in the menu.
Re: Form-style drop down menu help
Posted: Fri Jul 24, 2009 11:24 am
by atomickarma
Here's an example - on
http://www.kasterborous.com/news.asp there's a drop down menu on the bottom half of the page which is a list of all previous items.
I'm trying to replicate this but the closest I've got is using a global item that draws a list of all previous items, calling this in the page template and then wrapping this in the form html.
Unfortunately I get all links in the same line, which is understandable given the way I'm doing it. What I can't work out is how to get each entry on its own line.
Re: Form-style drop down menu help
Posted: Fri Jul 24, 2009 6:11 pm
by Dr.CSS
If "I'm quite capable of constructing a drop down menu" is true then go to content > news and summary template tab hit create new and make one there and call it in a page....
All you have to do is figure out what part of the news template you want to use...
Re: Form-style drop down menu help
Posted: Sun Jul 26, 2009 8:12 pm
by atomickarma
Dr. CSS wrote:
If "I'm quite capable of constructing a drop down menu" is true then go to content > news and summary template tab hit create new and make one there and call it in a page....
All you have to do is figure out what part of the news template you want to use...
There's really no need to respond in that manner. If it is so simple why isn't it in the CMSMS documentation?
I'm certain that if you had read my request properly in the first place, not to mention my responses, you would realise that your initial response was incorrect.
Re: Form-style drop down menu help
Posted: Sun Jul 26, 2009 8:20 pm
by calguy1000
it's not in the CMS documentation because it's so trivially simple it's ridiculous
All that is needed is a new News summary template with 85% of the display removed and built into a ... statement.
.
Re: Form-style drop down menu help
Posted: Sun Jul 26, 2009 8:37 pm
by calguy1000
This took me 10 minutes to build:
http://test.techcom.dyndns.org/cms_16_dev/index.php?page=news-dropdown
URL not expected to live past a few days.
Re: Form-style drop down menu help
Posted: Sun Jul 26, 2009 8:40 pm
by atomickarma
I've tried around a dozen variations of this:
Code: Select all
<!-- Start News Display Template-->
<FORM ACTION="../cgi-bin/redirect.pl" METHOD=POST onSubmit="return dropdown(this.gourl)">
<SELECT NAME="gourl">
<OPTION VALUE="">Choose...</OPTION>
{if $pagecount > 1}
<p>
{if $pagenumber > 1}
{$firstpage} {$prevpage}
{/if}
{$pagetext} {$pagenumber} {$oftext} {$pagecount}
{if $pagenumber < $pagecount}
{$nextpage} {$lastpage}
{/if}
</p>
{/if}
<OPTION VALUE=''">{foreach from=$items item=entry}</OPTION>
</SELECT>
<INPUT TYPE=SUBMIT VALUE="Go">
</FORM>
<div class="NewsSummaryLink">
{$entry->titlelink}
</div>
{/foreach}
<!-- End News Display Template -->
and when I call it I either get every item in one drop down menu entry, or every item with its own Go button.
Please accept my most heartfelt apologies for not being as familiar with the code, tags etc as yourselves. If I was, I wouldn't need to post this request.
I know I'm close and I'll take a push in the right direction if you wanna keep leading me on but there's no need for the bad attitude.
Re: Form-style drop down menu help
Posted: Sun Jul 26, 2009 8:42 pm
by atomickarma
That's great Calguy. I'm certain it IS simple but after 5 days I'm not finding my way here. Thanks for the demo.
Re: Form-style drop down menu help
Posted: Sun Jul 26, 2009 9:03 pm
by atomickarma
This is the closest I've got:
Code: Select all
<!--Start News Display Template-->
<FORM ACTION="../cgi-bin/redirect.pl" METHOD=POST onSubmit="return dropdown(this.gourl)">
<SELECT NAME="gourl">
<OPTION VALUE="">Choose...</OPTION>
{foreach from=$items item=entry}
<OPTION VALUE="{$entry->titlelink}"></OPTION>
{/foreach}
</SELECT>
<INPUT TYPE=SUBMIT VALUE="Go">
</FORM>
<!-- End News Display Template -->
I think this is probably going to do what I want.
I am astonished however at the dismissive attitude. It wasn't even in good spirits. When I first came here in 2006, people couldn't throw enough help at me. What's more disappointing though is how this totally backs up an argument that I fought in a course debate last term about how open source communities are exclusive and restrictive to newcomers.
I'm not even a newcomer and you guys - while granting me with posts - have done me a disservice by making assumptions and being generally the exact type of characters I said weren't floating around here and SMF.
Very disappointing.
Re: Form-style drop down menu help [SOLVED]
Posted: Sun Jul 26, 2009 9:30 pm
by Dr.CSS
Sorry I figured you would at least look at the source to how it was made...
Region: Global
Global
Australia
New Zealand
Ok so now I need the form, select, options, so 1 nonlinked option then the ones I want, I need a title link so in news summary template I just need some parts of this...
moreurl}" title="{$entry->title|cms_escape:htmlall}">{$entry->title|cms_escape}
Region: Global
{foreach from=$items item=entry}
moreurl}">Your Text
{/foreach}
Want to have your form to do something else it looks like you can handle it, you caught most of it quicker than I did...
Re: Form-style drop down menu help [SOLVED]
Posted: Mon Jul 27, 2009 12:24 am
by calguy1000
Why you needed the perl code I dunno... its possible to do this directly in javascript... or if necessary (and I've already posted this in various posts) directly with smarty.
"You can give a man a fish and he eats for a day, but if you teach a man to fish, he eats for a lifetime, and can also teach others to fish".
Re: Form-style drop down menu help [SOLVED]
Posted: Mon Jul 27, 2009 6:30 pm
by Dr.CSS
I hacked that together by looking at other drop down selection things and couldn't get it to work with out it...
I thought he had it figured out [solved] so I was giving him my thought process on how I would have used my links to find a solution, if some one would have told me the same thing that is what I would have done...