Former thread hijacked:Can Fabrik insert a new date field into content catagory?

caputo737

New Member
Sorry to repost but a spirited discussion hijacked my last question, which was:

Is it possible to use Fabrik to:

1. Add another selectable date field (in addition to the Date Created and Date Modified) and a time field to Articles in a specific category.

2. Display those article's titles by the new date and time fields in a list format. i.e.

"Tuesday, August 3rd (This is one value for the new selected date field)

[new_time_field_value] Content Title 1
[new_time_field_value] Content Title 2
[new_time_field_value] Content Title 3
etc

"Wednesday, August 4th (Next value for the new selected date field)
[new_time_field_value] Content Title 4
[new_time_field_value] Content Title 5
[new_time_field_value] Content Title 6

Andre was kind enough to respond. My follow-up questions are in yellow. Thanks!

My biggest question is can someone with basic html and CSS knowledge but no PHP/MySQL learn enough from the subscriber documentation to do this?
---------------------------------------------------------------------------
Hi Jason,

The answer to that is a yes you can use Fabrik to create a new element, however the current latest revision 1.4b rev 122 has a bug in it relating to the store to database function on the form view...

Has this bug been resolved?

You will have to know ahead of time what all the data types for the jos_content table are,

How do I find this out?

and then generate the fabrik table from the Fabrik Table administration by clicking new and selecting the connection and the table. Then you will have to go to the elements view and reset all of the elements to match the Joomla jos_content data types. If you don't get this part right then Joomla will stop working. You would then add a new element to the group, set the type to Date, then go to the Form administration and click store to database.

To restrict your results to specific dates you would use the pre-filters to specify what to show. Alternately you could also use the group by and the prefilters to show a range sorted by date. This would require you to create a custom view in order to show the group by statements correctly since they can't anticipate how a view should look in that circumstance.

Hope that was helpfull,

Andre
 
Re: Former thread hijacked:Can Fabrik insert a new date field into content catag

Hi Jason!

I'm someone with html and CSS knowledge and enough knowledge to be effective yet dangerous with PHP and mysql.

1. Yes. Just add one new elements and make sure it's in your group, of type "date" and format the date format string (last option on the create element form) according to the php conventions, shown here: http://us.php.net/date in that pages's example: Example 439. date() Formatting

2. Yes. I'm pretty sure you can do this, although someone more experienced in the nuances of Fabrik may be able to answer definitively. In the Fabrik back end, select your table from the tables list. Click on the "Data" tab on the right and then look for the "Group By" section in the data tab. Choose your new date field for the "Group By" and then choose ascending or descending. I dunno about inserting the divider tags like "Tuesday, August 3rd" etc. at the breaks in every group, however.

Your mileage may vary, hope this helps...
 
Hi Jason,
To save yourself much grief, please read the portion of your previous hijacked thread that referred to modifying the table structures:
http://fabrikar.com/index.php?option=com_smf&Itemid=9&topic=1045.msg4312#msg4312

BEFORE you create your table from the jos_content table, then you would set all your elements to match basic types from the column.

Once that is done, and you have tested adding a new content item, you can add a new element to the generated group of the rest of the elements, go to forms and say store to database. If that fails, you will have to undo the change that Rob had you do in the other thread.

Once again, try all of this in TESTING first and NOT on a production box!!!

Here is the table structure of the jos_content
+------------------+------------------+------+-----+---------------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------------+------------------+------+-----+---------------------+----------------+
| id | int(11) unsigned | NO | PRI | NULL | auto_increment |
| title | varchar(100) | NO | | | |
| title_alias | varchar(100) | NO | | | |
| introtext | mediumtext | NO | | | |
| fulltext | mediumtext | NO | | | |
| state | tinyint(3) | NO | MUL | 0 | |
| sectionid | int(11) unsigned | NO | MUL | 0 | |
| mask | int(11) unsigned | NO | MUL | 0 | |
| catid | int(11) unsigned | NO | MUL | 0 | |
| created | datetime | NO | | 0000-00-00 00:00:00 | |
| created_by | int(11) unsigned | NO | | 0 | |
| created_by_alias | varchar(100) | NO | | | |
| modified | datetime | NO | | 0000-00-00 00:00:00 | |
| modified_by | int(11) unsigned | NO | | 0 | |
| checked_out | int(11) unsigned | NO | MUL | 0 | |
| checked_out_time | datetime | NO | | 0000-00-00 00:00:00 | |
| publish_up | datetime | NO | | 0000-00-00 00:00:00 | |
| publish_down | datetime | NO | | 0000-00-00 00:00:00 | |
| images | text | NO | | | |
| urls | text | NO | | | |
| attribs | text | NO | | | |
| version | int(11) unsigned | NO | | 1 | |
| parentid | int(11) unsigned | NO | | 0 | |
| ordering | int(11) | NO | | 0 | |
| metakey | text | NO | | | |
| metadesc | text | NO | | | |
| access | int(11) unsigned | NO | MUL | 0 | |
| hits | int(11) unsigned | NO | | 0 | |
+------------------+------------------+------+-----+---------------------+----------------+
 
Re: Former thread hijacked:Can Fabrik insert a new date field into content catag

Wow Thanks! I am starting to get a clearer picture. Thanks for warning to - this is all on testing environment.
 
Re: Former thread hijacked:Can Fabrik insert a new date field into content catag

Oh... I completely missed the part about you were attempting to add data to the EXISTING Joomla articles, and mess around with the joomla content database and not on a separate article thing that only Fabrik would handle.

I agree with Andre... tread lightly and backup often if you do this.
 
Re: Former thread hijacked:Can Fabrik insert a new date field into content catag

Great advice all thank you. One more question - Can anyone suggest a good tutorial that might help me with the basic skills I need to do this better? I am looking into taking a Lynda.com tutorial on PHP and MYSQL. Thanks again.

Jason
 
Hi Jason,
I would also look into using phpMyAdmin:
http://sourceforge.net/projects/phpmyadmin/

As this will quickly allow you to do things like backing up your database, and is available on most hosted web servers.
You actually need very little php in order to use Fabrik, but it definitely helps to know something about mySql when working with other peoples tables.

Andre
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top