Lasso tag for showing which file includes an include?

classic Classic list List threaded Threaded
19 messages Options
Reply | Threaded
Open this post in threaded view
|

Lasso tag for showing which file includes an include?

stevepiercy
Is there a Lasso tag that can be placed in an included file that reveals the file that does the including?

In other words, in slurp.lasso:

    [include: 'included_file.lasso']

and in included_file.lasso:

    [the_file_that_included_me]

=> slurp.lasso

?

I know I could set a page var in slurp.lasso to equal the filename, then in included_file.lasso test for the existence of the var and display its value if it exists, but it isn't as sexy.

--steve
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy               Web Site Builder               Soquel, CA
<[hidden email]>                   <http://www.StevePiercy.com>

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Lasso tag for showing which file includes an include?

Mark Palmer
Take a look at Include_CurrentPath -  it's a Lasso 8.5 tag.


On 27 Aug 2006, at 20:15, Steve Piercy - Web Site Builder wrote:

> Is there a Lasso tag that can be placed in an included file that  
> reveals the file that does the including?
>
> In other words, in slurp.lasso:
>
>     [include: 'included_file.lasso']
>
> and in included_file.lasso:
>
>     [the_file_that_included_me]
>
> => slurp.lasso
>
> ?
>
> I know I could set a page var in slurp.lasso to equal the filename,  
> then in included_file.lasso test for the existence of the var and  
> display its value if it exists, but it isn't as sexy.
>
> --steve
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> Steve Piercy               Web Site Builder               Soquel, CA
> <[hidden email]>                   <http://www.StevePiercy.com>
>
> ------------------------------
> Lasso Support: http://support.omnipilot.com/
> Search the list archives: http://www.listsearch.com/lassotalk.lasso
> Manage your list subscription:
> http://www.listsearch.com/lassotalk.lasso?manage



Regards

Mark Palmer
E: [hidden email]
T: 01902 620500
W: www.pageworks.co.uk





------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Lasso tag for showing which file includes an include?

stevepiercy
Thanks!  It looks like it's time to get that upgrade from 8.1 if I want sexy code.

--steve



On Sunday, August 27, 2006, [hidden email] (Mark Palmer) pronounced:

>Take a look at Include_CurrentPath -  it's a Lasso 8.5 tag.
>
>
>On 27 Aug 2006, at 20:15, Steve Piercy - Web Site Builder wrote:
>
>> Is there a Lasso tag that can be placed in an included file that  
>> reveals the file that does the including?
>>
>> In other words, in slurp.lasso:
>>
>>     [include: 'included_file.lasso']
>>
>> and in included_file.lasso:
>>
>>     [the_file_that_included_me]
>>
>> => slurp.lasso
>>
>> ?
>>
>> I know I could set a page var in slurp.lasso to equal the filename,  
>> then in included_file.lasso test for the existence of the var and  
>> display its value if it exists, but it isn't as sexy.
>>
>> --steve
>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>> Steve Piercy               Web Site Builder               Soquel, CA
>> <[hidden email]>                   <http://www.StevePiercy.com>
>>
>> ------------------------------
>> Lasso Support: http://support.omnipilot.com/
>> Search the list archives: http://www.listsearch.com/lassotalk.lasso
>> Manage your list subscription:
>> http://www.listsearch.com/lassotalk.lasso?manage
>
>
>
>Regards
>
>Mark Palmer
>E: [hidden email]
>T: 01902 620500
>W: www.pageworks.co.uk
>
>
>
>
>
>------------------------------
>Lasso Support: http://support.omnipilot.com/
>Search the list archives: http://www.listsearch.com/lassotalk.lasso
>Manage your list subscription:  
>http://www.listsearch.com/lassotalk.lasso?manage
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy               Web Site Builder               Soquel, CA
<[hidden email]>                   <http://www.StevePiercy.com>

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Lasso tag for showing which file includes an include?

jasonhuck
Actually I don't know of any way to get specifically what you are asking.

[response_filepath] returns the path to the current "page" (regardless
of what other files that page includes).

[include_currentpath] returns the path of the specific file the tag
was called from (even if that file itself was included by another
file).

So, to get the path of the file that *included* the current file, you
could use [response_filepath] if your includes are only one level
deep, but I don't believe there's a solution for anything deeper.

jlh




On 8/27/06, Steve Piercy - Web Site Builder <[hidden email]> wrote:

