Forums

Pass a variable to another page

omissirev 05 May, 2009
Hi
I'm building a kind of a project submission, I managed to make project editing and submission working, but I want to display all my projects in a table and I want to add a link to view one of my projects on another page. I am trying to pass the "cf_id" of the project that I want to view, in order to make a querie to show all fields of that cf_id


(sorry my english, I hope you don't give up on trying to help me 😟 )

Thanks in advance
GreyHead 06 May, 2009
HI omissirev,

There is a good worked example of ChronoConnectivity in the forums here posted by benblee. Follow this through adn you will see how to create these links.

Bob
omissirev 06 May, 2009
Hi GreyHead,
I've done what you said but I can't still do what I want, what I want to do is to select one of the rows of the table and open it on another form
omissirev 07 May, 2009
Hi again,
I found here in the forums something called smoothbox that can do what I want, but is there an alternative to smoothbox?

please help
thanks
peter49 15 May, 2009
Hi omissirev,

in my own application I did something that might help you in solving your problem.
In one CC table I show a list of record summaries. For each record I include a link that opens up another CC table that contains a full display of the record.
Each row in the summaries list contains an element
<td>
  <a href="index.php?option=com_chronoconnectivity&connectionname=record_details + &record_selector={cf_id}">{record_summary_field}</a>
</td>

Replace "cf_id" by the field that contains the auto-increment id of your actual record.
Replace "record_details" by a connection you create for showing the full record.
Replace "record_summary_field" by a field in your record that contains a meaningful short description.

In the new CC table for displaying a full record you should use as "WHERE SQL":
WHERE cf_id="<?php echo JRequest::getVar('record_selector') ; ?>"

Again, you may need to change "cf_id".
This WHERE clause will yield only one record from your table, being the one having the intended cf_id, therefore the "Body" element will be used only once.

Good luck!
geeknet 27 Aug, 2009
Hello Peter,

Im trying to use your codes, but do I need to make a new table in the body.

Roy
peter49 27 Aug, 2009
Hi Roy,

you need to define two connections in the administrator part.
One that will show the overview and that contains the code in my first code box. It's this connection that generally will be directly accessible from a menu.
You'll have to build a second connection that shows the full detail. It will be referenced from the first connection, and contains the code from my second code box. This connection cannot be directly accessible fom a menu, as the parameter will not get any value in that case.

Hopefully this makes thing more clear to you.

Peter
Jayne 19 Feb, 2010
Just : Thank You !!!
It works perfectly, after days of intensive search with my php-noob-brain.




Edit : I can post my example if you wantπŸ™‚

PS : I'm french so excuse my unfair english :mrgreen:
This topic is locked and no more replies can be posted.