Forums

Link result [Newbie]

peters901 22 Dec, 2008
Hello,

I rather new to ChronoConnectivity (and php/mysql) and still testing. I want to following:

A page that's contains the ID and Name entries from the database, when you click on the ID it has to show a page with the full content of the database record (besides the ID and the Name also the emailaddress and phonenumber). I can't get this to work, i'm able to create the first page which lists al the ID's and Name entries from the table but i don't know how the link should look andn where i have to put the template for showing all the information of the record. I already followed the turtorial but i'm missing something. I don't want the results to be edited just shown.

I hope it makes sense and that somebody can help me (maybe with an example).

Regards,

Jaap
GreyHead 22 Dec, 2008
Hi Jaap,

Here's an example for you - this is the code that runs the FAQs on the site here. They show up in a smoothbox but you can adapt the code to suit your needs. This is in the Body box of the ChronoConnectivity setup
<p class="blocknumber">
<span class="bignumber"><?php echo sprintf('%02s', (1 + $counter)); ?></span><a class="smoothbox" name="{name}" href="#TB_inline?height=500&width=650&inlineId=cccontent_{id}_box" id="cccontent_{id}">{name}</a></p>
<div id="cccontent_{id}_box" style="display: none;">{introtext}<hr>{maintext}</div>
<div id="cccontent_{id}_tip" style="display: none;">{name} :: </div>
You can see that the column_names in {} will be replaced by the values from the database record. Here the display content is set by the entry {introtext}<hr>{maintext}

Bob
peters901 22 Dec, 2008
Hello Bob,

Thanks for the reply. I got it working with the smoothbox in firebox. Maybe it's a dumb question,but what should the link be when i want the result openend in the smoothbox te be opened instead the current page (like the backend show data and then the page)? I can't get it working. Perhaps you can give me one more tip.

Thanks in advance.

Jaap

UPDATE: I have found a 'workaround' when i make two connectivity entries but i'm curious if it will work with only one.
Max_admin 22 Dec, 2008
Hi peters, 2 different views then you need 2 connections!🙂

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
peters901 24 Dec, 2008
Hi Max,

Thanks for the reply. I'm only using one view but i can live with making two entries in ChronoConnectivity and will continu testing. So far is looks great.

Regards,

Jaap
Max_admin 24 Dec, 2008
Hi, you have a page to list the records and another one to view the details of a single one ? then 2 views!🙂
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
peters901 24 Dec, 2008
Max,

You are right, 2 views and 1 table.

Regards,

Jaap
tidusx18 08 Apr, 2009
Hi,

I read through this thread and try using the code that's listed, but I can't seem to figure out how the "right" way of doing this would be. Can you give me a quick run through on how I would set this up? Also, the menu items from my site are clickable when the smoothbox comes up which really get in the way. Is there a fix for this?

Thanks and sorry for all my questions...I've posted a few😛

Daniel
tidusx18 10 Apr, 2009
Hi again,

Ok, I was able to figure out what went where, but now I have 2 small problems...

1) I'm kinda confused about this "Here the display content is set by the entry {introtext}<hr>{maintext}". Do I just put the field names like {First_name}, {Last_name}, etc that I want to show up in the details view? And I tried using things like <tr> and <td>, but it seems to mess up the code so how can I change the display of the details view?

2) When I open a record in details view, all of the buttons from the main menu of the website leak through...is this a bug or something and do you know of any fix?

Edit: I also just noticed that aside from the menus bleeding through the details view smoothbox, there is no formatting...like the <hr> is ignored...I switched templates and everything was fine so I guess I need to contant the template designers...although if you have a fix, feel free to share...

Thanks.

Daniel
tidusx18 15 Apr, 2009
Hi,

I was wondering if someone could help me with these 2 problems using the smooth box solution mentioned above....

1) I'm kinda confused about this "Here the display content is set by the entry {introtext}<hr>{maintext}". Do I just put the field names like {First_name}, {Last_name}, etc that I want to show up in the details view? And I tried using things like <tr> and <td>, but it seems to mess up the code so how can I change the display of the details view?

2) When I open a record in details view, all of the buttons from the main menu of the website leak through...is this a bug or something and do you know of any fix?

