Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
My use case scenario is as follows.
I have a taxonomy vocabulary called "Company" with unique terms "Company 1", Company 2" and so on. Each node in my setup has a term reference for this as mandatory. Similarly, every user is associated with one term with a custom field.
What I want is to restrict a user to only see/edit the nodes that are attached to the same term ID. e.g. If user A is associated with "Company 1", he/she can only view the nodes that are associated with "Company 1".
I am using "TAC" module to achieve this. But it only allows for the taxonomy based access control based on hard coded values whereas I am looking for dynamic reference to the tid in userfield.
PS: I am relatively new to Drupal
Do it on your own. Use hook_node_access and write your own logic there:
https://api.drupal.org/api/drupal/modules%21node%21node.api.php/function/hook_node_access/7.x
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
I am trying to figure out how to store user specific data in Wordpress. The user is supposed to insert their weight, the date and then be able to make multiple entries so that each entry can be presented in a table for that specific user.
I was wondering if this is possible to do through a plugin like JetEngine? And would this be possible to do through meta data or would I have to use something like Custom Content Type?
Thank you in advance.
There's two solutions for your problem.
Easy solution
Use a plugin like ACF with repeater add-on and create custom field for each kpi (weight, height, etc.) and for each add two sub field date and value.
House made solution
Create a json structure to be saved in the user meta which then decodes in php to show it in a table.
About this solution.
// The information return via $_POST
$weight=json_encode($_POST['weight']);
update_user_meta(get_current_user_id(),'weight',$weight)
// To show this information
$weight=json_decode(get_user_meta(get_current_user_id(),'weight',true);
// Create the table.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I have a project in which I am required to offer a customer to download an ebook upon the purchase of a physical book. However, I've only found ways to sell physical and electronic products separately.
Is there a way to combine the 2?
I think what you mean is to have a variable product ? You can have 2 variables, and one of them are virtual (your ebook).
Create a variable product and attribute him 1 variable, name it like you want (in this case the best is probably " Physical or Digital "), add the name of your both variables : ebook | book (or what you want).
After that, on the " variables " tab on the left from the same settings, add your both variables.
Like that, your variables are separate on the same product.
Check the box virtual (see the picture), and for the second variable, you can not check the box.
I think it's what you want ? With that, the first variable with virtual option don't have any ship fees.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
Say I have a site with two types of user
contentCreator
and
contentUser
What I want to do is :
contentCreator has to pay to have an account, and once logged in, has feature set X.
contentUser can register for free, and once logged in, has feature set Y.
All I need is a pointer in the right direction to get me started.
This can be achieved using a membership plugin where you have a free and a paid membership structure and limit the content access based on the user membership plan.
You can use plugins like Simple Membership and configure it to have both paid and free memberships.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I'm building a multilingual site (with i18n module and entity translation). I've added a field collection on user profile type (with profile2 module ). How can user translate the content of the field collection of here profile ?
knowing that I have this error message with entity translation
The entities of type Field collection item do not define a valid base path: it will not be possible to translate them.
The entities of type Node registration do not define a valid base path: it will not be possible to translate them.
The entities of type Profil do not define a valid base path: it will not be possible to translate them.
I have activate "Users may translate this field".
thank you
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I need to create a WP site which will have multiple subjects. Each subject will have multiple lessons and each lesson will have meta data like title, description etc etc. A User will be allowed to read some lessons and based on number of lessons read, he will be assigned some custom badges.
While showing any lesson, we should be able to show the list of users who have already read that lesson.
To get this done on WP, I am planning to use some Custom Content Type Plugin which I can use to create Subject, Lessons and the User Meta to store users action on any lesson. The Badges can also be made part of Users Meta.
The Problem I see are
I dont know any way to map Subjects to Lessons i.e while creating a new lesson, I should be able to map it to one subject (like we do node linking in Drupal )
I am not use if User meta table can be used to store many to many info like "XYZ user have read 25 lessons" and "ABC Lesson was read by 10 Users"
What should be the best design for this kind of Application.
cant you solve problem 1 with categories?
And if you save each 'read' in the usermeta with each lesson having an unique meta. You could just count those.
I dont know any way to map Subjects to Lessons i.e while creating a new lesson, I should be able to map it to one subject (like we do node linking in Drupal )
Why don't you set up the subjects as categories? Then when you create each lesson you can map it to the subject category.