NetTalk Central

Author Topic: Page Header Tag on demand?  (Read 4673 times)

osquiabro

  • Hero Member
  • *****
  • Posts: 687
    • View Profile
    • Email
Page Header Tag on demand?
« on: June 10, 2014, 07:20:14 AM »
i try to call a page header tag according a value but create a double header, in my IndexPage i put this code in body routine.

body  Routine
  ! Start of "Top of Routine"
  ! [Priority 5000]
     if p_web.GetSessionLoggedIn() = 0 
        
        !s_web._SitesQueue.Defaults.PageHeaderTag = '<!-- Net:PageHeaderTag -->'
  ! End of "Top of Routine"
  packet.append(p_web.AsciiToUTF(|
    '<<!-- Net:PageHeaderTag --><13,10>'&|
    '<<!-- Net:F:xmain --><13,10>'&|
    '<<!-- Net:PageFooterTag --><13,10>'&|
    '',net:OnlyIfUTF,net:StoreAsAscii))
  ! Start of "Bottom of Routine"
  ! [Priority 5000]
     ELSE
      packet.append(p_web.AsciiToUTF(|   
     '<<!-- Net:PageHeader1Tag --><13,10>'&|         
      '<<!-- Net:F:xmain --><13,10>'&|
      '<<!-- Net:PageFooterTag --><13,10>'&|
      '',net:OnlyIfUTF,net:StoreAsAscii))
  END

osquiabro

  • Hero Member
  • *****
  • Posts: 687
    • View Profile
    • Email
Re: Page Header Tag on demand?
« Reply #1 on: June 11, 2014, 03:50:11 AM »
is the same last app sample post, in indexpage in body routine i put the code.. or try with any sample a put same code, the different between in Page Header Tags is a menu, i need a different Menu according conditions because my width page is limit to 938 and the options inside a menu exceeds the limit.

Thanks..

osquiabro

  • Hero Member
  • *****
  • Posts: 687
    • View Profile
    • Email
Re: Page Header Tag on demand?
« Reply #2 on: June 11, 2014, 04:50:56 AM »
i have a little advance, i need to change in runtime the default pageheadertag i tre with this code inside indexpage and body routine:

 p_web.site.PageHeaderTag='<!-- Net:PageHeaderTag -->'

but how i can refresh the site after assing the value?

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Page Header Tag on demand?
« Reply #3 on: June 11, 2014, 10:58:24 PM »
what do you mean "refresh the site" ?

Incidentally I think you're way off track here. You have a problem which you are trying to solve. But rather than tell us the problem, you are working your way through various solutions trying to figure out how to get your solutions to work. You'd be better off explaining the root problem, and then getting suggestions on the best way to solve that problem.

cheers
Bruce

osquiabro

  • Hero Member
  • *****
  • Posts: 687
    • View Profile
    • Email
Re: Page Header Tag on demand?
« Reply #4 on: June 12, 2014, 04:30:17 AM »
i attach exmple, i need to change de pageheaderTag in runtime like a  themes, go to indexpage to see the code, the indexpage change only in indexpage, after login go to any option in a menu and the pageheadertag go to default pageheader, only home paga change to paageheadertag1.



[attachment deleted by admin]

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Page Header Tag on demand?
« Reply #5 on: June 16, 2014, 02:20:24 AM »
you're still describing a solution - not a problem. It's better to describe the problem.
You have code in IndexPage, but that only runs when Indexpage generates, so I don't think it's in the right place.

It seems to me you are wanting to change the header if the person is logged in or not. Why not just use the conditional settings in PageHeader tag to generate different code if the user is logged in or not?

osquiabro

  • Hero Member
  • *****
  • Posts: 687
    • View Profile
    • Email
Re: Page Header Tag on demand?
« Reply #6 on: June 16, 2014, 04:59:11 AM »
I don't have any code in my PageHederTag only a different menu, my idea is chage a default PageHeaderTag when user is loggin and send a diferrent Menu, in my WebServer i add this code in _SetSessionLoggedIn and _DeleteSession:

Get(s_web._SitesQueue,1)
  s_web._SitesQueue.Defaults.PageHeaderTag = '<!-- Net:PageHeader1Tag -->'
  Put(s_web._SitesQueue)

and work in conjuction with a code in IndexPage.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Page Header Tag on demand?
« Reply #7 on: June 16, 2014, 05:56:40 AM »
It's the wrong approach.

A better approach is to add menus to the menu extension and jsut set which ones you want when the user is logged in which ones when they're not logged in. The menu has this facility built in (for "requires login") and you can add the condition
p_web.GetSessionLoggedIn() = 0
for when they are logged out.

Cheers
Bruce