Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Last revision Both sides next revision
litespeed_wiki:cache:litemage:troubleshooting:logged-in-out-with-missing-banner [2017/05/04 21:11]
Michael Alegre created
litespeed_wiki:cache:litemage:troubleshooting:logged-in-out-with-missing-banner [2017/05/05 19:10]
Lisa Clarke [Issue 3: The Case of The Disappearing Banner]
Line 7: Line 7:
 ==== Issue 1: Logged In/Out ==== ==== Issue 1: Logged In/Out ====
  
-On the home page, there is a "Welcome/​Login/​Create an Account" ​section at the top. If a user logs in, we expect to see something like ''​Welcome, Sam! Logout''​. With LiteMage installed, we were instead seeing ​''​Welcome Sam! Login or Create an Account.'' ​In this case, LiteMage cached ​''​Welcome,​ <​punched_hole>​! ​Login or Create an Account'' ​for a logged out user and served that to the logged in user.+On the home page, there is a Welcome/​Login/​Create an Account section at the top. If a user named Sam logs in, we expect to see **Welcome, Sam! Logout**. With LiteMage installed, we were instead seeing ​**Welcome Sam! Login or Create an Account**. In this case, LiteMage cached ​the **Login or Create an Account** text for a logged ​//out// user and served that to logged ​//in// Sam.
  
-This issue was also happening in reverseLiteMage would instead ​cache ''​Welcome, ​<​punched_hole>​! Logout'' ​for logged in userserving ''​Welcome, ! Logout'' ​to non-logged ​in users.+This issue was also happening in reverseLiteMage would cache **Welcome, ​Sam! Logout** for logged in Samand then serve **Welcome, ! Logout** to different ​logged ​//​out// ​users.
  
-Looking further, we see that the user uses the SM Market theme. It looks like a template problem.+Looking further, we saw that these cases were all occurring on sites that used the SM Market theme. It looked ​like a template problem.
  
-We need to punch a hole for that piece of info along with the login button and welcome tag. (**[[litespeed_wiki:​cache:​litemage:​troubleshooting:​checking-hole-punching|How to check hole punching]]**)+LiteMage ​[[litespeed_wiki:​cache:​litemage:​troubleshooting:​checking-hole-punching|punches holes]] for user-specific information like "​Sam,"​ the login button, and the welcome tag. The resulting ESI blocks are processed in small chunks.
  
-Since LiteMage processes these ESI blocks in small chunks, some global PHP variables initialized in header.phtml and social.phtml were not available in these chunks. ​These two files needed to be updated to initialize them: +With this particular template, some global PHP variables initialized in header.phtml and social.phtml were not available in these small chunks. ​The two template ​files needed to be updated to initialize them: 
  
-<​code>​ +**[app/​design/​frontend/​sm_market/​default/​template]#​** ''​vi page/​html/​header.phtml''​\\ 
-/​home/​user1/​public_html/​domain1.com/​app/​design/​frontend/​sm_market/​default/​template]#​ vi page/​html/​header.phtml +**[app/​design/​frontend/​sm_market/​default/​template]#​** ''​vi page/​html/​social.phtml''​
-/​home/​user1/​public_html/​domain1.com/​app/​design/​frontend/​sm_market/​default/​template]#​ vi page/​html/​social.phtml +
-</​code>​+
    
-The following was added to the top of the two templates+The following was added to the top of the two template files:
  
 <​code>​ <​code>​
Line 30: Line 28:
 </​code>​ </​code>​
  
-according to our **[[litespeed_wiki:​cache:​litemage:​troubleshooting:​uninitialized-php-vars-injected-block|Uninitialized PHP Vars In Injected Blocks]]** page.+Problem solved! 
 + 
 +See [[litespeed_wiki:​cache:​litemage:​troubleshooting:​uninitialized-php-vars-injected-block|Uninitialized PHP Vars In Injected Blocks]] ​for more detailed information about this type of issue.
  
  
 ==== Issue 2: Punching A Bigger Hole While Still Purging Private Sections ==== ==== Issue 2: Punching A Bigger Hole While Still Purging Private Sections ====
  
-Now that the initialization problem ​is solved, we need to punch a big hole instead of small one. Logging into the Magento Admin and entering LiteMage config, we add "header" ​in **Customized Block Names for "​toplinks"​ Tag**. ​+Once the initialization problem ​was solved, we needed ​to punch a big hole instead of small one. Logging into the Magento Admin and entering LiteMage config, we added ''​header'' ​in **Customized Block Names for "​toplinks"​ Tag**. ​
  
-We also see "​compare"​ in a toplinks block, so we add "compare" ​to **Additional Purge Tags for "​toplinks"​ Blocks** as well.+We also saw "​compare"​ in a toplinks block, so we added ''​compare'' ​to **Additional Purge Tags for "​toplinks"​ Blocks** as well.
  
 {{ :​litespeed_wiki:​cache:​litemage:​troubleshooting:​litemage-see-minicompare-tag-add-purge.png?​nolink |}} {{ :​litespeed_wiki:​cache:​litemage:​troubleshooting:​litemage-see-minicompare-tag-add-purge.png?​nolink |}}
  
