Jump to content
Welcome to our new Citrix community!

Netscaler 11 Theme Customization - How to Add Links and Verbiage


Mike Roselli

Recommended Posts

  • 2 months later...
  • Replies 81
  • Created
  • Last Reply

This is great information and I have used it to customize a few gateway pages. Is it possible to display text under the password field and above the Log On button using the X1 theme? All of my current text I am displaying has been under the Log On button but I have received a request to place text just above the Log On button and cannot seem to find any information on using this placement. 

Link to comment
Share on other sites

  • 4 weeks later...

Ok gents, I am at a loss here. After trying all the above suggestions on my netscaler, I am still unable to add a custom link on the netscaler homepage right below the logon box.

I am running netscaler 11.1.48 in HA mode, enterprise license.

Using Default Theme, I have tried custom theme and also built in GreenBubbles theme.

I have tried setting _cacheVPNStaticObjects  / _cacheOCVPNStaticObjects both to NO CACHE  and also unbinding both cache policies from my vserver.

 

----------------------------------------

This is my policy:

add rewrite policy Rx-portal_pol "HTTP.REQ.URL.CONTAINS(\"gateway_login_view.js\")" TX_test_6
 

 

This is my action:

add rewrite action TX_test_6 insert_before_all "HTTP.RES.BODY(1000000).SET_TEXT_MODE(IGNORECASE)" q{"var logonbelt_bottomshadow = $(\"<div><div style='text-align:center;color:yellow;font-size:15px;'>Insert Code Here</div></div>\").attr('id','logonbelt-bottomshadow');"} -pattern "box_view.prepare_view();"
 
--------------------------------

 

I can see the hits in the policy increment but nothing shows up on the login page no matters how many times I refresh the page.  Any thoughts as to what I am missing?

Link to comment
Share on other sites

Ok, after a weekend of digging around I was able to get everything to work as expected. My problem turned out to be local caching on the browser and to correct the issue I had to launch the browser in incognito mode (IE 11), for Chrome use inspect element option and under the network tab  at the top check the box [Disable cache]. This forces to browser to download a fresh page every time. Someone had mentioned that earlier on this thread.

 

