Separate category groups in SAEF?
Posted: 15 July 2007 06:07 PM   [ Ignore ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  527
Joined  12-15-2005

I have a weblog to which there are attached two separate category groups. In my SAEF (which is broken across 2 pages) I’m trying to provide users with the ability to use one dropdown to select categories from category group #1, and another one to choose categories from group #2. Is this possible? I’m thinking that they would need to be merged before submission at some point or…?

 Signature 

System Info: Production

EE Version:  1.67
Build
:       20090320
PHP Version
: 5.2.5
Profile
 
 
Posted: 26 August 2007 04:46 PM   [ Ignore ]   [ # 1 ]  
Summer Student
Total Posts:  17
Joined  04-17-2007

i need to do this exact same thing… any help guys?

Profile
 
 
Posted: 27 August 2007 10:27 AM   [ Ignore ]   [ # 2 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  24513
Joined  05-20-2002

I haven’t tried it- but what if you hard code two dropdowns, each with category[] ?  Does that work- I’d think it would.

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 27 August 2007 10:53 AM   [ Ignore ]   [ # 3 ]  
Summer Student
Total Posts:  17
Joined  04-17-2007

well of gives you to drop downs but they are identical and contain a blended alphebetized list of both category groups.  I need the two groups to be separate.

Profile
 
 
Posted: 27 August 2007 11:26 AM   [ Ignore ]   [ # 4 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  24513
Joined  05-20-2002

No- I mean hard code them rather than use the {category_menu} tags- so:

<p>Categories |<br />
<
select name="category[]" size="4" multiple="multiple">
<
option value='16'>Aug. 20-26</option>
<
option value='17'>Aug. 27-30</option>
<
option value='19'>June 12-18, 2005</option>
</
select>

<
p>Categories II<br />
<
select name="category[]" size="4" multiple="multiple">
<
option value='7'>Extensions</option>
<
option value='6'>Modules</option>
<
option value='5'>Plugins</option>
</
select>

Replacing it with your options, of course.  If it works hard coded, then you can use queries or something to dynamically populate each select- as needed.  But try hard coding it first- you can rip the options off of the rendered code from the tag- just put the two groups each in their own select.

Won’t swear it will work, but can’t see why not.

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 27 August 2007 12:22 PM   [ Ignore ]   [ # 5 ]  
Summer Student
Total Posts:  17
Joined  04-17-2007

oh, i see what you mean…but unfortunately I’d need the options to be fairly dynamic.  See, one category group would be for mobile carriers (ie: sprint, tmobile, nextel) and the other group would be for manufacturers (ie: nokia, motorola, panatec).  I’d need the ability for them to add new manufacturers from the front end as they saw fit.

Profile
 
 
Posted: 28 August 2007 08:51 AM   [ Ignore ]   [ # 6 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  24513
Joined  05-20-2002

If it works?  Then it should be fairly easy to dynamically populate the select options.  Well- it gets tricky if you have a bunch of subcats that need formatting.  But populating a straight list of options dynamically is definitely doable.

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 03 September 2007 09:08 AM   [ Ignore ]   [ # 7 ]  
Lab Technician
RankRankRankRank
Total Posts:  1156
Joined  10-22-2006

Here’s an easy example for 3 hardcoded category groups that display seperately in the SAEF.

<table><tr><td>

<
p>Categories<br />
<
select name="category[]" size="6" multiple="multiple">
{exp:weblog:categories weblog="directory" category_group="2" style="linear"}
<option value="{category_id}">{category_name}</option>
{/exp:weblog:categories}
</select>
</
p>

</
td><td>

<
p>Operating System<br />
<
select name="category[]" size="6" multiple="multiple">
{exp:weblog:categories weblog="directory" category_group="3" style="linear"}
<option value="{category_id}">{category_name}</option>
{/exp:weblog:categories}
</select>
</
p>

</
td><td>

<
p>Game Modes<br />
<
select name="category[]" size="6" multiple="multiple">
{exp:weblog:categories weblog="directory" category_group="4" style="linear"}
<option value="{category_id}">{category_name}</option>
{/exp:weblog:categories}
</select>
</
p>

</
td></tr></table>

Now if you want nesting subcategories in that select-boxes (which I do unfortunately) you’re up for some serious thinking it seems…

 Signature 

utilitees - Addons for EE

Profile
 
 
Posted: 04 September 2007 05:38 AM   [ Ignore ]   [ # 8 ]  
Lab Technician
RankRankRankRank
Total Posts:  1156
Joined  10-22-2006

I came up with a solution to indent the subcategories in this scenario.

Perhaps it’s helpful to anyone else.

 Signature 

utilitees - Addons for EE

Profile
 
 
Posted: 24 June 2009 02:32 AM   [ Ignore ]   [ # 9 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  143
Joined  06-04-2002

The solution, a plugin by silenz, partially works.  It formats the output nicely, but also strips out the value=“x” from the option tags.

Any ideas?

(sorry for coming back to an old thread, but I’m trying to achieve the exact same thing.)

 Signature 

Simon Job · blog · twitter | EE sites: maths · church

Profile
 
 
Posted: 24 June 2009 05:32 AM   [ Ignore ]   [ # 10 ]  
Lab Technician
RankRankRankRank
Total Posts:  1156
Joined  10-22-2006

Wee, almost forgotten that one. But you are right.
I’ll post an updated version later.

 Signature 

utilitees - Addons for EE

Profile
 
 
Posted: 24 June 2009 03:49 PM   [ Ignore ]   [ # 11 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  143
Joined  06-04-2002

Great, thanks.

 Signature 

Simon Job · blog · twitter | EE sites: maths · church

Profile
 
 
Posted: 24 June 2009 05:15 PM   [ Ignore ]   [ # 12 ]  
Lab Technician
RankRankRankRank
Total Posts:  1156
Joined  10-22-2006

Revised version can be found here.

 Signature 

utilitees - Addons for EE

Profile
 
 
Posted: 25 June 2009 03:28 AM   [ Ignore ]   [ # 13 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  143
Joined  06-04-2002

Fantastic.

Thanks for the quick fix.

 Signature 

Simon Job · blog · twitter | EE sites: maths · church

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 77454 Total Logged-in Users: 42
Total Topics: 101500 Total Anonymous Users: 26
Total Replies: 544224 Total Guests: 280
Total Posts: 645724    
Members ( View Memberlist )