NetTalk Central

Author Topic: Custom NetTalk Tag  (Read 4738 times)

jhalpin

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
Custom NetTalk Tag
« on: September 01, 2010, 03:41:48 AM »
Hi. The docs make reference to the ability to use custom tags:

Quote
It's important to note that you can put any tag you like into your web page, as long as you handle it in the ProcessTag method in the WebHandler procedure.

Are there any examples of this?

Thanks,
Jim

ccordes

  • Sr. Member
  • ****
  • Posts: 384
    • View Profile
    • Email
Re: Custom NetTalk Tag
« Reply #1 on: September 01, 2010, 04:48:00 AM »
Hi Jim,
Do you mean tags that include your session variables -<!-- Net:s:MyVariable -->?
or procedures as controls? <!-- Net:MyProcName -->

Chris
Real programmers use copy con newapp.exe

jhalpin

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
Re: Custom NetTalk Tag
« Reply #2 on: September 01, 2010, 05:24:48 AM »
Hi, Chris

Procedures as controls. I get the session variable stuff, but I'm not sure what 'handling the tag' in the ProcessTag method is all about. If I reference a procedure directly, I don't know what embed would be required. If an embed is sometimes needed, why, and how does it work?

Thanks,
Jim

ccordes

  • Sr. Member
  • ****
  • Posts: 384
    • View Profile
    • Email
Re: Custom NetTalk Tag
« Reply #3 on: September 01, 2010, 06:36:11 AM »
Pretty much any netweb procedure (I think except for NetWebPage) can be tagged into another procedure.
In the XHTML tag, add a routine, give it a reason to generate (condition),select where you want it to generate (There is a drop list of possible places) and in the editor that pops up, just include <!-- Net:thenetwebprocedurename -->
You can of course build stuff around it like putting it inside a table -
<Table><tr><td><!-- Net:thenetwebprocedurename --></td></tr></table>
or a div -
<div class="mygraphicallyinterestinglayout")<!-- Net:thenetwebprocedurename --></div>

If you make a static HTML web page, you can even put the tag in there and the webhandler will populate the browse or form for you.

hth
chris
Real programmers use copy con newapp.exe

jhalpin

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
Re: Custom NetTalk Tag
« Reply #4 on: September 02, 2010, 01:26:23 PM »
Thanks, Chris, but I'm still wondering about handling it in the ProcessTag method. Where would that come into play?

Larry Sand

  • Full Member
  • ***
  • Posts: 101
    • View Profile
Re: Custom NetTalk Tag
« Reply #5 on: September 03, 2010, 02:09:32 PM »
Say that you have some site specific data that you want to create a tag; for example Company Name.  In your page you could embed <!-- Net:CompanyName --> and then in the ProcessTag() method you'd add the code to replace it with the value for your site.

So given the above example you'd write something like this in the method before the parent call:

If lower(p_tagstring) = 'companyname'
   someString = 'My Company Name'
   Self.SendString(Self.Translate(someString), 1, Len(clip(someString) ), Net:NoHeader)
   Return
End


However, you need to ensure that none of your custom tags conflict with any procedure labels.

HTH
Larry Sand

ccordes

  • Sr. Member
  • ****
  • Posts: 384
    • View Profile
    • Email
Re: Custom NetTalk Tag
« Reply #6 on: September 03, 2010, 04:43:48 PM »
That's too easy!
thanks
chris
Real programmers use copy con newapp.exe

jhalpin

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
Re: Custom NetTalk Tag
« Reply #7 on: September 07, 2010, 07:52:41 AM »
Cool. Thanks,

Jim