NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: osquiabro 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
-
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..
-
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?
-
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
-
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]
-
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?
-
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.
-
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