Announcement Announcement Module
No announcement yet.
Some misunderstandings with redirections and css Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Some misunderstandings with redirections and css


    I'm trying the lite-showcase example from GitHub and I've came across some things I don't fully understand. For example:
    - I've added some different css files depending on we are navigating to normal, mobile or a tablet device.
    - If I open the normal page I can see that page with the styles from normal.css. Then if I click on mobile preferences, the page changes and takes the look within mobile.css.
    - However, if I navigate back to normal preferences and home page, it seems normal.css isn't apply then. If I import normal.css within the body tag, styles are apply again. But it doesn't seem a good workaround to me.

    Any ideas?


  • #2
    That's curious. So you simply added a different stylesheet link to each view, corresponding to normal, mobile and tablet?


    • #3

      thank you for answering. Yes, that's the case.

      I've just forked the project and commit the changes I made to it in case you want to a look.

      If I only add the css in the head section of each view nothing seems to happen when I change preferences. Each view get the stylesheet (if any) from the first visited view. If I add them within the body section it works but not completely...

      I think there's something weird with the referenceRepository.SITE_PREFERENCE cookie because when I navigate from mobile from table view, it retains the value of mobile ...



      • #4
        Looking at your project, I recommend adding the c tag notation to your css link. Maybe that will help. I'm testing with the lite-showcase to reference normal, mobile, and tablet stylesheets. I only added one link to the <head> section (as seen below) for each view type. The styles are updating correctly for me when navigating back and forth.

        <link rel="stylesheet" href="<c:url value="resources/normal.css" />" type="text/css">


        • #5
          Thank you Roy!. I will take a look at it.