I don't know if it's even possible...
But I was curious if I could link my 'edit' button that users see on the front end to edit their article, to a chronoform that has the fields auto-populated with the appropriate data from the database (article title, intro-text, etc)?
I use a chronoform to submit articles on my site (which you guys so graciously helped me get working, and it works great now!)...
When users want to 'edit' their article, I would love to give them basically that exact form again except with all the information pre-filled from the existing article they're editing.
Is this a possibility? In theory I think it is - if my understanding is correct I would need to simply update the default "edit" buttons in Joomla to point to the chronoform, then the chronoform would have it's elements auto-populated via custom php that pulled out the appropriate parts and put them in the right form inputs.
Does that sound moderately possible or am I getting into something not feasible?
But I was curious if I could link my 'edit' button that users see on the front end to edit their article, to a chronoform that has the fields auto-populated with the appropriate data from the database (article title, intro-text, etc)?
I use a chronoform to submit articles on my site (which you guys so graciously helped me get working, and it works great now!)...
When users want to 'edit' their article, I would love to give them basically that exact form again except with all the information pre-filled from the existing article they're editing.
Is this a possibility? In theory I think it is - if my understanding is correct I would need to simply update the default "edit" buttons in Joomla to point to the chronoform, then the chronoform would have it's elements auto-populated via custom php that pulled out the appropriate parts and put them in the right form inputs.
Does that sound moderately possible or am I getting into something not feasible?
Hi hannylicious,
It should be completely possible to create a form to edit an article. I'm not so sure about linking it to the Joomla! Edit button - that might need a little JavaScript or a hack to change the URL.
Bob
It should be completely possible to create a form to edit an article. I'm not so sure about linking it to the Joomla! Edit button - that might need a little JavaScript or a hack to change the URL.
Bob
Alright great, that gives me a wonderful start.
Would I have to use something like the DB Record Loader event to load the data from the db into the form?
Creating a blank form is easy enough, but trying to switch it up and use it for article editing is going into new directions for me. As powerful as Chronoforms is, I'm just starting to tap into some of the more powerful features. (V4 makes it much easier to do that, btw.)
Would I have to use something like the DB Record Loader event to load the data from the db into the form?
Creating a blank form is easy enough, but trying to switch it up and use it for article editing is going into new directions for me. As powerful as Chronoforms is, I'm just starting to tap into some of the more powerful features. (V4 makes it much easier to do that, btw.)
I've answered my own question by playing around.
I was able to use that DB Record Loader and pass the ID through the URL to the proper form.
Such a great tool, V4 is truly amazing. It gives so much control so easily, and allows everything to be edited via the wizard interface.
I can't stress enough how great the tools are you guys provide to the public. I definitely owe you all a few beers😉
I was able to use that DB Record Loader and pass the ID through the URL to the proper form.
Such a great tool, V4 is truly amazing. It gives so much control so easily, and allows everything to be edited via the wizard interface.
I can't stress enough how great the tools are you guys provide to the public. I definitely owe you all a few beers😉
Okay - so I've yet another stumbling block (although, I am close to the end - yay!).
I've loaded the proper ID from the DB to bring the article into the form...
I have 2 text areas that show the appropriate information for the article (introtext and fulltext) - but I have certain elements in the intro text I'd like to pull out and put in other inputs on the form.
For example, my intro text reads:
I want to 'strip out' the 'user-sub-summary' text and put it into it's own input box so the user may change that text.
Using the standard Joomla edit form I was able to get it to populate to an input box by using this code:
I created a custom element in my form and put that code in there, and have tried some different variations of that code, but I cannot get it to display the text I'm after.
It's as if it doesn't recognize "$this->article->introtext;" because I tried to just echo that and it didn't work either.
Any ideas?
I've loaded the proper ID from the DB to bring the article into the form...
I have 2 text areas that show the appropriate information for the article (introtext and fulltext) - but I have certain elements in the intro text I'd like to pull out and put in other inputs on the form.
For example, my intro text reads:
<span class="article-title1"><div id="user-sub-summary">I Love Introductions</div></span><div id="user-sub-intro"><p>introarticle</p></div>I want to 'strip out' the 'user-sub-summary' text and put it into it's own input box so the user may change that text.
Using the standard Joomla edit form I was able to get it to populate to an input box by using this code:
<div class="article-edit">
<label for="summary">
<?php echo JText::_( 'Summary' ); ?>:
</label>
<input class="inputbox" type="text" id="summary" name="summary" value="<?php
$intro = $this->article->introtext;
$regex = '#\<div id="user-sub-summary"\>(.+?)\<\/div\>#s';
preg_match($regex, $intro, $matches);
echo $matches[1];?> "/>
</div>
<div style="clear:both;">I created a custom element in my form and put that code in there, and have tried some different variations of that code, but I cannot get it to display the text I'm after.
It's as if it doesn't recognize "$this->article->introtext;" because I tried to just echo that and it didn't work either.
Any ideas?
...I have to remind myself sometimes to KISS (keep it simple stupid!)
Solved my problem and allowed me to manipulate the data how I wanted!
$form->data['introtext'];Solved my problem and allowed me to manipulate the data how I wanted!
This topic is locked and no more replies can be posted.
