• Hi
    great plugin and it so very nearly does what I need.

    I run a members site and use roles extensively to manage member privileges. That means a member may have 2 or more roles – ie his default role and others that allow him to do things.
    So in this context (ie creating a post) I need to be able to assign a post category to a each post based on the role that is currently ‘active’ for the member. I have found I can assign a default category to each role in ‘frontier post settings’ but this is not working when a user has multiple roles – understandably the plugin finds the first matching role for him and assigns that default category to the post. More often than not, that is the wrong one.
    So I need away to assign/set the category (without user action) when the post is actually created.
    Is there a way I can do this – perhaps via a new parameter (eg. set_category_to=”something”) to the shortcode in addition to the “frontier_mode=add” parameter?.
    I cant allow the member to select a category from a list because they will often get that wrong too.

    https://www.ads-software.com/plugins/frontier-post/

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter ray

    (@ryoung-1)

    Further to the above
    I also need the edit/delete functions to be restricted to the ‘active’ role and not to a member username who might have multiple roles to fulfill. ie in this context he might be able to create posts under multiple categories (eg an all members announcement and one or more special user group announcements) and I want him to only be able to edit/delete posts within the context of the ‘active’ role.

    Plugin Author finnj

    (@finnj)

    Iwil give this some thoughts, but I believe you would be able to solve your challenges using the template form functionality desribed in faq

    Are you able to write at least basic php & html ?

    Can you supply a link to your site ?

    Thread Starter ray

    (@ryoung-1)

    Hi finnj
    My production site is https://www.kalamundamensshed.org.au and there is a little public information available there. But this doesn’t yet have any implementation of the testing I am doing.

    I am doing my work on a development and testing site. I am happy to give you login access to this development site for a while if there is a way for me to send you login details privately.

    I am not a php coder by any means but I understand enough to do a good job of cutting, copying and pasting of existing code. I have been a programmer in a previous life so i understand things i just don’t know the language and syntax.

    I have indeed already modified the template to be a very basic form. That was before I found the way to hide things by role so I have probably overdone the code cutting. I want a really simple user interface which allows only the input and editing of a title and the post content to be available to my member. I did look at adding code to your beta template but it was beyond my skill set to do so. So if I can hide and set things by template coding then I’m certainly prepared to give it a go if I can get guidance on how to go about it.

    Plugin Author finnj

    (@finnj)

    a couple of questions:

    What plugin do you use to manage that a user can have multiple roles ?

    how can you determine what is the active role ?

    Thread Starter ray

    (@ryoung-1)

    I use “user role editor”.

    I use menus to control what they do. So (if for example) they were a member of the management committee they could select (say) “create a member announcement” item from the ‘management’ menu (as displayed to them by their assigned roles) and thus I know what role is ‘active’ for that particular menu item and I can then set the post category that I want used (so later I can display posts for that category correctly on a members announcement area). That same person may also be a member of a special interest group (who are identified by yet another role) and needs to create posts under a totally different category to be displayed in (say) an area specific to that special interest group. Of course I can potentially have many special interest groups.

    Plugin Author finnj

    (@finnj)

    As I see it there are 2 challenges:

    1: Users are able to have multiple profiles, and they are able to switch between these profiles during their session. When they change profile their capabilities in Frontier Post should change accordingly.

    I dont think this will be a huge issue, as Frontier Post uses WordPress capabilities and not the profile itself. I can implement a setting so the capabilities is not set within Frontier Post. This means that you will have to set the capabilities within User Role Editor, which I believe you can
    The capabilities used is like: frontier_post_can_add, frontier_post_can_edit.
    – Can you check if you manually can create capabilities in User RoleEditor
    2: You want post to be set with a predefined category depending on the users current role – That would be possible using the templates as long as we gan get the current role. WordPress can only return an array of profiles. The question is if User Role Editor has a function available to other plugins returning the active role…..
    Are you using the pro og free version of User Role Editor?
    Alternatively, there might be a different way around this, if you are structuring your pages and menus using categories, I will most likely be able to fetch that category, and use it in the post.
    I can easily implement a category in the shortcode, but I am not sure that will be the best option

    Plugin Author finnj

    (@finnj)

    I would like to see your test site – Don’t need a admin login, just need to see how you structured content.

    email: wpfrontier99 and it is a gmail account – OK ?

    Thread Starter ray

    (@ryoung-1)

    Hi finnj.

    I’ll email you a login a bit later after I set up a test member profile. I’ll give you more details in the email.

    What your suggesting is not quite what I need. I don’t want the member to have to have to change their profile to set the ‘active’ role. ‘Roles’ are not a concept members understand – its a administrator concept used for controlling what can and can’t be done. That is why I thought a shortcode parameter would be the way to go as then I (the admin) would be able to control which category is set by using the appropriate shortcode behind the relevant menu item.

    Templates are good but I think I would need a ‘template per (active) category’ so I could change the member ‘form’ to suit their particular activity.
    For example the current template, the form displayed by the ‘frontier-post’ shortcode has a heading ‘create a post’. I would need to be able to set this to (in my examples above to ‘create a member announcement’ and ‘create a Special Interest Group announcement’ respectively.
    Similarly, at the moment anyway, I don’t need all ‘save’,’save and return’,’save and preview’ and ‘cancel’ buttons on the form. As all my ‘posts’ are to be published (ie no drafts etc allowed), I only need a button that says ‘Post member announcement’ (or what ever)and optionally another to ‘cancel.
    I realize I can make changes to the to the template (and have done so by cutting out and changing labels in the template code) for these things to match one ‘active category’ but I can’t do that for two or more categories that become ‘active’ at different times to different (or the same) member. I can see that php code (if then else or case type of coding) could be written if there was a parameter on the shortcode that contains the ‘active category’ (by name is my preference, not id) but that level of php coding is beyond me at the moment.

    Plugin Author finnj

    (@finnj)

    I believe I understand what needs to be done, it will most likely take some days – will look at it over the weekend.

    I need to make some changes that can affect existing users, so I need to think it through. But the changes makes sense, so I will get back soon

    Thread Starter ray

    (@ryoung-1)

    thanks finnj
    just checking – did you receive the email I sent yesterday?

    Plugin Author finnj

    (@finnj)

    Hi,

    I have uploaded a test version I would like you to take a look at:
    v 2.7.1

    Take a copy of ../wp-content/plugins/frontier-post/
    Download the zipfile
    Unzip yhe file
    Overwrite the contents of ../wp-content/plugins/frontier-post/ on your test system

    Changed in version 2.7.1

    – New options in settings: Set Capabilities externally:, if this is checkked all capabilities can be managed from User Role Editor
    – New default category parameter for shortcode: [frontier-post frontier_cat_id=24]
    – New widget Frontier new category post. Can be placed on category pages, and even (when finished) only show up on category pages. it will call the add post, and populate category from the page.

    Still to do:
    – Cleanup and finish code ??
    – Add options in settings for the different buttons

    Be aware if your changed frontier_form.php is located in the plugin folder, it will be overwritten.

    If you can test the capabilities and the shortcode I will most likely be able to release Sunday.

    Then I can also help you with the template form.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘How to assign a category without user selection.’ is closed to new replies.