Buy Now
Sign in

Need help with displaying correct DATA VIEW data

revive , October 10 2008, 03:32
R
revive 111
October 10 2008, 03:32 #14910
Hello,
I am just now trying out ChronoConn., after seeing what a great extension the ChronoForms and ChronoComments are.. I couldn't wait! What a powerful set of tools!

Anyway, on to the question.. I am just trying to put together a test connection, that shows all the articles in a specific section.. from within the jos_content table.

In the admin Data View, my Data View Field names are: title,sectionid,catid,created and my Data View Column Titles are: Title, Section, Category, Created

Those work fine and display correctly.. but, in my Data View it shows ALL articles from all sections..

Here is my Record Edit Template:
<?php

$editor =& JFactory::getEditor();

?>

<table>

<tr>

<td>Title:</td><td><input type="text" name="title" size="100" value=""></td>

</tr>

<tr>

<td>IntroText:</td><td><?php echo $editor->display( 'introtext', '' , '100%', '350', '75', '20', false ) ; ?></td>

</tr>
<tr>

<td>MainText:</td><td><?php echo $editor->display( 'maintext', '' , '100%', '350', '75', '20', false ) ; ?></td>

</tr>

<tr>

<td>published:</td><td>

<select name="published">

<option value="0">No</option>

<option value="1">Yes</option>

</select>

</td>

</tr>

<tr>

<td>Category:</td><td>

<select name="cid">

<?php

$database->setQuery( "SELECT * FROM #_chronoforms_RSVP-mens-life-group" );

$categories = $database->loadObjectList();

foreach($categories as $category){

?>

<option value="<?php echo $category->id; ?>"><?php echo $category->title; ?></option>

<?php } ?>

</select>

</td>

</tr>

</table>

<input type="hidden" name="id" value="">


The other problem I'm running into is that I cannot view/change the category from the option drop down within this template.. it's an empty drop down. The 'Published' drop down displays.. though it does nothing to change the published/unpublished status of the article.

So, to wrap it up, can any help me to:

1) Only show articles from sectionid '5' within the Data View screen
2) Show the category within the Edit Record View and allow me to change the category
3) Correct the Published drop down to make it functional.

Any help is greatly appreciated !!

Thank you!
admin 29
October 10 2008, 08:42 #14932
Hi revive,

#1- at the WHERE statement you will need to put
WHERE sectionid='5'

#2- here is an example of a category dropdown :
<select name="catid">
<option value="1">cat 1 </option>
<option value="2">cat 2 </option>
</select>

#3- I see your published dropdown code should work fine! :?

Cheers,

Max
Max
If your main question got answered then please mark the answer using the button!
Did you try the new ChronoForms7 ? if yes then please send us your comments!!
R
revive 111
October 10 2008, 11:13 #14938
Hey Max,

Thank you for the feedback.. the WHERE clause worked great... !

The Category drop down gives me a drop down box,.. but it isn't populated with the Joomla! Categories.. just the code you included.. How do I include a drop down box for showing the category the article is in, as well as being able to change it?

Basically, I'm aiming for the same functionality as the category drop down in Article Manager pages...

Here is what I am trying to achieve,..
To show all articles from one section... showing these column headings:
checkbox Title Published (toggle) Category Created Date Hits

And then in the Record Edit Template view, have these fields available to change data within the DB:
Title
Menu Alias
Category
Intro Text
Main Text
Published/Enable (toggle)
Created Date
Start Publ. Date
A few items from the Parameters (Advanced) menu from the Article Manager page in Joomla! core


I know this is no simple task, especially for a newbie!! So, any help you can give I'll really appreciate! As well as continuing to promote the heck out of your extensions to say the least!!!!


Also, how do I show / hide specific fields in the Show Data screen?? I can change the column headings, but thats all.. When I click Show Data now, it shows me ALL of the articles, not just the ones from section 5 as the WHERE clause filters for the front-end only... How do I apply the same 'filtering' or control over the Show Data screen fields??


Thanks again Max!

I submitted reviews on Joomla.org for the three extensions of yours I have used.. They're great as is your suppport!
admin 29
October 10 2008, 11:24 #14944
Hi revive,

Thank you! it will not be possible to limit the show data at the admin, its designed to list all the table data!

to show a list of categories, we ca mix my code with a piece of yours wit ha little modifications:

<select name="catid">
<?php
$database->setQuery( "SELECT * FROM #_categories" );
$categories = $database->loadObjectList();
foreach($categories as $category){
?>
<option value="<?php echo $category->id; ?>"><?php echo $category->title; ?></option>
<?php } ?>
</select>


Regards,

Max
Max
If your main question got answered then please mark the answer using the button!
Did you try the new ChronoForms7 ? if yes then please send us your comments!!
R
revive 111
October 10 2008, 12:26 #14949
Hey Max,

Hey no worries on the filter for the Show Data view..

I tried the code you included and its just showing a blank dropdown.. I'm using jos_content for the data if that makes a difference.. Any ideas???

Also, is there a way, within ChronoConnectivity, to CREATE a new page within CC that uses the Record Edit Template??? I'm trying to created a simple template with only the needed info for other admins to use that are not Joomla! or web savvy... so they get what they need, and can't goof it up LOL
Is that possible???
admin 29
October 10 2008, 16:28 #14963
Hi revive,

there was a typo : #_categories >> #__categories

#2- I'm working on this feature for the next release!

Cheers

Max
Max
If your main question got answered then please mark the answer using the button!
Did you try the new ChronoForms7 ? if yes then please send us your comments!!
R
revive 111
October 11 2008, 03:59 #15006
Hey Max,

Excellent, that worked great! Thanks for catching the typo!!
What do I need to add to that script to filter out the categories from other sections? It shows ALL the categories.. instead of just the cats from the section the article is from..

re: #2) Even better! Being able to create not just manage within CC will be amazing! When are you expecting to complete the next version??

Question for you on the 'published' and 'un-published' toggle.. I have the drop down on my form from your tutorial, but it's just a static field with yes or no.. how do I make that so it's actively taking the article in/out of publishing??

Thanks again!!

Also, do you have any resources you might recommend for me to learn more PHP? I've very interested in improving in this area...

thanks again

Jesse
admin 29
October 12 2008, 07:44 #15024
Hi Jesse,

#1- I think adding
WHERE sectionid = '5' 
to the SQL from the dropdown will limit it to section 5 categories only.

#2- no time is set for the next Connectivity version, its 70% complete though.

You can make the published dropdown just as we made the categories dropdown ?

PHP resources are lots over the internet, you can find too many books for it too, practicing it and looking into Joomla code will make you much better!

Cheers,

Max
Max
If your main question got answered then please mark the answer using the button!
Did you try the new ChronoForms7 ? if yes then please send us your comments!!
S
snow crash 16
October 28 2008, 11:57 #16117
hi max
the code u posted works fine.

my question is how could i select articles from only 1 category?
and on submit the selected article gets sent to an email adress
admin 29
October 28 2008, 14:49 #16131
Hi,

for one category use :

WHERE catid = '5'

5 is just for example.

you will need to change the email template to include the article data or link, you need to get the article contents first, I don't know how you are going to do this.

Max
Max
If your main question got answered then please mark the answer using the button!
Did you try the new ChronoForms7 ? if yes then please send us your comments!!
S
snow crash 16
October 28 2008, 15:24 #16134
that is my problem.
that i don`t know where to start or how i get the fulltext send of a single article selected before.

maybe i could load the selected article into a hidden textarea. is this possible and when how?

i`m working with chronoform not with chronoconnectivity