> Thanks!  It looks like it's time to get that upgrade from 8.1 if I want sexy code.
>
> --steve
>
>
>
> On Sunday, August 27, 2006, [hidden email] (Mark Palmer) pronounced:
>
> >Take a look at Include_CurrentPath -  it's a Lasso 8.5 tag.
> >
> >
> >On 27 Aug 2006, at 20:15, Steve Piercy - Web Site Builder wrote:
> >
> >> Is there a Lasso tag that can be placed in an included file that
> >> reveals the file that does the including?
> >>
> >> In other words, in slurp.lasso:
> >>
> >>     [include: 'included_file.lasso']
> >>
> >> and in included_file.lasso:
> >>
> >>     [the_file_that_included_me]
> >>
> >> => slurp.lasso
> >>
> >> ?
> >>
> >> I know I could set a page var in slurp.lasso to equal the filename,
> >> then in included_file.lasso test for the existence of the var and
> >> display its value if it exists, but it isn't as sexy.
> >>
> >> --steve
> >> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> >> Steve Piercy               Web Site Builder               Soquel, CA
> >> <[hidden email]>                   <http://www.StevePiercy.com>
> >>
> >> ------------------------------
> >> Lasso Support: http://support.omnipilot.com/
> >> Search the list archives: http://www.listsearch.com/lassotalk.lasso
> >> Manage your list subscription:
> >> http://www.listsearch.com/lassotalk.lasso?manage
> >
> >
> >
> >Regards
> >
> >Mark Palmer
> >E: [hidden email]
> >T: 01902 620500
> >W: www.pageworks.co.uk
> >
> >
> >
> >
> >
> >------------------------------
> >Lasso Support: http://support.omnipilot.com/
> >Search the list archives: http://www.listsearch.com/lassotalk.lasso
> >Manage your list subscription:
> >http://www.listsearch.com/lassotalk.lasso?manage
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> Steve Piercy               Web Site Builder               Soquel, CA
> <[hidden email]>                   <http://www.StevePiercy.com>
>
> ------------------------------
> Lasso Support: http://support.omnipilot.com/
> Search the list archives: http://www.listsearch.com/lassotalk.lasso
> Manage your list subscription:
> http://www.listsearch.com/lassotalk.lasso?manage
>


--
Find and Share Free Lasso Custom Tags at tagSwap.net!
Download hundreds of open source Lasso custom tags, and post your own
for others to use. RSS feeds track the newest and most popular tags.
http://tagSwap.net/

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Lasso tag for showing which file includes an include?

Greg Willits-2
In reply to this post by stevepiercy
On Aug 27, 2006, at 12:15 PM, Steve Piercy - Web Site Builder wrote:

> Is there a Lasso tag that can be placed in an included file that  
> reveals the file that does the including?
>
> In other words, in slurp.lasso:
>     [include: 'included_file.lasso']
> and in included_file.lasso:
>     [the_file_that_included_me]
> => slurp.lasso
>
> I know I could set a page var in slurp.lasso to equal the filename,  
> then in included_file.lasso test for the existence of the var and  
> display its value if it exists, but it isn't as sexy.

I considered adding an include tracer to pageblocks (similar to the  
tagTracer but keeps a stack of includes instead of tag calls)

Here's a stripped down version.

- install the ctag/ctype in /LassoStartup (or rework them for on-
demand I guess)
- in your _siteConfig file create a var named $fw_inclTracer
- for every instance of include:, replace that with fwpFile_include:
- then in any one file include file you should be able to use  
$fw_inclTracer to know which file included the current file by using  
the ->parent tag of the trace object

I ultimately did not add this to pageblocks because it cannot build a  
proper tree of actual include (it needs a native tag you're looking  
for to accomplish that), so I decided it was of limited value.

The caveats of using this are it has to be used either for all  
includes (to build a complete trace), or for at least two nested  
includes in order for the parent tag to work.

Maybe it's useful. It's as close as I could get to doing what you  
want when I thought about it a while back.

-- greg



