lneisius
|
| Posted: 04/08/2003, 5:11 AM |
|
Reported to YES that the Set Tag Action is not working with includeable pages, been about two weeks with out any response. Does any one know a work around? I have a number of includeable pages that require the set tag, and no knowledge of how the templates actually work.
|
|
|
 |
RonB
|
| Posted: 04/09/2003, 7:02 AM |
|
The problem I ran in to is that includable pages have problems with the dbconnection if there isn't a grid that makes a connection. So make sure the event code generates a new instance of the connection class:
$db= new clsDBConnection1;
now you can use the $db to conduct query's on the database adn set values for the tags.
Ron
|
|
|
 |
lneisius
|
| Posted: 04/09/2003, 7:46 AM |
|
Not having any problems with dbase connections. The set tag action is used to replace html content with dynamic content. In my case its a session thats replacing the content so the session is there but the set tag creates errors.
|
|
|
 |
gmoore
|
| Posted: 04/09/2003, 7:52 AM |
|
I am using ASP and MS Access. I have a details page with several forms that retrieves the page parameters from the master page. On the record form of the details page, I have also used the dependent listbox example to go back to the database and query results for a second listbox. However, when the page reloads, the page parameters disappear and the ID for the master page is no longer referenced. My question is, how do I maintain the parameters for the page, even when the page reloads form a dependent listbox query? I have tried passing variables, but nothing seems to work.
Thanks!
|
|
|
 |
lneisius
|
| Posted: 04/09/2003, 1:52 PM |
|
Did you even read this thread before posting your question about something completely diff. Come on people ask your question in a single thread not everyone wants to read your question in every thread!!!!!
|
|
|
 |
RonB
|
| Posted: 04/10/2003, 2:47 AM |
|
Oke, here's how I got it working. First via form properties insert a label. Do not give it any content. You just use it as a container for a before show event. in before show choose the action "set tag" give it a value and it will now show up. I adapted the generated set tag code so it looks like:
global $Tpl;
global $DBConnection1;
$db=new clsDBConnection1;
$myvar=CCGetDBValue("select naam from medewerkers where id1 =150",$db);
$Tpl->SetVar("test", $myvar);
Works like a charm
|
|
|
 |
lneisius
|
| Posted: 04/10/2003, 4:37 AM |
|
I think your assuming I have a form in this page when all I have are a few labels. Second I am trying to replace a tag in the html that is not dbase or form related but is part of the theme structure in the html. Third when I tested with php I had no problems getting the set tag to work, guess I should have stated that I am using ASP and Access. Actualy when I tested in PHP the set tag action of the main page which calls the include files did the replacement of the tag in the includeable pages html. Any other ideas?
|
|
|
 |
RonB
|
| Posted: 04/10/2003, 6:33 AM |
|
Hi, I'm not sure I understand what the problem is. If you use the tag to change a color in the scheme just add the {tagname} in the value bit. Could you post the piece of html in wich you want to add the tag? I seem to be having trouble to visualize what the problem is. I know CCS has the unfortunate behaviour to replace edited values in the style tag. You can set color:"{tag name}" but after editing another piece of html on the page it gets replaced by the original color code.
I even tried editing the theme. In html mode it reacts to the tag, in CSS it doesn't. So if I set the style for the table or page to html, choose a theme and edit that theme via Tools->Theme and, let's say edit the bgcolor part of the theme, replacing the color code with {tag name}. The page will react to the solor code passed by the value of the tag set in the before show event.
Ron
|
|
|
 |
lneisius
|
| Posted: 04/10/2003, 11:19 AM |
|
Ron:
Give me your email and I will send you an example.
|
|
|
 |
RonB
|
| Posted: 04/10/2003, 12:48 PM |
|
r.borkent@chello.nl
Hope my spam filter isn't going to choke 
Ron
|
|
|
 |
lneisius
|
| Posted: 04/11/2003, 4:56 AM |
|
Hope you got the project ok. After some more testing and reading I see that the set tag works fine if there are forms, records, etc. on the includeable page. My problem is that some of my includeable pages have nothing more than a couple of labels, no database connection, forms, or records. Any ideas?
|
|
|
 |
RonB
|
| Posted: 04/11/2003, 5:51 AM |
|
Hi,
Well had to do a lot of cleaning up because some asp didn't get translated to php but i've got it working. I added a beforeshow event to the page, named the tag ron and set the value to "this is a test". On the index page, in design view, I added {ron} at the bottom of the page.
If I now load the index.php page the {ron} bit is replaced by "this is a test".
If I try and display the {ron} bit on the includable page itself(ThemeSelect.php) it also works but the dropdownlist no longer changes the theme.
Maybe it works like this:
On includable pages you can use the set tag action but the value can not be displayed on the includable page itself without messing up the code.
The thing I didn't get is why you need the set tag function on the includable page? What variable are you trying to set?
Ron
ps. I tried to mail you the project with my changes but your provider somehow decided the .chello domain is a spam source so it got bounced. I'll try again from another account.
|
|
|
 |
lneisius
|
| Posted: 04/11/2003, 9:25 AM |
|
Got your email and will give it a look shortly. I think I found the problem!!!!
It seems that what I am trying to achieve works fine with an includeable page but if I include another page in the includeable the errors are created. It would seem that CCS doesn't like includeables in includeables. Any Ideas? I like using includeables in includeables to allow for more options within display and coding.
|
|
|
 |
RonB
|
| Posted: 04/11/2003, 4:27 PM |
|
Well, I dont think there's a way around the problem. That's probably why using events on an includable page works so shakey. The event page is in itself an includable page. The thing i dont get is why the set tag works if the info that is set by the tag is retrieved by another page and not he includable page itself. It must have something to do with the order in wich the pages are loaded.
Ron
|
|
|
 |