Echo href html line in ChronoConnectivity

jason16c 26 Jan, 2009
Hi Max,

I'm trying to create a link in the record edit form that takes the user to the url stored in the table. The code I've been trying seems to work in the table header and body sections but, in the 'record edit' code it's causing problems.

The $jsvURL variable is populated in the same 'record edit' page using the command:
$jsvURL = $row->jsvURL;
then, after the html table definition, I've got:
<td style="width:50%;"><?php echo "<a href='$jsvURL'>View Job Ad</a>"; ?></td>

The problem is that, no matter what I try, it doesn't create the URL for me. Using the code above I get the following in the page source code:
<td style="width: 50%;">View Job Ad"; ?></td>
which doesn't work. I've also tried:
<a href='http://<?php echo $jobserveURL;?>'>View Job Ad</a>
but that gives me

http://</php echo $jobserveURL;?>

in the URL.

If I don't include the "http://" in the href statement, it automatically prepends "http://<ip_address>/Joomla/", which isn't what I want it to do.

I've trawled through the forum to find an answer to this but,.. well.. it hasn't been too successful. I'm hoping you might be able to help me.

Thanks,
Jason
Max_admin 27 Jan, 2009
Hi Jason,

your code should look like this:

    <td style="width:50%;"><?php echo "<a href='<?php echo $jsvURL; ?>'>View Job Ad</a>"; ?></td>


Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
jason16c 28 Jan, 2009
thanks Max.

All I get for output is:
'>View Job Ad"; ?>
jason16c 28 Jan, 2009
Incidentally, I tried your code in the body loop code and it works beautifully. Unfortunately, it didn't work in the form editing code under the 'front permissions' tab.
Max_admin 28 Jan, 2009
what do you get in the form editing page then ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
jason16c 28 Jan, 2009
So, I get the right output when I include that code in the body loop but when I use the exact same code in the form editing page all I get is the following in the page source:

<td style="width: 50%;">View Job Ad"; ?></td>


The rest of the code (the sql query etc) is the same in both cases but the editing page doesn't seem to like it.
Max_admin 30 Jan, 2009
Hi Jason, sorry but I think I missed something, PHP tags inside elements in the edit code may cause troubles and we have been talking about it here : http://www.chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&f=13&t=11630&start=0&st=0&sk=t&sd=a

no fixes yet unless you do it carefully, try to put the whole HTML line of code (the a element) inside a PHP echo statement and use the PHP value in there ?

Cheers
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
jason16c 31 Jan, 2009
I tried including the whole 'a' statement inside php and that didn't seem to want to work either.

as far as I can tell, the current workaround is to run the php inside a java script. i'll see what i can do to get that going.

do you know what's causing the problem? which of the chronocon php files would be responsible for this part of the code? is it the one that kicks back the error?

thanks for finding that other thread for me though - I tried searching but never found anything that helped.

have a good weekend.

Jason.
Max_admin 01 Feb, 2009
Hi Jason,

the error happens because the ChronoConnectivity tries to convert the "edit template" code to some code which can be loaded with the record values, I did this through some JS routine with mootools but this approach has its own problems, if there is pure HTML code then that's fine but when you add PHP then this confuses the mootools JS code!

the routine is under admin.chronoconnectivity.html.php

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
jason16c 02 Feb, 2009
thanks for letting me know Max.
This topic is locked and no more replies can be posted.