-For more info on this step, check out **[[litespeed_wiki:​cache:​litemage:​troubleshooting:​logged-in-user-info-shown-to-others|Logged In Usernames/​Cart Items Shown On Other User's Pages]]**.+For more info on this step, check out [[litespeed_wiki:​cache:​litemage:​troubleshooting:​logged-in-user-info-shown-to-others|Logged In Usernames/​Cart Items Shown On Other User's Pages]].
  
  
 ==== Issue 3: The Case of The Disappearing Banner ==== ==== Issue 3: The Case of The Disappearing Banner ====
  
-At this point we have fixed the logged in/out issue. Great! Except now the banner ​has disappeared from the homepage.+Upon fixing ​the logged in/out issue, we discovered ​the banner ​had disappeared from the homepage!
  
-After some further investigation,​ we find that the header template ​included ​logic to check if it is displaying on a frontend page or not. If it is not a frontend page, then the banner will not display. This stops us from simply punching a big hole for the header, like we did earlier.+The header template ​includes ​logic to check if it is displaying on a frontend page or not. If it is not a frontend page, then the banner will not display. This stopped ​us from simply punching a big hole for the header, like we did earlier.
  
-We now need to go back and "​fix"​ the login links.+We needed ​to go back and "​fix"​ the login links.
  
-After making a copy of ''​header4.phtml''​, the header style file, we open it to begin modifying. ​+After making a copy of header4.phtml,​ the header style file, we opened ​it to begin modifying. ​
  
-<​code>​ +**[app/​design/​frontend/​sm_market/​default/​template/​page/​html]** ''​vi header4.phtml''​
-[app/​design/​frontend/​sm_market/​default/​template/​page/​html]vi header4.phtml +
-</​code>​+
  
-Inside we can see the "log in" link mixed into the header template. That logic needs to be taken out and put in its own block/​template so we can both hole punch it as a private block AND keep the rest of the header publicly cached.+Inside we could see the "log in" link mixed into the header template. That logic needed ​to be taken out and put in its own block/​template so we could both hole punch it as a private block AND keep the rest of the header publicly cached.
  
 <​code>​ <​code>​
Line 107: Line 105:
 </​code>​ </​code>​
  
-We copy the code inside ''<​div class="​login-regis">''​ and move it int our new welcomelogin.phtml file.+We copied ​the code inside ''<​div class="​login-regis">''​ and moved it into our new welcomelogin.phtml file. 
 + 
 +**[app/​design/​frontend/​sm_market/​default/​template/​page/​html]#​** ''​vi welcomelogin.phtml''​
  
 <​code>​ <​code>​
-[app/​design/​frontend/​sm_market/​default/​template/​page/​html]#​ vi welcomelogin.phtml 
- 
 <?php if(!$this->​helper('​customer'​)->​isLoggedIn() ){ ?> <?php if(!$this->​helper('​customer'​)->​isLoggedIn() ){ ?>
 <a title="<?​php echo $this->​__("​Login"​);​ ?>" class="​btn-head"​ href="<?​php echo $this- <a title="<?​php echo $this->​__("​Login"​);​ ?>" class="​btn-head"​ href="<?​php echo $this-
Line 133: Line 131:
 </​code>​ </​code>​
  
-We now add our new “welcomelogin” block in the header block...+We then added our new “welcomelogin” block to the header block...
  
-<​code>​ +**[app/​design/​frontend/​sm_market/​default/​layout]#​** ''​vi page.xml''​
-[app/​design/​frontend/​sm_market/​default/​layout]#​ vi page.xml+
  
 +<​code>​
 <block type="​page/​html_header"​ name="​header"​ as="​header">​ <block type="​page/​html_header"​ name="​header"​ as="​header">​
 …. ….
Line 144: Line 142:
 </​code>​ </​code>​
  
-...and ​update ​the header4.phtml file to reference the new "​welcomelogin"​ block where the "log in" logic used to be:+...and ​updated ​the header4.phtml file to reference the new "​welcomelogin"​ block where the "log in" logic used to be:
  
 <​code>​ <​code>​
Line 175: Line 173:
 </​code>​ </​code>​
  
-Finally we go back to our LiteMage Configuration in the Magento Admin Panel and add “welcomelogin” to **Customized Block Names for "​welcome"​ Tag**.+Finally we went back to our LiteMage Configuration in the Magento Admin Panel and added ''​welcomelogin'' ​to **Customized Block Names for "​welcome"​ Tag**.
  
 Voila! The banner is back and LiteMage is operating at 100%. Voila! The banner is back and LiteMage is operating at 100%.
  • Admin
  • Last modified: 2017/05/05 19:10
  • by Lisa Clarke