This is kind of a complex question.
Let's say I have a workers.php page that contains a lot of worker user profiles.
Let's also consider I would have a proposals.php page. That would be used to create proposals for clients.
In each proposals, the user would have to select which workers would fit the job best.
So when filling a proposal in the admin panel, the user would see a list of all the workers, being able to check which one he would like to add, since he must be able to add multiple workers on the same proposal.
When a worker is added, a little "card" is added on the proposal, containing the photo, bio, and portfolio of the worker.
That card would also contain a "rate/price" section that would also be populated based on the worker profile.
What I need to be able to do, is if for some reasons, the user fills a proposal, and that he must lower the price for a specific worker, or for all of them, for THAT specific proposal (not alter the default value from the workers profile), the user would need some sort of a text field attached to each workers in the proposal page that would let him enter a "edited" price for the job.
The way I thought of doing it would be by using repeatable regions. But I don't know how to make a link between the checked name (worker) and the edited price tag, so that Couch understands that if "John Doe" is selected in row #1 of the repeatable region, it should display his "info card" on the proposal (I'm ok with that part), and that if something is entered for the edited price in the 2nd column of that same John Doe repeatable region row, then it should display whatever is inside that field instead of the "price" field in the Worker profile page.
I thought of doing it that way (in my project it was working better by using an external file for the values. And anyways, I cannot use relation dropdown menus inside of a repeatable region if I remember correctly. So that works for me):
And then, on the proposal frontend :
I tried using "if" conditions, but I cannot find a way to check that the pricing entered in that edit price should match the name of the worker, and be placed instead of the "default_pricing" region if it is filled. But only for that worker.
It is very complex for me to explain this issue since I am not a native english speaker. I hope you will understand.
Thanks a lot!
Let's say I have a workers.php page that contains a lot of worker user profiles.
Let's also consider I would have a proposals.php page. That would be used to create proposals for clients.
In each proposals, the user would have to select which workers would fit the job best.
So when filling a proposal in the admin panel, the user would see a list of all the workers, being able to check which one he would like to add, since he must be able to add multiple workers on the same proposal.
When a worker is added, a little "card" is added on the proposal, containing the photo, bio, and portfolio of the worker.
That card would also contain a "rate/price" section that would also be populated based on the worker profile.
What I need to be able to do, is if for some reasons, the user fills a proposal, and that he must lower the price for a specific worker, or for all of them, for THAT specific proposal (not alter the default value from the workers profile), the user would need some sort of a text field attached to each workers in the proposal page that would let him enter a "edited" price for the job.
The way I thought of doing it would be by using repeatable regions. But I don't know how to make a link between the checked name (worker) and the edited price tag, so that Couch understands that if "John Doe" is selected in row #1 of the repeatable region, it should display his "info card" on the proposal (I'm ok with that part), and that if something is entered for the edited price in the 2nd column of that same John Doe repeatable region row, then it should display whatever is inside that field instead of the "price" field in the Worker profile page.
I thought of doing it that way (in my project it was working better by using an external file for the values. And anyways, I cannot use relation dropdown menus inside of a repeatable region if I remember correctly. So that works for me):
- Code: Select all
<cms:repeatable name='workers_options' label="Select your workers">
<cms:editable name="workers_list" label="Workers" opt_values='workers-list-file.html' separator=',' dynamic='opt_values' type='radio' />
<cms:editable name='worker_edit_price' label="Edit default price value?" type='text' />
</cms:repeatable>
And then, on the proposal frontend :
- Code: Select all
<cms:set workers="<cms:show_repeatable 'workers_options'><cms:show workers_list />,</cms:show_repeatable>"/>
<cms:pages masterpage="workers.php" page_title="<cms:show workers />">
<div class="worker-photo" style="background-image:url('<cms:show profile_photo/>')"></div>
<h4><cms:show k_page_title /></h4>
<p><cms:show worker_bio /></p>
<div>Pricing : <cms:show default_pricing/>$</div>
</cms:pages>
I tried using "if" conditions, but I cannot find a way to check that the pricing entered in that edit price should match the name of the worker, and be placed instead of the "default_pricing" region if it is filled. But only for that worker.
It is very complex for me to explain this issue since I am not a native english speaker. I hope you will understand.
Thanks a lot!