0
Welcome Guest! Login
0 items Join Now

How to assign different styles with menu links

    • AndrewG's Avatar
    • AndrewG
    • Jr. Rocketeer
    • Posts: 25
    • Thanks: 0

    How to assign different styles with menu links

    Posted 17 years 3 months ago
    • Hi All

      What would be the easiest way to make different styles for different pages? In other words, how can I add something like "&tstyle=style3" to a particular link menu? Are there any modules for this? Of course, it is possible to hack the db table directly, but it is only one-time silution (very bad :-X)

      Any ideas how to do this?

      Thanks

      Andy
  • Re: How to assign different styles with menu links

    Posted 17 years 3 months ago
    • Hi Andy!

      I wanted to do the same with a Dimensions website, and i did it.

      My way was replacing the «link - content» menu items i had, for new «Link - URL» items.

      How i did it:
      copied each «Link - Content Item» URL from the menu to the pasteboard,
      created a "cloned" menu item « Link - URL»,
      pasted the URL to the link field
      added "&tstyle=style?" at the end.
      Deleted (you may simply unpublish) the old menu items.

      It may be the poorest way to do it, but it's working.

      Best regards
    • Nuno Santiago
      www.pct.com.pt
  • Re: How to assign different styles with menu links

    Posted 17 years 3 months ago
    • AndrewG's Avatar
    • AndrewG
    • Jr. Rocketeer
    • Posts: 25
    • Thanks: 0

    Re: How to assign different styles with menu links

    Posted 17 years 3 months ago
    • I am testing Style Ninja now. It looks as it exactly what needed
    • Bob Ateah's Avatar
    • Bob Ateah
    • Elite Rocketeer
    • Posts: 4521
    • Thanks: 0

    Re: How to assign different styles with menu links

    Posted 17 years 3 months ago
    • AndrewG wrote:
      Hi All

      What would be the easiest way to make different styles for different pages? In other words, how can I add something like "&tstyle=style3" to a particular link menu? Are there any modules for this? Of course, it is possible to hack the db table directly, but it is only one-time silution (very bad :-X)

      Any ideas how to do this?

      Thanks

      Andy

      One way would be to repackage the template with a different default style and different name for each template, install them and assign template A to page X and template B to page Y, etc.

      I'm not sure if this is the most elegant solution...

      Cheers!
    • The member formerly known as Roland Deschain
      After your question is solved, please Edit your original post and choose the Solved message icon, thank you!
    • AndrewG's Avatar
    • AndrewG
    • Jr. Rocketeer
    • Posts: 25
    • Thanks: 0

    Re: How to assign different styles with menu links

    Posted 17 years 3 months ago
    • I can see four ways of doing this:

      1) change links to direct url links and add "&tstyle=styleN"
      2) hack the core menu codes to add a suffix to inks (would be the best IMO)
      3) assign different templates to different pages (not very good as it requires reloading the whole template)
      4) ninja way of assigning different css (no ideas - testing this right now)
    • Bob Ateah's Avatar
    • Bob Ateah
    • Elite Rocketeer
    • Posts: 4521
    • Thanks: 0

    Re: How to assign different styles with menu links

    Posted 17 years 3 months ago
    • AndrewG wrote:
      I can see four ways of doing this:

      1) change links to direct url links and add "&tstyle=styleN"
      2) hack the core menu codes to add a suffix to inks (would be the best IMO)
      3) assign different templates to different pages (not very good as it requires reloading the whole template)
      4) ninja way of assigning different css (no ideas - testing this right now)

      And from this thread :Youyou wrote:
      I think the better way for that is not to assign different template because you will have to load many more images and css.
      The best way is to modify a bit the top of you index.php.

      For example for Jomla 1.0 , if in the top of the index.php you see:
      $color=blue;

      You replace that by:
      if( $_REQUEST['option'] == "com_smf" ) { 
      $color=orange;
      }
      elseif( $_REQUEST['option'] == "com_frontpage" ) { 
      $color=green;
      }
      else{
      $color=blue;
      }

      That will loads orange style on the forum, green style on the frontpage and blue for all the others pages.
      You can also use different requested variables like Itemid ...
      I hope it helps ;)

      PS: It will be nice if you edit your first message to change the title to "How to assign different styles/colors to differents parts of a site ?"
      It think it will be more clear ;)
    • The member formerly known as Roland Deschain
      After your question is solved, please Edit your original post and choose the Solved message icon, thank you!
    • AndrewG's Avatar
    • AndrewG
    • Jr. Rocketeer
    • Posts: 25
    • Thanks: 0

    Re: How to assign different styles with menu links

    Posted 17 years 3 months ago
    • Yes it is a good way, but requires hard coding, i.e. the end-user will not be able to do this. On the other hand they will ask us to change the style (even if it is via the admin panel) anyway...
  • Re: How to assign different styles with menu links

    Posted 17 years 3 months ago
    • do you want the users to decide what style to use on every frontend page or you want that to change automatically?
    • No money to extend membership :(
    • AndrewG's Avatar
    • AndrewG
    • Jr. Rocketeer
    • Posts: 25
    • Thanks: 0

    Re: How to assign different styles with menu links

    Posted 17 years 3 months ago
    • I need to add individual styles from the admin panel (not coding!) to change automatically. So far, the best i could find without inventing the wheel is Ninja Style. It simply writes an extra css link inside of a dummy mod, which an be placed to any page. very simple.

Time to create page: 0.097 seconds