I also just noticed that aside from the menus bleeding through the details view smoothbox, there is no formatting...like the <hr> is ignored...I switched templates and everything was fine so I guess I need to contant the template designers...although if you have a fix, feel free to share...

I really appreciate all the help found on these forums! :mrgreen:
purple knight 28 Apr, 2009
REVISION: SOrry guys. I made a very silly mistake (of accidental deleting) of the code while trying to fix the incorrect content within the smoothbox. Now my smoothbox reappeared. Anyway, same problem with the smoothbox remains as a mystery. I'm turning green :mrgreen: ... without the cure for the mystery


Oops, I was trying to troubleshoot the smoothbox - incorrect content, when I messed up the code that works well previously. 😟

Help, anyone? My smoothbox is wrongly aligned... sob sob
Header
<div style="float:center">

<input type="submit" value="Search" name="undefined" style='width:80px; color:#cccccc; background-color:#660099; cursor:pointer;' /></div>

<br/>
For more details
<br/>
<br />
{new_record}<br />
<table style="text-align: left; width: 120%;" border="0" cellpadding="1" cellspacing="0">
  <tbody>
    <tr>
      <td style="font-weight: bold; width: 15%;">A</td>
      <td style="font-weight: bold; width: 20%;">B</td>
      <td style="font-weight: bold; width: 20%;">C</td>
      <td style="font-weight: bold; width: 15%;">D</td>
      <td style="font-weight: bold; width: 30%;">E</td>
    </tr>
  </tbody>
</table>
<div class="clr" style="border-bottom: 1px solid #222; padding: 1px; margin-bottom: 10px;"></div>


Header
<p class="blocknumber">
<a class="smoothbox" name="#{cf_id}" href="#TB_inline?height=500=650&inlineId=cccontent_{id}_box" 
id="cccontent_{id}">Ref. no.{cf_id}</a>

<div id="cccontent_{id}_tip" style="display: none;">More info::</div>
<div id="cccontent_{id}_box" style="display: none;">

<b><font color=#660099>ABOUT THE QUESTION</font></b><hr>
</div>  

<table style="text-align: left; width: 100%;" border="0" cellpadding="2" cellspacing="0">
  <tbody>
    <tr<?php if ($i % 2) echo ' style="background-color: #EBEBEB;"';?>>
      <td style="width: 18%;">{select_2}</td>
      <td style="width: 30%;">{text_3}</td>
      <td style="width: 15%;">{text_14}</td>
      <td style="width: 20%;">{select_5}</td>
</td>
    </tr>
  </tbody>
</table>
<?php $i++ ?>
tidusx18 28 Apr, 2009
Hi, Purple Knight

Could you re-state your problem? I don't quite understand what it is that's wrong with the smoothbox.

Thanks,

Daniel-
purple knight 29 Apr, 2009
Hi =)

The background is like this. I have a auto-generated summary listing of all entries made by guest users. On each entry, there is a link where they can click for more info. So a smoothbox will appear. All these are correct till this stage.

Let say in the summary listing, I have A, B, C, D & more. However, regardless which I click, a smoothbox pops out with the content of A only. I saw somewhere in this forum that there is a similar problem. But looks like no answer so far.

This is the mysterious bug thread viewtopic.php?f=12&t=13932

1.) When displaying the data inside of the smoothbox pop-up, it's displaying the wrong data??? instead of pulling the data from the table for each item. For instance, the document name is correct in the header of the pop-up, it pulls that for each item, but the other data associated with that item is wrong.

tidusx18 29 Apr, 2009
Okay, now I understand.

Try this...Replace the code below for what you currently have in the body box.
<p class="blocknumber">
<a class="smoothbox" name="#{cf_id}" href="#TB_inline?height=500=650&inlineId=cccontent_{cf_id}_box"
id="cccontent_{cf_id}">Ref. no.{cf_id}</a>

<div id="cccontent_{cf_id}_tip" style="display: none;">More info::</div>
<div id="cccontent_{cf_id}_box" style="display: none;">

<b><font color=#660099>ABOUT THE QUESTION</font></b><hr>
</div> 