The other option  that you could do to force the browse to refresh is to log into Netscaler using WinSCP and make a change to any file like custom.css under /var/netscaler/logon/themes/Default_Test/css/custom.css (This assumes that you created a custom theme called Default-Test which is based on the Default theme.

 

This citrix article https://support.citrix.com/article/CTX215817 also suggests that you can edit vpn/gateway_login_view.js   by adding a space at the end of the file and saving it will force netscaler to push out the file.

 

This is what I used as the basis of my ACTION:

add rewrite action rw_act_insert_loginfooter_1 insert_after_all "HTTP.RES.BODY(120000).SET_TEXT_MODE(IGNORECASE)" q{"var login_footer=$(\"<div style='text-align:center;color:#fff;border:2px solid red;'><p>In case of any difficulty:</p>"+"<p>Open the Virtual Desktop FAQ or report it to your System Administrator.</p></div>\").appendTo($(\"#logonbelt-bottomshadow\"));"} -pattern "rdx.utils.get_view(\"gateway_login_form_view\"));"

 

POLICY:

add rewrite policy rw_pol_insert_loginfooter_1 "HTTP.REQ.URL.CONTAINS(\"gateway_login_view.js\")" rw_act_insert_loginfooter_1

 

 

Thanks Mike/Robert and everyone else for this thread. 

Link to comment
Share on other sites

  • 1 month later...

Please post your Policy and  RW Action. Are you able to see if your policy is getting hits?

 

These are my commands:

 

 

> add rewrite action rw_act_insert_belowloginbtn insert_after_all "HTTP.RES.BODY(120000).SET_TEXT_MODE(IGNORECASE)" q{"var login_belowbtn=$(\"<div><a href='http://test.example.com'>Click here</a></div>\").appendTo(right_loginbutton);"} -pattern ".appendTo(right_loginbutton);"
 Done
> add rewrite policy rw_pol_insert_belowloginbtn "HTTP.REQ.URL.CONTAINS(\"gateway_login_form_view.js\")" rw_act_insert_belowloginbtn
 Done
> bind vpn vserver vserver_name -policy rw_pol_insert_belowloginbtn -priority 100 -gotoPriorityExpression END -type RESPONSE
 Done
> save config
Link to comment
Share on other sites

The commands look ok, I have not tested though. 

Are you getting hits on your policy (see screenshot)? if yes, then the issue may be that you need to clear browser cache. In chrome, go to your portal page, right click on the page, select inspect element -> under network tab -> check the box labeled 'Disable cache' (see screenshot)  then refresh the portal to see if your changes appear.

 

 

Link to comment
Share on other sites

The commands look ok, I have not tested though. 

Are you getting hits on your policy (see screenshot)? if yes, then the issue may be that you need to clear browser cache. In chrome, go to your portal page, right click on the page, select inspect element -> under network tab -> check the box labeled 'Disable cache' (see screenshot)  then refresh the portal to see if your changes appear.

 

You are right I'm not getting any hits: https://snag.gy/INBRcj.jpg

 

I've tested with disable cache and IE inprivate browsing. No hits at all.

 

The policy is bind and active: https://snag.gy/JHenEz.jpg

Link to comment
Share on other sites

Tested those commands  on a DEV 11.1.51.21 and 11.1.52.13 builds and they work under the default, green bubble and X1 theme. (will not work if using the RfWebUI)

 

It can take 120 seconds for the rewrite to show up due to the netscaler caching the login page. if you have Enterprise or Platinum you can flush the loginstaticobjects content group under Optimization --> Integrated Caching --> Content Groups or via cli:

 

flush cache contentgroup loginstaticobjects

 

 

Client web browsers also cache as well so please try clearing the cache of your browser as well.

Link to comment
Share on other sites

Tested those commands  on a DEV 11.1.51.21 and 11.1.52.13 builds and they work under the default, green bubble and X1 theme. (will not work if using the RfWebUI)

 

It can take 120 seconds for the rewrite to show up due to the netscaler caching the login page. if you have Enterprise or Platinum you can flush the loginstaticobjects content group under Optimization --> Integrated Caching --> Content Groups or via cli:

 

flush cache contentgroup loginstaticobjects

 

 

Client web browsers also cache as well so please try clearing the cache of your browser as well.

 

I'm on standard but I've added it like 2 hours ago. I'm on version 51.26 though but I don't think that will matter much.

Besides I have a HSTS rewrite policy as well and that's active instantly as soon as I bind it, I removed it as test maybe it conflicted but no.

 

We do have 4 virtual servers I adjusted 2 of them one X1 one Greenbubble both don't show anything.

 

Thanks!

Link to comment
Share on other sites

Should be getting hits if not using the RfWebUi and the content group loginstaticobjects has been updated. If you are unable to flush the content group then see if setting the _cacheVPNStaticObjects policy to NOCACHE helps. (by default that policy is added to all gateway VIPs on creation)

 

FYI

one of the screens you have is of the wrong file. the action is rewriting the gateway_login_form_view.js
Link to comment
Share on other sites

 

Should be getting hits if not using the RfWebUi and the content group loginstaticobjects has been updated. If you are unable to flush the content group then see if setting the _cacheVPNStaticObjects policy to NOCACHE helps. (by default that policy is added to all gateway VIPs on creation)
 
FYI
one of the screens you have is of the wrong file. the action is rewriting the gateway_login_form_view.js

 

Ok so the policy has to be on gateway_login_view.js right?

Link to comment
Share on other sites

 

Should be getting hits if not using the RfWebUi and the content group loginstaticobjects has been updated. If you are unable to flush the content group then see if setting the _cacheVPNStaticObjects policy to NOCACHE helps. (by default that policy is added to all gateway VIPs on creation)
 
FYI
one of the screens you have is of the wrong file. the action is rewriting the gateway_login_form_view.js

 

 

Ok I feel a bit embarrassed now lol setting that policy to NOCACHE did the job! I was totally reading over that.

 

Thanks Mike! Sorry for spamming your topic like crazy :)

Link to comment
Share on other sites

  • 3 weeks later...

 

Should be getting hits if not using the RfWebUi and the content group loginstaticobjects has been updated. If you are unable to flush the content group then see if setting the _cacheVPNStaticObjects policy to NOCACHE helps. (by default that policy is added to all gateway VIPs on creation)
 
FYI
one of the screens you have is of the wrong file. the action is rewriting the gateway_login_form_view.js

 

 

That did the trick for me, huuuuge thanks!

Link to comment
Share on other sites

  • 1 month later...

Hi Folks,

 

I'm trying to customize the AAA vServer logon page, not the NS Gateway page.

Regardsless which theme I use (X1, Greenbubble, RfWebUI), there ist no gateway_login_form_view.js loaded so I can't add content to it.

 

Do you have any idea how to add some text and links below the logon button (and below any error message) on a AAA vServer?

 

Thanks

Nils

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...