[Chameleon] widget within a widget

Jacob Delfos jacob.delfos at maunsell.com
Thu Feb 10 22:27:37 EST 2005


Jennifer,

If you are using shapefiles, you should be able to put the links in the attributes.
The attribute would be a string, of the form:

<A HREF='fileToLinkTo.mpg' TARGET=#>Click to view movie</A>

If you are using excel, you can use the concatenate function to have a fixed beginning of the string, vary the link and the name, and have a fixed ending. Concatenate them, and place it in one cell, then save to DBF. That is the easiest way to automate it.

This should work, because we did it ourselves too.

regards,

Jacob




-----Original Message-----
From: chameleon-bounces at lists.maptools.org
To: chameleon at lists.maptools.org
Sent: 2/11/2005 11:18 AM
Subject: [Chameleon] widget within a widget

Hello-

Thank you, Paul, for the tips.  I'll try to better explain what it is
I want to do.

I would like to be able to offer a link to another website from within
the pop-up query window.  (E.g. A user would select the query tool,
click on a point, which has standard attributes displayed in the query
window but is also associated with an online movie or an online
database.)  But I would like the link to appear associated with the
query result or layer to which it applies (perhaps in an additional
result cell or in the same bar as the layer title).  Ideally, clicking
on this link in the query window will open the specified URL in
another browser window.

Since widgets can't really be embedded within one another, I am
guessing the Query widget will need to be further modified.  A
colleague of mine and I modified it already to show a photo in the
bottom of the query window, the title of which is specified in the dbf
file for the layer.  My first thought was to somehow build on this
functionality (using the dbf to hold the URLs), but it appears to be a
much more complicated task.

Several colleagues are helping me to figure this one out and we would
really appreciate any direction you could offer.  Thank you much!

Jennifer Zeisloft


On Thu, 10 Feb 2005 20:20:49 -0500, Paul Spencer
<pspencer at dmsolutions.ca> wrote:
> Jennifer ... sorry for the delay in responding ...
>
> Jennifer Zeisloft wrote:
> > Hello All-
> >
> > I am attempting to place a widget within a widget, but am uncertain
> > how to do this or whether this is even possible.
>
> technically it is not.  From reading ahead, I think you are attempting
> to return the tag for a widget from another widget.  At the time that
> this code is run, all widgets have been parsed and no more will be
> created.  You'll end up with the text of the widget tag in your
> application, but it won't be visible (except for broken images for the
> <image ...> tags because the browser will suppress the output thinking
> they are invalid HTML tags.
>
> >
> > Specifically, I am trying to place the Link widget within the Query
> > widget.  Ideally, I would like to place a link button on the title
bar
> > of each layer appearing in the query window that is hotlinked to
> > another resource.  I attempted to call the widget from within a
second
> > <td> tag for the formatting of the layer title row:
> >
> > $szReturnValue .= "<td colspan=\"2\" class=\"titleArea\"><p
> > class=\"text\"><u><b>$szTitle</b></u></p></td>\n";
> >
> > $szReturnValue .= "<td><cwc2 type="Link" visible="true"
imagetip="Link
> > to additional resources" URL="http://www.google.com"
PopupWidth="500"
> > PopupHeight="600" image="icons/icon_link.png" toolset="Navigation"
> > styleresource="NavButtons" popupstyleresource="TextButtons">
> >              <image state="normal"/>
> >              <image state="hover"/>
> >              <image state="selected"/>
> > </cwc2></td>\n";
> >
> > $szReturnValue .= "</tr>\n";
> >
> > But received an error:
> >
> > Parse error: parse error, unexpected T_STRING in
> > C:\ms4w\apps\chameleon\htdocs\widgets\Query\QueryResults.phtml on
line
> > 401
> >
>
> even though this won't work, the error is because of your use of
quotes.
>  You have double quotes (") around your string, and also double quotes
> within your string.  To get around this, you can also use single
quotes.
>
> $szReturnValue .= "<td colspan=\"2\" class=\"titleArea\"><p
>  class=\"text\"><u><b>$szTitle</b></u></p></td>\n";
>
>  $szReturnValue .= '<td><cwc2 type="Link" visible="true"
imagetip="Link
>  to additional resources" URL="http://www.google.com" PopupWidth="500"
>  PopupHeight="600" image="icons/icon_link.png" toolset="Navigation"
>  styleresource="NavButtons" popupstyleresource="TextButtons">
>               <image state="normal"/>
>               <image state="hover"/>
>               <image state="selected"/>
>  </cwc2></td>'."\n";
>
> note that I concatenated the \n in double quotes.  PHP treats
> single-quoted strings literally and won't honour your \n as a carriage
> return - nor would it replace $variables ...
>
>
> > I have to admit (if it isn't already painfully obvious) that I have
> > very minimal computer programming / php experience.  While I am
fairly
> > certain I can write the function to utilize URLs from a dbf file and
> > the code to make the widget appear only when appropriate, I am lost
as
> > to where or how to place the code (and am I missing some other code
> > that would be required to do this??) to call the Link widget in the
> > first place.
> >
> > I am extremely grateful for any advice you can offer.  Thank you in
> > advance for your help!
>
> um I'm not entirely certain what you are trying to accomplish.  Could
> you explain it in functional terms and perhaps I can point you in the
> right direction.
>
> >
> > Jennifer Zeisloft
> > _______________________________________________
> > Chameleon mailing list
> > Chameleon at lists.maptools.org
> > http://lists.maptools.org/mailman/listinfo/chameleon
> >
>
> Cheers
>
> Paul
> --
> +-----------------------------------------------------------------+
> |Paul Spencer                           pspencer at dmsolutions.ca   |
> +-----------------------------------------------------------------+
> |Applications & Software Development                              |
> |DM Solutions Group Inc                 http://www.dmsolutions.ca/|
> +-----------------------------------------------------------------+
>
_______________________________________________
Chameleon mailing list
Chameleon at lists.maptools.org
http://lists.maptools.org/mailman/listinfo/chameleon



JACOB DELFOS
SPATIAL INFORMATION ANALYST
Maunsell Australia Pty Ltd
629 Newcastle Street, WA 6007
PO Box 81, WA 6902
Leederville 
Western Australia
ABN 20 093 846 925

Tel     + 61 8 9281 6185
Fax    + 61 8 9281 6297
jacob.delfos at maunsell.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/chameleon/attachments/20050211/e74edcea/attachment.html


More information about the Chameleon mailing list