NetTalk Central

Author Topic: Method to substitute <!-- Net:s:SessionVariable --> in HTML?  (Read 33 times)

JohanR

  • Sr. Member
  • ****
  • Posts: 435
    • View Profile
    • Email
Method to substitute <!-- Net:s:SessionVariable --> in HTML?
« on: November 07, 2026, 06:03:15 AM »
Hi,

I have some HTML loaded in a session variable.
the HTML contains a tag <!-- Net:s:SessionVariable -->

Is there a method that will parse/substitute the tags?

thanks

Johan


osquiabro

  • Hero Member
  • *****
  • Posts: 727
    • View Profile
    • Email
Re: Method to substitute <!-- Net:s:SessionVariable --> in HTML?
« Reply #1 on: November 07, 2026, 06:33:14 AM »
yes you can with string Theory, example of my code

 Htm:TemplateId = 3
        GET(HtmlTemplates,Htm:PK_HtmlTemplates)
        IF ~ERROR()
            Loc:HTML = Htm:TemplateHTML
            st.SetValue(Loc:HTML)         
            st.replace('@nombre@',p_web.GSV('nombre'))
            st.replace('@fechadepago@',format(p_web.GSV('Afi:FechaPago_DATE'),@d03))
            st.replace('@cantidadpagada@',FORMAT(p_web.GSV('Afi:CantidadPagada'),@n$6.2))
            st.replace('@referencia@',p_web.GSV('Afi:NumeroPago' ))
            st.replace('@recibo@',p_web.gsv('Afi:NumeroPago'))
            Loc:HTML = st.Getvalue()       
            Loc:TemplateSubject = Htm:TemplateSubject
            st.SetValue(Loc:TemplateSubject)               
            Loc:TemplateSubject = st.Getvalue()
        END
        Access:HtmlTemplates.Close()       

JohanR

  • Sr. Member
  • ****
  • Posts: 435
    • View Profile
    • Email
Re: Method to substitute <!-- Net:s:SessionVariable --> in HTML?
« Reply #2 on: November 07, 2026, 09:52:16 PM »
Hi,

Yes, thanks, I can certainly do manual replace exercise.
Was wondering if there was a handy NT function that does the same as the tag replacement with the static files.
Using the NT functions would be preferable as it would work for all cases and follow the NTWS method of doing it.

thanks

Johan