How to create static content from form data

Post any questions you may have here

How to create static content from form data

Postby mlklocke on Wed Feb 13, 2008 9:06 pm

I want to create a submsission form for users to input project data and then have that data from that form become static content that can be accessed in joomla after you hit the submit button.

Is this remotely anything that chronoforms might be able to do?

I am open to ideas.

Thanks,

Michael Klocke<br><br>Post edited by: mlklocke, at: 2008/02/13 16:06
mlklocke
Fresh Boarder
 
Posts: 9
Joined: Thu Sep 13, 2007 4:03 am

Re:How to create static content from form data

Postby GreyHead on Thu Feb 14, 2008 2:06 am

Hi Michael,

Yes I think so. I'm just not certain about 'static' data. Do you mewan that the data is displayed in a normal Joomla content page?

That can be done. Create two 'forms' in ChronoForms, one to collect the data and a second to display it (you can create a ChronoForms form using any PHP+MySQL+HTML - it doesn't need to have input fields and a submit button).

You can then use the ChronoForms mambot to embed the second form into a Joomla content page.

Bob
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3962
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:How to create static content from form data

Postby mlklocke on Thu Feb 14, 2008 2:46 am

yes i do want to display the form data in a regular joomla page. But please bear with me as i am a newbie to this and dont know how to write php and mysql coding so i have no idea how to do the second form. I know how to use chronoforms to create the first form but have no idea what to do with the second form. how does the mambot figure into all of this as well. I hope i dont sound too stupid here;)
mlklocke
Fresh Boarder
 
Posts: 9
Joined: Thu Sep 13, 2007 4:03 am

Re:How to create static content from form data

Postby GreyHead on Thu Feb 14, 2008 6:03 am

Hi Michael,

OK. Create your first form get it working and checked out then create a table in the ChronoForms Form Manager. If you then look at the AutoGenerated tab you'll see a bunch of fairly cryptic code. Please copy and paste that here (or email a Form Backup to me at the address in my sig) and we'll do the next step tomorrow.

Bob
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3962
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:How to create static content from form data

Postby tanko on Sat Mar 01, 2008 4:18 am

Thanks, I have the same doubts. I'm no programmer and a begginer to Chrono Forms and I'm really interested on how to do this (show records on content).

I want to base almost a whole page on these record generated content and hope it's really possible for me. :blush:
tanko
Fresh Boarder
 
Posts: 2
Joined: Fri Feb 29, 2008 9:12 pm

Re:How to create static content from form data

Postby GreyHead on Sat Mar 01, 2008 4:08 pm

Hi tanko,

It's not too difficult, just do the same as I asked Michael.

Bob
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3962
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:How to create static content from form data

Postby mlklocke on Sat Mar 01, 2008 7:05 pm

Sorry this has taken so long to get back to you on, but I ended up in the hospital and wasnt able to get you my code, but I am back now ;)

Here is what I did:
I created a form in FrontPage and copied the form code to my test form named "recipe" in my chronoforms component and then save it. I then clicked on create table and selected the two fields I wanted saved. There are a total of 4 fields altogether but two of them are the submit and reset button. I then went in and copied the code from the auto-generated tab and have pasted it below.
Code: Select all
<?php
global $database;
   
$database->setQuery( "INSERT INTO #__chronoforms_4 VALUES  (
'' , '". date('Y-m-d')." - ".date("H:i:«»s"«»)."', '".$_SERVER['REMOTE_ADDR']."' , '".mosGetParam($_POST,'Recipe_Name','')."' , '".mosGetParam($_POST,'Recipe_Submitted','')."');" );
if (!$database->query()) {
echo "<script> alert('".$database->getErrorMsg()."'); window.history.go(-1); </script>
";
}
?>
Now i guess the question is how does this get turned into content from here.

A couple of things I will mention. I do have community builder installed and I do see a CR Registration button in my chronoforms engine along with Joomla Registration and Profile Page which look new. Incidentally peopel will not be able to get to this form unless they have registered so i do want the CB registration to be used if possible to tag cb profile information to the form, if indeed that is even what that button is for. I havent quite figured it all out what that is for yet.

Cheers,

Michael<br><br>Post edited by: GreyHead, at: 2008/03/01 20:15
mlklocke
Fresh Boarder
 
Posts: 9
Joined: Thu Sep 13, 2007 4:03 am

Re:How to create static content from form data

Postby GreyHead on Sun Mar 02, 2008 1:28 am

Hi Michael,

Sorry to hear you've been in hospital, trust all is well now.

To answer backwards: the Joomla Registration & CB Registration PlugIns allow you to register new members using a ChronoForms form so that probably aren't what you need here.

The Profile Plugin is more useful as it allows you to pull data from an existing Joomla database table like #__chronoforms_4

To display your data, create a new form. In the form HTML box write the HTML for your display page as usual but put {Recipe_name} and (Recipe_Submitted} where you want that data to show up. Save the form then select it in the forms manager and click the Profile Plugin icon and complete the forms. IIRC correctly it will ask you for the record id field and the names of the fields you want to read. Check the i tooltips for more info.

You can link into cb information - probably through the $my->id which will give you the Joomla user id of a logged in member, you can them look up the CB info. This needs a longer post than I have time for right now. Ask for more when you need it please.

Bob
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3962
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:How to create static content from form data

Postby mlklocke on Sun Mar 02, 2008 4:06 am

Ok you lost me here. I created another form called RecipeContent. In your post you said:

The Profile Plugin is more useful as it allows you to pull data from an existing Joomla database table like #__chronoforms_4

