We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2115
    • 10 Posts
    Hello,

    I am currently trying to dig myself into Revo and I can figure out a lot, but what I don’t get: is there no way to just "place" different "content types"? I mean, I understand that I can use chunks, snippets and so on, but this is only good as long as I don’t want to fill in very long variables.

    I wouldn’t fill a whole text content block in a chunk’s parameters... at this point I’d like a dialog that helps me entering it. Sort of like what’s done with template variables. TVs would be totally fine, but I’d need to be able to place them as many times as I want. I read a tutorial where this was achieved by using Ditto for "fetching" content blocks. But, honestly, this is in no way convenient for an editor that doesn’t want to handle "cryptic" stuff.

    Please don’t consider my tone as offensive or something like that, I am just totally in love with what I see in Revo - but from my very own, geeky point of view and I need non-geeks to understand what I’m implementing, too smiley

    Many thanks in advance

    Arne
      • 1169
      • 312 Posts
      Not sure if it will help.

      My friend wanted to edit the Right Column (which would remain the same on all pages displayed on website).
      I used a template with the Right Column in a chunk.

      He wanted to use content same as his pages.

      Solution:-
      I created a Resource with a title of Right Page unpublished.
      With help from @anso & @Everett used following code:-

      I created a snippet (I called it "getContent") put this code in it :-

      // INPUT: $id (int) Page ID of page you want to get the content of. 
      // USAGE: [[!getContent? &id=`5`]]
      $resource = $modx->getObject('modResource',$id); // get the resource as an object
      $output = $resource->get('content'); // get the content 
      
      return $output; // display output 


      Then in Template in Right Column div

      [[!getContent? &id=`5`]] //Page ID of page you want to get the content of.


      You could use this with more than one Resource just call with different &id wherever you need it in your Template.

      If this is what you need please insert [SOLVED] in front of your first post in this thread.
      Welcome to MODx.


        DEVELOPMENT ENV:- Ubuntu 12.04 | MODx Revolution 2.2.8 | LAMP 2i Apache 2.2.22 | Php 5.3.10 | Mysql 5.5.31 MySQL client version: 5.5.31
        • 2115
        • 10 Posts
        Hey there,

        sorry for answering that late and thanks for your answer.

        Unfortunately this isn’t what I meant. Well, it is, sort of, but this is what I mentioned above about fetching content resources using Ditto. Maybe you don’t have to use Ditto any more, but it’s the same procedure.

        What I mean is the following: Let’s say, a client opens a page in the backend and wants to place a block of news on top, a bit of content in the middle and right below this a small image gallery. I know this won’t happen that way, but it describes what he has to be able to do anyway. Just "place" blocks instead of having only the resources textarea or its attached wysiwyg editor. Or, if you will, multiple content blocks or whatever. Just more than only one textarea with variables on your hands.

        Thanks

        Arne
          • 1169
          • 312 Posts
          Do these content blocks exist in website already?

          If yes pull in using snippet.

          If no will they be required for other resources?

          If yes create new resource and pull in with snippet.

          If no just add to resource(page)

          A Resource can contain formatted text and images.

          Unless you have some other way of displaying News & (a bit of content) to me they are both just text in a resource maybe formatted different. huh

          By the way I’m still learning I have no Knowledge of what Ditto is able to do. Do not think ditto is available for revo I think you use getResources but not sure.
            DEVELOPMENT ENV:- Ubuntu 12.04 | MODx Revolution 2.2.8 | LAMP 2i Apache 2.2.22 | Php 5.3.10 | Mysql 5.5.31 MySQL client version: 5.5.31
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            Sounds like Template Variables to me.
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org