Forums

[Request] Show single record

Stroganoff 28 Jul, 2009
Hi,

the one main thing that's missing from ChronoConnectivity at this is a way to view a single record in a admin-defined template. I want users to be able to click on the item in one or more collumns and get to the single view page for this record.

If we could insert something like <a href="{singleview}">{name}</a> into the body template and then define an extra template for the single view (optionally showing more fields from the record like an image or additional descriptions) the same way we did for the overview.

Would be great if we could select a field from the database to be used for the SEF URL, i.e.
http://www.example.com/mydatabase/foobar

whereas "foobar" is the value in the "name" field for the selected record. On the other hand, one must be able to store duplicate names in more than one records, so maybe you should put the id in front of it:

http://www.example.com/mydatabase/5-foobar

Now I'm thinking way ahead: being able to define alternate templates for selected records (i.e. selected "id"'s).

This should be implemented in the Connection Manager.

What do you think about this? Or am I missing something and it's already possible without creating a special Connection for each record?


Kind regards,
Stroganoff
nml375 28 Jul, 2009
Hi Stroganoff,
I did something like that a long time ago using ChronoForms and the Profile plugin.
I pretty much created a copy of the submit form (without any submit functions), and enabled the Profile plugin. This was then used to enter the actual data from the table post. All I then had to do, was add a link to the CF form that included the post id to be shown (http://www.myhost.tld/myform.html?cf_id=<? echo $row->cf_id; ?>) to each row in the listing. I believe you'll have to replace $row with $MyRow in recent CC though.

/Fredrik
Stroganoff 29 Jul, 2009

I did something like that a long time ago using ChronoForms and the Profile plugin.



Well that sound quite interesting, I'll give it a try to see if it makes a proper implementation unnecessary. Could you please tell me what "Profile plugin" you're talking about?
GreyHead 29 Jul, 2009
Hi Stroganoff,

In the left hand column of the Forms Manager under 'Plugins' - now called 'Profile Page'. Select the checkbox by any form, click the plugin link and look at the Help tab for more info.

Bob
Stroganoff 30 Jul, 2009
OK thank you very much, it's working great so far. The Profile plugin seems to be just what I needed.

The only thing left that's bothering me right now is that I don't have control over which main menu button is the "current" (i.e. active) one when viewing the single record page. For SEF purposes I created a hidden menu item (only visible for admins, but accessible for everyone, but it's useless without additional "?id=123") linking to the pseudo form, but I'd rather like the ChronoConnecivity menu item (in my case "Overview") to be highlighted when viewing the single record. But I guess it's not possible without implementing this feature directly in ChronoConnectivity.
Stroganoff 30 Jul, 2009
OK another question: I want each record to have a "published" field, so I can unpublish certain records. I already implemented this in the overview, but I'm having trouble with the "view single record" form and Profile plugin.

Basically I want it like this:

<?php if($published == "yes"): ?>
<the whole form code />
<?php else ?>
This item has been unpublished.
<?php endif; ?>


I can't use "{published}" in PHP of course. Could anyone tell me the best way to do this?
GreyHead 30 Jul, 2009
Hi Strognaoff,

I'm no sure where you are doing this - in the ChronoConenctivity boxes you can use $MyRow->published.

I'd have to go a look to see what the equivalent is if you are working with a ChronoForms form.

Bob
nml375 30 Jul, 2009
Hi Stroganoff,
Wouldn't the 'published' flag be stored in the actual data record (in the field name "published")? If so, the "{published}" approach should work as long as you disable evaluation within the Profile page plugin. Otherwise, you could try reading $row->published, but I'm not sure it's still in an available scope when the form code gets processed..

/Fredrik
Stroganoff 30 Jul, 2009
Wow thank you again, it's working just like that (with Evaluation disabled, as you said).

<?php if("{published}" == "yes"): ?>


Awesome!
This topic is locked and no more replies can be posted.