We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1421
    • 9 Posts
    I have just implemented the basic tab layout using the code example - http://wiki.modxcms.com/index.php/Tabbed_content
    there seems to be limitation with this example.

    here is what I am trying to achieve

    Each Section (document) would have 3 tabs

    for example:
    Company => Profile | Agents | Partners

    so I would require 3 additional dynamic content variables
    for example I would need to create the following variables:

    How would I go about creating these additional variables & linking them to this type of functionality?

    [*tabtitle1*]
    [*tabtitle2*]
    [*tabtitle3*]

    [*#tabcontent1*]
    [*#tabcontent2*]
    [*#tabcontent3*]
      • 1421
      • 9 Posts
      I have started to look into the structure of MODx so I am able to add new varaibles for my site

      It would make sence to have the additional variables within the create/edit document section
      mutate_content.dynamic.php

      Hopefully someone can point me in the right direction to the process of adding additional content & title fields.
      also I have added the new fields in the table "modx_site_content"

      tab1 (varchar 255)
      tab2 (varchar 255)
      tab3 (varchar 255)
      tabContent1 (mediumtext)
      tabContent2 (mediumtext)
      tabContent3 (mediumtext)

      Would I need to follow the same process below to add a new content variable & is there a class I need to define these new varaibles in?

      <?php
      if (($content['richtext'] == 1 || $_REQUEST['a'] == 4) && $use_editor == 1) {
      	// replace image path
      	$htmlContent = $content['content'];
      	if (!empty ($htmlContent)) {
      		if (substr($rb_base_url, -1) != '/')
      		        $im_base_url = $rb_base_url . '/';
      		else    $im_base_url = $rb_base_url;
      
      		$elements = parse_url($im_base_url);
      		$image_path = $elements['path'];
      
      		// make sure image path ends with a /
      		if (substr($image_path, -1) != '/')
      			$image_path .= '/';
      
      		$modx_root = dirname(dirname($_SERVER['PHP_SELF']));
      		$image_prefix = substr($image_path, strlen($modx_root));
      		if (substr($image_prefix, -1) != '/')
      			$image_prefix .= '/';
      
      		// escape / in path
      		$image_prefix = str_replace('/', '\/', $image_prefix);
      		$newcontent = preg_replace("/(<img[^>]+src=['\"])($image_prefix)([^'\"]+['\"][^>]*>)/", "\${1}$im_base_url\${3}", $content['content']);
      		$htmlContent = $newcontent;
      	}
      ?>
      
        • 1421
        • 9 Posts
        Ok looks like I missed out the obvious here grin
        http://sottwell.com/how-template-variables-work.html

        This is exactly what I wanted & no need to dig in to the source code at the moment smiley
        it would be a great feature If variables could be assigned to groups similar to categories then each group could be defined as a tab to appear in Create/edit document section

        for example this would be great
        General | Page Settings | META Keywords | Tab Variables | Gallery Variables | Preview

        Maybe this could be considered in the future wink
        from what I have seen so far MODx really does seem to be the #1 CMS System.
          • 36416
          • 589 Posts
          Quote from: amwdesign at Mar 11, 2009, 10:00 PM

          it would be a great feature If variables could be assigned to groups similar to categories then each group could be defined as a tab to appear in Create/edit document section

          for example this would be great
          General | Page Settings | META Keywords | Tab Variables | Gallery Variables | Preview

          Maybe this could be considered in the future wink

          The future is now, i.e.: http://modxcms.com/forums/index.php/topic,32373.0.html
            • 1421
            • 9 Posts
            I love this System laugh