We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 53521
    • 26 Posts
    Sorry for the long post but I am a newbie who is in the process of converting a small Drupal bootstrap based site to MODx Revo 2.5.7. I have purchased Bob Ray's "MODx: The Official Guide" and have lots of pages left to read, but I am having a hard time understanding the process of creating/converting a site.

    I am converting this site with the assumption of handing off most of the editing to someone who will not be learning MODx except for what I show them. The editor currently is using CKEditor in Drupal with a few bootstrap add-ins and they are able to handle most edits and new pages. In MODx I am seeing that CKEditor has mcuh less support than TinyMCE so I am using Tinymcewrapper instead of CKEditor.

    First, I created the template, created chunks for header, sidebar and footer and put each document's content in.
    Second, 2-3 pages have carousels and I want to make it easy for editor to change images so I created a chunk for a bootstrap carousel using MIGx TVs but notice I now need to create a template for a left and right positioned carousel. Works great except need for 2 new templates for editor to choose from and I am reading that fewer templates is better.
    Third, I am trying to create a page that has 6-9 images that will be easily modified by editor. I like MIGx and think it is the way to go, but I think I need to create another template in order to only have these TVs available for this document type.

    I can get the site to work fine, but each day I am finding ways of doing it better(ie links, MIGx)I am getting confused so I know I will be explaining over and over how to do things to the editor.

    So finally a few questions:
    1. Without creating new templates, is there a way to limit the TVs so they only show both editing and viewing on certain documents?
    2. In my second step, I created a carousel chunk but felt I needed to create a template for each left and right placement. Is there a better way of doing this with the main template?
    3. What is the best way to create the easiest site for editors and are there any good tutorials? I really don't want to have to explain links, chunks and snippets to them over and over again.
    4. Is there an easy way to add bootstrap grids to Tinymce so the editor can change the layout of the content in a specific ddocument?

    Thanks
    Steve

    This question has been answered by lkfranklin. See the first response.

      • 17301
      • 932 Posts
      Hi Sandd,

      Welcome to the MODX community, what are your first impressions of using MODX coming from Drupal?

      TinyMCEWrapper is a great rich text editor with a lot of functionality, but you may also want to consider redactor (https://www.modmore.com/redactor/) from modmore.com. Redactor is simplistic but robust. In terms of integrating a bootstrap grid I don't think this is something that's currently available out of the box, though tinymce may have a plugin of sorts to do that. What I would suggest instead is looking into either 'structures' (https://modx.com/extras/package/structures) or 'content blocks' (https://www.modmore.com/contentblocks/).

      1.) I can't say I've ever needed this myself personally, a variable in the template is exactly that and not a variable in the resource. If you explain your requirement and setup a little more I may be able to shed some light on how I'd go about approaching it if it was me?

      2.) What leads you to think you would need a template for each left and right placement? How I tend to tackle galleries and carousels is to use MIGX to allow the editor/user to add, remove and sort the order of multiple images and then use a chunk to spit out those images into a list. Then on the front-end just set your carousel js to work with that list.

      3.) MODX has really great user permission controls so you can restrict access and alter the manager form (through form customisation) to hide anything that isn't relevant. In general your clients/editors should not need to know anything about chunks and snippets. You can create an editor account and lock it down exactly how you want. It may be worth looking at NewsPublisher also.

      4.) As mentioned before - Content Blocks or Structures

        ■ email: [email protected] | ■ website: https://alienbuild.uk

        The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
        • 53521
        • 26 Posts
        Hi LK,
        Thanks for your response.
        Certain things in MODX make more sense to me than Drupal but others do not.

        1. Ideally I would like to create a MIGx TV that contains for example manufacturer, model, year, miles but only want the TV to be visible on documents related to cars not the home page or contact us. This way when the editor or client is modifying the page they only are editing the TVs for this document. (This works if I create a new template but I don't want to create tons of templates)

        2. I created templates for left and right carousels so the the editor could just choose which on template they used to display the carousel on the left or right. Not sure how else to allow the editor to change the position of the carousel without giving them access to the elements and showing them how to place them( and repeat each time they modify a page).

        3. I played with permissions and see it is very powerful. I am wondering if my problem here is my lack of understanding MODX. See desired results below:

        4. I will check out both.

        Here is an example of what I am trying to accomplish
        I would like to create a couple of similar but not identical documents. The documents would have a title, some text, the carousel maybe an additional image and some links. The editor would be able to edit all content including the links and the images in the carousel and would need to position the content as well.

        The way I currently have it setup is:
        1. I created a MIGx TV that includes image, image name and alt text.
        2. I created a chunk that displays this as a bootstrap carousel.
        3. I created a template with the carousel displayed on the right side and assign the document to this template so that the TVs only show up for this resource.
        4. Then the editor wanted a similar document with the carousel on the right. I then created another template with the chunk on the right.

        If I was editing the document I would easily place the [[$carousel]] tag where I wanted it but I cannot expect my editors to remember how to and I am confused on how to make this easy for them.

        Maybe Content Blocks or Structures will help.
        • discuss.answer
          • 17301
          • 932 Posts
          What I would personally do is use the collections extra and create a collection of 'cars' with it's own template. It is good to keep your templates low but if they have different variables to other templates then they need to be different templates, it also leaves it open to be scalable in the future. You can of course create categories and assign templates (or anything else for that matter) into respective categories to keep things clean and simplistic.

          Ok I think I understand what you mean now with the left and right templates. I originally thought you meant you were creating something additional for each image to be put into the carousel! What I would do here is create a single list-box template variable called alternateCarousel that asks the editor if they want the carousel to be displayed on either the left or the right hand side. Then create a snippet called CarouselSwitcher with this (untested!)

          <?php
          
          $tv = $modx->resource->getTVValue('alternateCarousel');
          
          if ($tv == 'left') {
            $chunk = $leftChunk;
          } else {
             $chunk = $rightChunk;
          }
          return $modx->getChunk($chunk);


          You can then style up the two chunks respectively to either display the carousel on the right hand side or the left hand side and the user just needs to select what side they would like it to be displayed on. Call this on the template

          [[!CarouselSwitcher? &leftChunk=`LeftChunkTpl` &rightChunk=`rightChunkTpl`]]



          [ed. note: lkfranklin last edited this post 9 years, 3 months ago.]
            ■ email: [email protected] | ■ website: https://alienbuild.uk

            The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
            • 53521
            • 26 Posts
            Thanks!
            I will give that a shot.
              • 53521
              • 26 Posts
              It took me a while but I got this working. And it's really nice. getTVValue had me screwed up. Thank you.

                • 17301
                • 932 Posts
                No worries, glad you got it working smiley
                  ■ email: [email protected] | ■ website: https://alienbuild.uk

                  The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.