Skip to:
Content
Pages
Categories
Search
Top
Bottom

1.0 RC – How to force all post into 1 category?

  • In 1.0 RC, it appears I need to have the users select the “forum” or “category” for their new post to be tied too.

    However, I only have 1 forum – so in my post-form.php template, I removed the following code which produces the dropdown list (since only 1 value is selected).

    <label for=”forum_id”>Category:

    <?php bb_new_topic_forum_dropdown(); ?>

    </label>

    But now, when I try to add a post – I receive an error message that says “This topic has been closed”.

    Any idea how I can force all new post into the only forum I have setup … so that I don’t have to display the “category” dropdown menu which only has 1 item listed.

Viewing 8 replies - 1 through 8 (of 8 total)
  • You could probably hide the pulldown using CSS?

    @johnhiler

    Is there any way of doing this beside using a CSS “display: none”. Seems like a hack way of working around this.


    Sam Bauers
    Participant

    @sambauers

    It shouldn’t show when there is only one forum. I’ll fix this in core.


    chrishajer
    Participant

    @chrishajer

    Heh, Sam. It’s been like that since the 0.7 series I think. I’ve only ever had one forum, but it always showed the dropdown :-) I used to fix it but them maintaining the changes across updates became a hassle.

    Also, the width of the dropdown was never wide enough, in FF3 (and FF2) at least. Never really tested it. I can’t recall if it was fixable with CSS or if that width was in the template. I think in the template with a width=”xx” value.

    Was going to take a screenshot just now, but I realized I took the select out in my installation, so people don’t have to choose, and hardcoded the value into the form. BUT, there is still a dropdown with just one value (if you have just one forum) when you’re logged in as keymaster and you have the option to move the topic to another forum. Probably shouldn’t even show the option to move it to another forum if there’s only one.

    Weird that this is just coming up now. I always just thought it was normal.


    chrishajer
    Participant

    @chrishajer

    Frooyo, to answer your question, you can remove that dropdown as you did, but first you need to add the forum name as hidden value to the form. You can look at the source of a rendered page, find the select, grab the form field name and value, and just code that into the form as a hidden value. That way, when you submit the form, it looks the same to bbPress as if someone had actually selected one (of one) value for a forum name.

    Mine looks like this (your forum ID might be different):

    <input type="hidden" name="forum_id" value="1" />


    Sam Bauers
    Participant

    @sambauers

    Trunk now deals with this case.

    [2286] [2287]

    @Sam

    Thanks for the 1.0 release !!!

    Quick question. I don’t believe what you changed in the core is still the desired result.

    I only have 1 forum, and that forum is called = “All”.

    I have the following code in my post-form.php template

    <label for=”forum_id”>Category:

    <?php bb_new_topic_forum_dropdown(); ?>

    </label>

    It’s printing/echoing to the screen the forum name (“All”) –> see image below

    http://img22.imageshack.us/img22/4105/categoryy.png

    The generated HTML is:

    <label for=”forum_id”>Category:

    <input type=”hidden” name=”forum_id” id=”forum-id” value=”1″ /><span>All</span> </label>

    It seems to me that if someone only has 1 forum, that you should simply have the hidden input and NOT print the forum name in any SPAN element at all.

    Do you agree?


    chrishajer
    Participant

    @chrishajer

    I think at this point I would just hide the display with CSS (I think Sam added a class for this select area too). This is much better than it was, for sure. It’s a valid point though.

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.
Skip to toolbar