Hi I would love to use this plugin but how do I set it so that it automatically selects the 1 category I want visitors to post in to ?
set it to auto select a category
(2 posts) (2 voices)-
Posted 1 year ago #
-
try
taxonomy='category' taxonomy{category}{include}=1in the shortcode arguments (to include cat#1) ?
Posted 1 year ago # -
yes, i tried that, it displays the 1 category but I want to auto select it
something like [oqp_form taxonomies='category' taxonomies{category}{include}=13{selected}=true]Posted 1 year ago # -
I'd like to know how we can auto select too!
Posted 1 year ago # -
I did as follow.
In the form editor from plugin options i set the relevant categories as expected (i.e. category + required + include=9,30 in my case).
Then in the form template file i manually make sure categories are passed along creating a matching hidden field for each category. Name has to be "oqp_category[]" for every field and the value correspond to the category id (again one field for 9 and one for 30 in my case). Place the new fields right on the point where all other hidden fields are already present: you'll easily find it, search for "oqp_action" to help you out.
Finally you just hide the checkboxes block the plugin generate for the user to choose from in the frontend with a display: none css rule.
That's it.
The receiving end in the form code will just find the values it is expecting in the allowed categories and it'll accept those just as the user made the choice.In the form template you can even switch the category based on the form name (slug to be correct) if you set more than one. Just check the value of "$oqp_form->slug" property against an if statement. So to have different forms for different kind of posts and user contribution throughout the site.
Posted 1 year ago #
Reply
You must log in to post.