10 years ago
6
Topic
I want to display the Content view of a form along with a button that executes php code -- how do I get the php code to read the field values?
Thanks!
Get a VIP membership
178 Posts
Jeka
10 years ago
1
Level 1
maybe core42 ? 
10 years ago
0
Level 2
Maybe... thanks Jeka.
693 Posts
rpoy
10 years ago
3
Level 1
Hi kwoychesko,

Buttons work on on Forms (admin/site view), not on content views. Can you give some more details on what you are trying to accomplish? 

thanks,

Randy
10 years ago
2
Level 2
Hi Randy -- thanks very much for your response.

For example, if the Content page being viewed is an "Author" form, I would like to have a button or hyperlink that launches a new "Book" Site form that automatically picks up the Author's name?  So a public user could use this link/button to create a new Book that is related to this Author.

I have purchased a lot of plugins now, so I probably have the right tools to do this but I can't figure it out.
Thanks!
693 Posts
rpoy
10 years ago
1
Level 3
Hi kwoychesko,

Ah!  Thanks, now I see what you want to do! 

This can be done in 2 basic steps.

1. Set up your Site Form (Book) to receive a variable. 
  • Then in the Live Link (option #2) select variable.
  • Configure the variable Type: String, Variable: authorname

2. Set up your Link on Author Name in either the Search & List, or Content Type -  depending how the user is viewing the Content.
  • Then in the Live Link (option #2) select the Typography and HTML:
  • Add: <a href="/URLToForm?authorname=$cck->getValue('author_name');">$cck->getValue('author_name');</a>

So you are basiclly setting up the form with a variable and setting the value using an HTML string with the values that you get from $cck->geValue

Hope that helps,

Randy

10 years ago
0
Level 4
Hi Randy -- that looks like *exactly* what I needed.  I will give it a try.  

Thank you so much!
Get a VIP membership