We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4172
    • 5,888 Posts
    I don’t understand why you want use the url-path, also I think its not a good idea, because the url-path can change (example:friendly-urls and so on). I’m sure there are other document-fields or fields from parent-folders you can use for this. In my example I use the pagetitle, because I don’t know your site-structure. For example you want three or more different classes you can create a snippet like this:

    <?php
    $values=explode(',',$values);
    $classes=explode(',',$classes);
    $class=$defaultclass;
    foreach ($values as $key=>$value){
        if ($value==$fieldvalue){
        	$class=$classes[$key];
        }  	
    }
    return $class;
    ?>


    then in your template you can use something like that:
    <body class="[!getclass?&fieldvalue=`[*pagetitle*]`&values=`about,another,onemore`&classes=`WIDE,SMALL,BIG`&defaultclass=`DEFAULT`!]">


    And as ganesh says the easiest way would be to create TVs for this and use the TV-value for the class-name. See ganeshs post!
      -------------------------------

      you can buy me a beer, if you like MIGX

      http://webcmsolutions.de/migx.html

      Thanks!
      • 34017
      • 898 Posts
      I agree with ganesh.

      I create a text TV called bodyStyle and default it to
      class=[*alias*]

      but then you can change it per page

      You could also use inherit if you wanted.
        Chuck the Trukk
        ProWebscape.com :: Nashville-WebDesign.com
        - - - - - - - -
        What are TV's? Here's some info below.
        http://modxcms.com/forums/index.php/topic,21081.msg159009.html#msg1590091
        http://modxcms.com/forums/index.php/topic,14957.msg97008.html#msg97008