To display your data, create a new form. In the form HTML box write the HTML for your display page as usual but put {Recipe_name} and (Recipe_Submitted} where you want that data to show up. Save the form then select it in the forms manager and click the Profile Plugin icon and complete the forms. IIRC correctly it will ask you for the record id field and the names of the fields you want to read. Check the i tooltips for more info


The parts i am not understanding are higlighted in red. am i supposed to still use the form box such as textbox to display the data or am i supposed to removed the text box and just put {Recipe_Name} and {Recipe_Submitted} in place of the form textbox.

Do you have documentation hiding somewhere on the site that would explain all this? I have looked thru the FAQ's and such and have found no user manual other how to create a form.:)
mlklocke
Fresh Boarder
 
Posts: 9
Joined: Thu Sep 13, 2007 4:03 am

Re:How to create static content from form data

Postby GreyHead on Sun Mar 02, 2008 4:41 am

Hi Michael,

Sorry, this is all new and I'm one step ahead of you. The only documentation so far is in forum posts here.

The important piece to get in this is that ChronoForms is a way of displaying html on a Joomla page. It's usually used to create a form but doesn't have to be.

#__chronoforms_4 is a Joomla table name, except that the first #_ is replaced with a prefix, usually 'jos' . The Profile Plugin has a drop-down that will show you a list of the Joomla database tables - select the corresponding one probably jos_chronforms_4

You put your display code in the Form Code | HTML code box but you don't need to use 'form html'. Just plain ordinary html will do fine. In fact to test you can just write
Code: Select all
Recipe name : {Recipe_Name}

{Recipe_submitted}
though you'll probably want to pretty it up a bit more than that.

Set the email validation, anti-spam etc to 'No' and create a page link which has a parameter and value at the end. Like index.php?com_chronocontact&chronoformname=recipes&recipe_id=1

You'll need to have put 'recipe_id' in the Profile Page form as the REQUEST Parameter name; and the database record id, probably 'cf_id' in the Target field name box.

Bob<br><br>Post edited by: GreyHead, at: 2008/03/01 23:41
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3962
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:How to create static content from form data

Postby mlklocke on Sun Mar 02, 2008 12:20 pm

Okay i tried what you said in your last post and the information is not coming back in the content page when i click on the link in the chronoforms component.

Here is what i am getting in the content page when i click the link in the chronocontact forms page

Recipe Name {name}
Recipe {recipe}

Its just showing the field names. i have the mambot published. i used recipe_id as the parameter in the profile manager and I used cf_id as the target.<br><br>Post edited by: mlklocke, at: 2008/03/02 07:27
mlklocke
Fresh Boarder
 
Posts: 9
Joined: Thu Sep 13, 2007 4:03 am

Re:How to create static content from form data

Postby GreyHead on Sun Mar 02, 2008 2:26 pm

Hi Michael,

Two possibilities - both my fault I think.

In the form you need to go to the PlugIns tab and check the Profile Page box to tell the form to use the PlugIn.

This form won't work correctly from the From Manager link because it needs to be called from a URL with the extra parameter i.e. &recipe_id=999 (or some valid recipe id). You can't have a static link to a dynamic page.

Do either or both of these do the trick?

Bob
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3962
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:How to create static content from form data

Postby mlklocke on Sun Mar 02, 2008 8:57 pm

Hello Bob,

They say genious comes to all of eventually one inch at a time! Thanks for the additional information. I was not seeing that at all as i was so focused on the Profile Manager button. The plugin tab was the key to the whole thing. Thank you so much.

Now i have one more question. I can now bring up the one recipe that i have. If i had a 1000 recipes how would i be able to just do something like click "next" to see the next one?:P

The way i have the content page done now is i created a static content page and i linked it to the user menu which can only be seen by registered users.
mlklocke
Fresh Boarder
 
Posts: 9
Joined: Thu Sep 13, 2007 4:03 am

Re:How to create static content from form data

Postby GreyHead on Mon Mar 03, 2008 12:13 am

Hi Michael,

To have previous / next links (or any other kind of link) you can put in a text or image link of the same form as you used to see this page with a different recipe_id=nnn

If you have a continuous library then you can set:
Code: Select all
<?php
$next_recipe = $_GET['recipe_id'] + 1;
?>
<a href='index.php?option=com_chronocontact&chronoformname=my_recipes&recipe_id=<?php echo $next_recipe; ?>' >Next recipe</a>
You'd probably make it prettier than that but basically that's it.

Bob

PS I imagine that you'll shortly want to do more complex things that require some custom database searches. Please come and ask when you do.
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3962
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:How to create static content from form data

Postby tanko on Tue Mar 04, 2008 8:21 pm

Hi! Thanks for your patience and support.

I was able to make a simple form and tried to follow Michael's steps for testing purposes. Created table, then created a new form where I pasted the code:

Recipe Name {name}
Recipe {recipe}

I'm sure I'm missing something ( not a surprise here B) ), because I can only get this code instead of the generated results.

Can't understand how both forms relate. Maybe I should have set more parameters apart from the basic form code? Like the field names? Sure I gave inputs similar names to the {} tag names, but I'm not sure if it was the right thing to do.

Also, plugin. If I don't have CB installed, I can't use plugins? (apart from the downloadeable mambot, I mean)

Sorry for being such a begginer. And thanks for the attention.
tanko
Fresh Boarder
 
Posts: 2
Joined: Fri Feb 29, 2008 9:12 pm

Next

Return to ChronoForms Questions & Answers

Who is online

Users browsing this forum: Yahoo [Bot] and 4 guests