<?LassoScript
// Create a page var $fw_inclTracer before calling these
define_tag:'fwpFile_include',
        -autooutput,
        -required = 'fw_inclFile', -type = string;
       
        $fw_inclTracer->(insert:#fw_inclFile);
        include:#fw_inclFile;

/define_tag;

//
========================================================================
=====

define_type:'fwp_inclTracer', -prototype;
        local:'files' = array;
//---------------------------------------------------------
// ->insert
// returns the file name of ->size-1
define_tag:'insert',
        -required = 'fw_inclFile', -type = string;
        (self->'files')->(insert: #fw_inclFile);
/define_tag;

//---------------------------------------------------------
// ->parent
// returns the file name of ->size-1
define_tag:'parent';
        return: (self->'files')->(get: (((self->'files')->size) - 1));
/define_tag;
/define_type;
?>



------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Lasso tag for showing which file includes an include?

Bil Corry-3
In reply to this post by stevepiercy
Steve Piercy - Web Site Builder wrote:
> Is there a Lasso tag that can be placed in an included file that reveals the file that does the including?

[lp_include_callingFile] will return the name of the file that called the current file.  It doesn't work with [lassoapp_link] (maybe because all includes are converted to absolute paths?), so it won't work inside of a LassoApp and if you run a LassoApp from it's source, it won't be able to [include] anything.  Any ideas to fix the issue are welcome.

The tags are:

[lp_include_callingFile] - Returns the name of the file that included the current file.  Returns empty string from top-level file.

[lp_include_callingPath] - Returns the path of the file that included the current file.  Returns response_path from top-level file.

[lp_include_currentFile] - Returns the name of the current included file.  Similar to [Include_CurrentPath] except [lp_include_currentFile] works inside of custom tags and [process].

[lp_include_currentPath] - Returns the path of the current included file.

[lp_file_absolutePath] - Returns a path from web root given a relative path.


The code below must be loaded from within LassoStartup in order to properly overload the built-in [inline] tag.

- Bil


[
       
        define_atbegin: {
                var:'_lp_include_chain' = array;
                $_lp_include_chain->(insert: string); // top-level doesn't call itself
                $_lp_include_chain->(insert: response_filepath);
        };

        define_tag:'include',
                -description='Overloads [include] so that the chain of calls can be traced.',
                -priority='high',
                -required='filename',
                -optional='bypass',
                -criteria=(!local_defined:'bypass' && !response_filepath->(endswith:'.lassoapp'));
               
                // normalize path from webroot
                local:'include_file' = lp_file_absolutePath: (string:#filename);
       
                $_lp_include_chain->(insert: #include_file);
                local:'return' = @(include:#include_file,-bypass);
                $_lp_include_chain->remove;
                return: @#return;
        /define_tag;
       
        define_tag:'lp_include_callingFile',
                -description='Returns the name of the file that included the current file.  Returns empty string from top-level file.',
                -priority='replace';
                return: $_lp_include_chain->(get: $_lp_include_chain->size - 1);
        /define_tag;

        define_tag:'lp_include_callingPath',
                -description='Returns the path of the file that included the current file.  Returns response_path from top-level file.',
                -priority='replace';
               
                if: $_lp_include_chain->size == 2;
                        return: response_path;
                /if;
               
                local:'path' = $_lp_include_chain->(get: $_lp_include_chain->size - 1)->(split:'/');
                #path->remove;
                return: #path->(join:'/') '/';
        /define_tag;

        define_tag:'lp_include_currentFile',
                -description='Returns the name of the current included file.',
                -priority='replace';
                return: $_lp_include_chain->last;
        /define_tag;

        define_tag:'lp_include_currentPath',
                -description='Returns the path of the current included file.',
                -priority='replace';
               
                local:'path' = $_lp_include_chain->last->(split:'/');
                #path->remove;
                return: #path->(join:'/') '/';
        /define_tag;

        define_tag:'lp_file_absolutePath',
                -description='Returns a path from web root given a relative path.',
                -priority='replace',
                -required='filename';

                // is it already from webroot?
                if: #filename->(beginswith:'/');
                        return: #filename;
                /if;

                // ok, it's relative
                local:'path' = lp_include_currentPath->(split:'/');
                #path->remove;
                #path->(insert:  #filename);
                #path = #path->(join:'/');
               
                // are we done?
                if: !#path->(contains:'../');
                        return: #path;
                /if;
               
                // nope, got relative traversing going on
                // let's get rid of them...
               
                local:'return' = string;
                local:'previtem' = null;
                #path = #path->(split:'/');
                #path->(insert:'dummy value'); // extra value to make our iterate cycle through all values
                iterate: #path, local:'loop_item';
                        if: #loop_item == '..' || #loop_item == null;
                                #previtem = null;
                        else: #previtem == null;
                                #previtem = #loop_item;
                        else;
                                #return += '/' #previtem;
                                #previtem = #loop_item;
                        /if;
                /iterate;
               
                return: @#return;
        /define_tag;

]


------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Lasso tag for showing which file includes an include?

Fletcher Sandbeck
On 2006-08-28 at 21:20 by [hidden email] (Bil Corry):

>[lp_include_callingFile] will return the name of the file that called
>the current file.  It doesn't work with [lassoapp_link] (maybe because
>all includes are converted to absolute paths?), so it won't work
>inside of a LassoApp and if you run a LassoApp from it's source, it
>won't be able to [include] anything.  Any ideas to fix the issue are
>welcome.

Overloading the [Include] tag will have a number of side effects.  Tags which are defined within any included file will be defined within the local namespace of the tag and will not be available within the including file.  Also, if the [Local] tag is used to create variables within the included file those variables will not be available within the including page.  There may be other side effects as well.

[fletcher]
--
Fletcher Sandbeck                         [hidden email]
Director of Product Development       http://www.lassostudio.com
OmniPilot Software, Inc.                http://www.omnipilot.com

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Lasso tag for showing which file includes an include?

Bil Corry-3
Fletcher Sandbeck wrote:
> Overloading the [Include] tag will have a number of side effects.
> Tags which are defined within any included file will be defined within the local namespace of the tag and will not be available within the including file.

That can be mitigated with:

        namespace_using:'_page_';
                // inline stuff
        /namespace_using;


> Also, if the [Local] tag is used to create variables within the included file those variables will not be available within the including page.

I actually prefer the limited scope of [local] from this side effect.  But if I wanted to copy the [locals] out of the ctag scope and into the "main" [locals] scope, is there a way to do it?  I tried a couple of methods, but they didn't work.


> There may be other side effects as well.

That could be a problem :)  One way to approach it would be to run the code in the -criteria where it's always false, with -priority='high' - that way the we capture which file is called, but the real [include] still runs.  The problem though is one more line of code still needs to run right after the include, to pop the stack.


- Bil


------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Lasso tag for showing which file includes an include?

Fletcher Sandbeck
On 2006-08-29 at 19:44 by [hidden email] (Bil Corry):

>Fletcher Sandbeck wrote:
>> Overloading the [Include] tag will have a number of side effects.
>> Tags which are defined within any included file will be defined within the local namespace of the tag and will not be
>available within the including file.
>
>That can be mitigated with:
>
> namespace_using:'_page_';
> // inline stuff
> /namespace_using;

This has an (admittedly even more rare) side effect if the user is ever calling include within a custom tag and expecting the tags to be defined within the context of the custom tag only.

>> Also, if the [Local] tag is used to create variables within the included file those variables will not be available within the including page.
>
>I actually prefer the limited scope of [local] from this side effect.
>But if I wanted to copy the [locals] out of the ctag scope and into
>the "main" [locals] scope, is there a way to do it?  I tried a couple
>of methods, but they didn't work.

This should do it.  Although, you would also want to watch out for any locals which were created automatically as custom tag parameters or in your custom tag logic.

[vars->insertfrom(locals->iterator)].

>> There may be other side effects as well.
>
>That could be a problem :)  One way to approach it would be to run the
>code in the -criteria where it's always false, with -priority='high' -
>that way the we capture which file is called, but the real [include]
>still runs.  The problem though is one more line of code still needs
>to run right after the include, to pop the stack.

I would just test this modification carefully.  The [Include] tag has some rather unique properties which can be difficult to replicate without using "native" code.

[fletcher]
--
Fletcher Sandbeck                         [hidden email]
Director of Product Development       http://www.lassostudio.com
OmniPilot Software, Inc.                http://www.omnipilot.com

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Lasso tag for showing which file includes an include?

Bil Corry-3
Fletcher Sandbeck wrote:
> I would just test this modification carefully.  The [Include] tag has some rather unique properties which can be difficult to replicate without using "native" code.

Thanks.  Perhaps it's a feature to think about for a future version of Lasso.

- Bil


------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Lasso tag for showing which file includes an include?

Fletcher Sandbeck
On 2006-08-29 at 21:28 by [hidden email] (Bil Corry):

>Fletcher Sandbeck wrote:
>>I would just test this modification carefully.  The [Include] tag has
>>some rather unique properties which can be difficult to replicate
>>without using "native" code.
>
>Thanks.  Perhaps it's a feature to think about for a future version of Lasso.

I would be curious why people are looking for this.  I can see how it would be useful debugging a deeply nested site, but I guess I don't usually work on sites which are nested so deep that I can't trace the list of includes easily myself.

For more advanced debugging I would suggest using the debugger in Lasso Studio for Eclipse.  It lets you set a breakpoint and investigate the current environment in which your tags are running.  You can see the include and tag calling chains, inspect variables, run test scripts within the environment of the current page, and more.

[fletcher]
--
Fletcher Sandbeck                         [hidden email]
Director of Product Development       http://www.lassostudio.com
OmniPilot Software, Inc.                http://www.omnipilot.com

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Lasso tag for showing which file includes an include?

stevepiercy
On Tuesday, August 29, 2006, [hidden email] (Fletcher Sandbeck) pronounced:

>I would be curious why people are looking for this.  I can see how it would be useful
>debugging a deeply nested site, but I guess I don't usually work on sites which are nested
>so deep that I can't trace the list of includes easily myself.

The new tag in 8.5 is all I need because I merely want to make sure one file is being included by another specific file, and not requested directly or by any other file.

The latter discussion about overloading and ctags and bears, oh my, just floats over my head at the moment, but then I said the same thing about SQL syntax a few years ago.

--steve
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy               Web Site Builder               Soquel, CA
<[hidden email]>                   <http://www.StevePiercy.com>

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Lasso tag for showing which file includes an include?

Bil Corry-3
In reply to this post by Fletcher Sandbeck
Fletcher Sandbeck wrote:
>> Thanks.  Perhaps it's a feature to think about for a future version of Lasso.
>
> I would be curious why people are looking for this.

Here's one simple example.


onefile.lasso
-------------
        select: (action_param:'action');
                case:'add';
                        include:'add.lasso';
                case:'delete';
                        include:'delete.lasso';
                case;
                        include:'noaction.lasso';
        /select;


add.lasso
---------
        // do "add" stuff
        include:'redirect.lasso';


delete.lasso
------------
        // do "delete" stuff
        include:'redirect.lasso';


redirect.lasso
--------------
        select: include_callingPath;
                case:'/add.lasso';
                        redirect_url:'add_thankyou.lasso';
                case:'/delete.lasso';
                        redirect_url:'delete_thankyou.lasso';
        /select;



- Bil


------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Lasso tag for showing which file includes an include?

Bil Corry-3
In reply to this post by stevepiercy
Steve Piercy - Web Site Builder wrote:
> I merely want to make sure one file is being included by another specific file, and not requested directly or by any other file.

Yes, that's an even simpler example:

        if: include_callingPath != 'onefile.lasso';
                log_critical: include_callingPath ' included ' include_currentPath ' but is not allowed to do so.';
                abort;
        /if;


- Bil


------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Dynamic <title>[Field: 'Field_Name']</title>

Detlef Hebbel-2
In reply to this post by stevepiercy
Hello!

I wonder how to construct a page header where I can make the page head
dynamic:

<html>
    <head>
        <title>[Field: 'Field_Name']</title>
    </head>

Can I place the [Inline] ... Just above the the <title> or even above
<html>? Would this work? What would be the best practise?

Is anybody please able to give me a working example?

Many thanks.

Cheers
Detlef



------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Dynamic <title>[Field: 'Field_Name']</title>

Mark Palmer
It is more flexible to use a variable instead of the field name, so I  
tend to convert all of the fields to variables at the top of the  
page, something like this. Hope this pseudo code communicates the  
idea OK.

<?LassoScript

Inline(-InlineName='myinline');
/Inline;
Records(-InlineName='myinline');
        // sets all current fields to a variable of the same name
        Loop(Field_Name(-Count));
                Var(Field_Name(Loop_Count) = Field(Field_Name(Loop_Count)));
        /Loop;
/Records;
?>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <title>[$title]</title>
</head>
<body>

</body>
</html>

On 30 Aug 2006, at 10:02, Detlef Hebbel wrote:

> Hello!
>
> I wonder how to construct a page header where I can make the page head
> dynamic:
>
> <html>
>     <head>
>         <title>[Field: 'Field_Name']</title>
>     </head>
>
> Can I place the [Inline] ... Just above the the <title> or even above
> <html>? Would this work? What would be the best practise?
>
> Is anybody please able to give me a working example?
>
> Many thanks.
>
> Cheers
> Detlef
>
>
>
> ------------------------------
> Lasso Support: http://support.omnipilot.com/
> Search the list archives: http://www.listsearch.com/lassotalk.lasso
> Manage your list subscription:
> http://www.listsearch.com/lassotalk.lasso?manage



Regards

Mark Palmer
E: [hidden email]
T: 01902 620500
W: www.pageworks.co.uk





------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Dynamic <title>[Field: 'Field_Name']</title>

Jonathan Vanherpe (T & T NV)
In reply to this post by Detlef Hebbel-2
Detlef Hebbel wrote:

> Hello!
>
> I wonder how to construct a page header where I can make the page head
> dynamic:
>
> <html>
>     <head>
>         <title>[Field: 'Field_Name']</title>
>     </head>
>
> Can I place the [Inline] ... Just above the the <title> or even above
> <html>? Would this work? What would be the best practise?
>
> Is anybody please able to give me a working example?
>
> Many thanks.
>
> Cheers
> Detlef
>
Yes, that works. You can put the lasso tags anywhere.
Essentially Lasso doesn't care about the structure of your html, and
just looks for [ or <?LassoScript to start parsing.

Jonathan
--
Jonathan Vanherpe
Tallieu & Tallieu
[hidden email]

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Dynamic <title>[Field: 'Field_Name']</title>

Jolle Carlestam
In reply to this post by Detlef Hebbel-2
Set all your fields to vars before you start the display part. And  
then use the vars where needed on display.

<?LassoScript //[
        Loop:(Field_Name:-Count);
                Var:(Field_Name:(Loop_Count)) = (Field:(Field_Name:(Loop_Count)));
        /Loop;
//]
?>


/.../

<title>[var: 'Field_Name']</title>

HDB
JC

30 aug 2006 kl. 11.02 skrev Detlef Hebbel:

> Hello!
>
> I wonder how to construct a page header where I can make the page head
> dynamic:
>
> <html>
>     <head>
>         <title>[Field: 'Field_Name']</title>
>     </head>
>
> Can I place the [Inline] ... Just above the the <title> or even above
> <html>? Would this work? What would be the best practise?
>
> Is anybody please able to give me a working example?
>
> Many thanks.
>
> Cheers
> Detlef
>
>
>
> ------------------------------
> Lasso Support: http://support.omnipilot.com/
> Search the list archives: http://www.listsearch.com/lassotalk.lasso
> Manage your list subscription:
> http://www.listsearch.com/lassotalk.lasso?manage


------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Dynamic <title>[Field: 'Field_Name']</title>

Detlef Hebbel-2
Thanks.

I got it working.

Cheers
Detlef


on 30/8/06 9:43 PM, [hidden email] at [hidden email] wrote:

> Set all your fields to vars before you start the display part. And
> then use the vars where needed on display.
>
> <?LassoScript //[
> Loop:(Field_Name:-Count);
> Var:(Field_Name:(Loop_Count)) = (Field:(Field_Name:(Loop_Count)));
> /Loop;
> //]
> ?>
>
>
> /.../
>
> <title>[var: 'Field_Name']</title>
>
> HDB
> JC
>
> 30 aug 2006 kl. 11.02 skrev Detlef Hebbel:
>
>> Hello!
>>
>> I wonder how to construct a page header where I can make the page head
>> dynamic:
>>
>> <html>
>>     <head>
>>         <title>[Field: 'Field_Name']</title>
>>     </head>
>>
>> Can I place the [Inline] ... Just above the the <title> or even above
>> <html>? Would this work? What would be the best practise?
>>
>> Is anybody please able to give me a working example?
>>
>> Many thanks.
>>
>> Cheers
>> Detlef
>>
>>
>>
>> ------------------------------
>> Lasso Support: http://support.omnipilot.com/
>> Search the list archives: http://www.listsearch.com/lassotalk.lasso
>> Manage your list subscription:
>> http://www.listsearch.com/lassotalk.lasso?manage
>
>
> ------------------------------
> Lasso Support: http://support.omnipilot.com/
> Search the list archives: http://www.listsearch.com/lassotalk.lasso
> Manage your list subscription:
> http://www.listsearch.com/lassotalk.lasso?manage
>



------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage