Extending the example FAQ
Permalink Browser Info Environment
Hi,
I'm using the Example FAQ as a base to try and get in and get started developing, I'm attempting to modify it to store additional information (more fields).
I have added some new fields to the form etc but cannot figure out how to save them to the DB and am going round in circles looking for documentation. (I am in the process of working through the developer videos, but in a hurry for this one)
Is it possible to add extra fields to this set up or am I barking up the wrong tree?
I'm using the Example FAQ as a base to try and get in and get started developing, I'm attempting to modify it to store additional information (more fields).
I have added some new fields to the form etc but cannot figure out how to save them to the DB and am going round in circles looking for documentation. (I am in the process of working through the developer videos, but in a hurry for this one)
Is it possible to add extra fields to this set up or am I barking up the wrong tree?
Type: | Discussion |
---|---|
Status: | New |
I created a block to save this items.
This block added the table btDCAltaCursos in DB.
SinglePage/controller.php
This block added the table btDCAltaCursos in DB.
SinglePage/controller.php
private function saveData($p) { $bt = BlockType::getByHandle('alta_cursos'); //print_r($_POST); //echo print_r('Aixo:'.$bt->btID); $data = array( 'cOneDate' => $this->post('cOneDate'), 'cTwoDate' => $this->post('cTwoDate'), 'cThreeDate' => $this->post('cThreeDate'), 'cFourDate' => $this->post('cFourDate'), 'cFiveDate' => $this->post('cFiveDate'), 'fID' => $this->post('fID'), 'cFoto' => $this->post('cFoto') ); $p->addBlock($bt, 'Main', $data); }
Viewing 15 lines of 16 lines. View entire code block.
Hola amigos,
Mi problema es el siguiente?.
Siguiendo el ejemplo Example_fac.
He añadido al package un block nuevo.
En este block tengo la siguiente información.
add.php
edit.php
update.php
save.php
view.php
db.xml
controller.php
Controller.php
Mi problema es el siguiente?.
Siguiendo el ejemplo Example_fac.
He añadido al package un block nuevo.
En este block tengo la siguiente información.
add.php
edit.php
update.php
save.php
view.php
db.xml
controller.php
Controller.php
class AltaCursosBlockController extends BlockController { protected $btName = 'alta_cursos'; protected $bName = 'alta_cursos'; protected $btDescription = 'alta_cursos'; protected $btTable = 'btDCAltaCursos'; protected $btInterfaceWidth = "700"; protected $btInterfaceHeight = "450"; protected $btCacheBlockRecord = true; protected $btCacheBlockOutput = true; protected $btCacheBlockOutputOnPost = true; protected $btCacheBlockOutputForRegisteredUsers = false; protected $btCacheBlockOutputLifetime = CACHE_LIFETIME; public function on_page_view() { $html = Loader::helper('html'); $this->addFooterItem(Loader::helper('html')->css('jquery.ui.css'));
Viewing 15 lines of 39 lines. View entire code block.
Hi,
You might try posting this question in the "Building with concrete5" forum, it gets more traffic from developers:
http://www.concrete5.org/community/forums/customizing_c5/...
You might try posting this question in the "Building with concrete5" forum, it gets more traffic from developers:
http://www.concrete5.org/community/forums/customizing_c5/...
I have not dug too deeply into the example FAQ, but it appears to be based off of standard pages. So potentially you should be able to simply add Attributes to those pages that are part of your FAQ section and then in the page list block template included in the example FAQ you should be able to do
To display that attribute.