<table style="text-align: left; width: 100%;" border="0" cellpadding="2" cellspacing="0">
  <tbody>
    <tr<?php if ($i % 2) echo ' style="background-color: #EBEBEB;"';?>>
      <td style="width: 18%;">{select_2}</td>
      <td style="width: 30%;">{text_3}</td>
      <td style="width: 15%;">{text_14}</td>
      <td style="width: 20%;">{select_5}</td>
</td>
    </tr>
  </tbody>
</table>
<?php $i++ ?>


Let me know if that works. :wink:

Daniel-
purple knight 29 Apr, 2009
Hallo Daniel,

So I see the suggested code is this difference of cf_id vs id.
<div id="cccontent_{cf_id}_tip" style="display: none;">More info::</div>
<div id="cccontent_{cf_id}_box" style="display: none;">
Tried but not working yet. When I put cf_id, the entire smoothbox doesn't appear.

Thanks for your help.
tidusx18 29 Apr, 2009
Did you also change the {id} in here...
<a class="smoothbox" name="#{cf_id}" href="#TB_inline?height=500=650&inlineId=cccontent_{id}_box"
id="cccontent_{id}">Ref. no.{cf_id}</a>

to {cf_id}?

Please attached a backup of your form or email it to me at "dvictoriano at bellsouth dot net" if you're still having problems. (the weird way I typed the email is a spam protection thing lol😛)

Edit: I also just noticed that you're missing a closing </p> tag at the end of this line of code...
<p class="blocknumber">
<a class="smoothbox" name="#{cf_id}" href="#TB_inline?height=500=650&inlineId=cccontent_{id}_box"
id="cccontent_{id}">Ref. no.{cf_id}</a>


Daniel-
purple knight 30 Apr, 2009
Wow! I am totally thrilled! Finally, it works so well. 😀

I tried changing all the "cccontent_{id}" to "cccontent_{cf_id}". And it works!


May I ask one more question? What is this </p> code to control which thing? Cos I trying putting in & deleting it, can't see the difference. =)

Edit: I also just noticed that you're missing a closing </p> tag at the end of this line of code...

<p class="blocknumber">
<a class="smoothbox" name="#{cf_id}" href="#TB_inline?height=500=650&inlineId=cccontent_{id}_box"
id="cccontent_{id}">Ref. no.{cf_id}</a>

tidusx18 30 Apr, 2009
Hi again,

Glad to hear that it worked for you. The <p> tag is used to define paragraphs. :wink: You wouldn't really notice a different in its use here.

Daniel-
medaacek 19 Feb, 2010
Hi, Im a newbie and still does not understand many things but one simple answer would certainly help me a lot - how do i call the content of a database field useing the following string in the code:?


#TB_inline?height=500=650&inlineId=cccontent_{id}_box



I can now load the Thickbox but I still do not know ho to show any content inside that thickbox - how can the database field value be linked to the frontpage? Thanks a lot, Im struggling with this probably very stupid issue many hours now...
GreyHead 19 Feb, 2010
Hi medaacek,

I posted an example using smoothbox a couple of days ago. I think that is what you need.

Bob
medaacek 20 Feb, 2010
Dear Bob, I spent another 4 hours with no advance and am getting really desperate and will probably give up soon. What hurts me more that I do not do any commercial website but a web for birders who could upload their records and pictures, non-profit stuff...

I got to the point where I have a table, registered users can upload the data (say 5 fields) and the data are shown in front end (only 4 fields). In each line, I would like to add a "more information..." link that wuld open up in a thickbox and where the text from field 5 would appear, this must not be difficult!

I tried everything, trying different codes you posted in the forum, making two connections from one database but either I got a blank thickbox with no text (only name in the heading appears) or I get a thickbox that just replicates the whole website including menus etc. How do I make, when the database field 5 contains a sentence "I am a lame", the Thickbox will also contain "I am a lame"?

I searched all your posts but have not found anything that would help me.

neither of these two solved my problem:
http://www.chronoengine.com/forums.html?cont=posts&f=12&t=16314
http://www.chronoengine.com/forums.html?cont=posts&f=12&t=12019


I would be very grateful if you could give me the right direction, refer me to the right thread if this has been discussed before...

It is terrible because I know that the solution might be just a few lines of codes but for me it might as well mean several weeks of try and miss...
This topic is locked and no more replies can be posted.