We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24865
    • 289 Posts
    Using MODx Revolution 2.0.0-rc-2 rev6923

    Hi!

    I’ve been trying to create a simple section/category/item based blog for 1,5 day now and I can’t seem to get it to work. I’ve tried just about anything I know about MODx. Even more experienced people have tried to help me and they couldn’t quite figure it out as well.

    I am trying to create a ’simple’ multi level blog. You’ve got your basic sections, categories and underneath it all, items. So, let me paint you a picture.

    My current resource layout:
    • Blog (appears in the menu)[list]
      [li]Section: General 1[list]
      [li]Category: Category 1[list]
      [li]Item: Item 1 (posted 1st)
    • Item: Item 2 (posted 3rd)
    [/li][li]Category: Category 2 (empty)[/li]
    [/list]
    [/li]
    [li]Section: General 2

    • Category: Category 3[list]
      [li]Item: Item 3 (posted 2nd)
    [/li]
    [li]Category: Category 4 (empty)[/li]
    [/list]
    [/li]
    [/list]
    [/li]
    [/list]

    As you can see, it’s a basic multi level blog. I’ve also added the post ’date’ so to speak. Hence the ’(posted #)’ part. That’s there the sorting will come in. (publishedon)
    Now, I only want to display the items them selfs. I can assign place holders for [[+sectionname]] and [[+categoryname]] and then of course the links.

    So the display would look like:

    • Item 2 (posted 3rd) (Section: General 1; Category: Category 1)
    • Item 3 (posted 2nd) (Section: General 2; Category: Category 3)
    • Item 1 (posted 1st) (Section: General 1; Category: Category 1)

    Am I asking to much of resources or is it really possible? I don’t see any other outcome. Of course, if I could get some assistance, I could make this into my first good 3rd party snippet for everyone to use. ;-)

    Thanks a lot you guys!

    ReSpawN

    // Edit:
    This topic could also be moved to the Revolution release/support forum
      @MarkGHErnst

      Developer at Adwise Internetmarketing, the Netherlands.
      • 21092
      • 54 Posts
      ReSpawN,
      Not much help with Modx code, but I’d like to state my interest - something like this would work really well on my blog www.katskinner.com - I have the same sort of navigational structure from what I can understand of what you are trying to do.

      I don’t suppose it might help, but could you do some sort of modx call that shows the "parent" (show the container/folder it is in) name of the item and the "absolute parent" (if my term is correct then the top most folder/container) of the item??
        Visit www.katskinner.com for all your expert novel writing tips, tutorials and more.
        • 24865
        • 289 Posts
        neelhtak,

        I am not yet fully up to date when it comes to all the functions that xPDO and MODx combined represent but I reckon that would be possible. Perhaps even setting in the script properties what the absolute parent would be and returning it’s data. When I got a decent answer on my questions in the first topic, I would most likely start building my own snip for MODx and later on, sharing it with the community.

        ReSpawN
          @MarkGHErnst

          Developer at Adwise Internetmarketing, the Netherlands.
          • 18373 ☆ A M B ☆
          • 3,141 Posts
          Hi Respawn,

          Are you using an existing snippet, or building from scratch?

          I’m also in the stage of getting used to Revo, but perhaps some pointers:
          - Set a TV on the categories and sections which indicates it should not be outputted as an item
          - When going through the documents, check for the value of the TV to see if it is a category/section or blog item.


          This could be done using Ditto (using the &filter parameter to filter out the tv’s with a value of 1, for example), there should be a version in the Package Manager that has been modified for Revolution, although I think seeing somewhere it is being phased out. Replacement will be getResources.


          http://svn.modxcms.com/docs/display/ADDON/getResources:
          hideContainers If set, will not show any Resources marked as a container (is_folder).

          If you’ve ever used Ditto or something similar, I don’t think getResources will be too hard to get used to. Altho I still have to use it. tongue
            Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

            Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
            • 28215
            • 4,149 Posts
            IMO, a tag-based approach would be better.

            I’d recommend looking into these extras for a blog:

            - getResources - for general navigation
            - getPage - for pagination
            - Archivist - for archive generation
            - tagLister - for listing used tags, and the tolinks/getResourcesTag snippets, which are packaged in
            - Quip - for commenting
            - getFeed - for Twitter feeds
            - SimpleSearch - for a site search
            - Gallery - for gallery images

            I’d also read my blog, specifically these posts, which detail the blog-creation process:
            - Tagging Blog Posts in Revolution
            - Using tagLister to Navigate by Tags

            The first article shows an example of my structure; although with tagLister you dont have to do the date-scheme folders; you can just have them in a single folder. I’ve attached my blog’s structure to show you this - the Technology section is setup with dates; whereas the Personal section is not.

            I’d do sections - or parent Resources - and then use a textbox TV for tags, similar to how I do it. That way your structure is flexible and easy to navigate. Then you can just use a combination of tagLister, getResourcesTag (in the tagLister Extra), and other snippets in the methods I’ve mentioned to create a fully customizable, flexible blog.

              shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
              • 24865
              • 289 Posts
              @markieham; I like to push the envelope, so I don’t start off with the easy stuff. This way, the easy stuff will seem like nothing compared to the getResources. Aside from that, I’ve read that MODx will no longer support Ditto and Ditto will be discontinued. smiley

              Hi Shaun,

              A very interesting read there. Especially your blog which details your work pretty good. I also love your tag style. I am new to MODx so I am still figuring out the ins and outs of the CMF but so far, I am quite impressed. As of tomorrow, I am starting off developing a getResource type snipper/class which does all that getPage and getResource do. Will I be successful? Let’s leave that up to the almighty gods of PHP. And a little bit skill of course! ;-)

              I’m gonna give your blog a thorough read-trough and I’ll get back to ya! Thanks again for the reply.

              ReSpawN
                @MarkGHErnst

                Developer at Adwise Internetmarketing, the Netherlands.
                • 21092
                • 54 Posts
                Aside from that, I’ve read that MODx will no longer support Ditto and Ditto will be discontinued. smiley

                Is ditto really being discontinued?? I just made my entire website with ditto huh If it modx is stopping the support and updates for it, I’ll have to go recode heaps... Where did you read it was being discontinued???
                  Visit www.katskinner.com for all your expert novel writing tips, tutorials and more.
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  Revo doesn’t need Ditto. In Evo Ditto isn’t going anywhere.
                    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
                    • 21092
                    • 54 Posts
                    @sottwell,

                    Thanks for the reply. I am using Revolution, and didn’t know that I didn’t need to use ditto. I’ll have to look it up. Can you suggest any good tutorials (probably safe to assume I am absolute noob)?

                    Thanks
                    Kat Skinner
                      Visit www.katskinner.com for all your expert novel writing tips, tutorials and more.
                      • 28042 ☆ A M B ☆
                      • 24,524 Posts
                      this should definitely be in your bookmarks http://svn.modxcms.com/docs/display/revolution/MODx+Revolution

                      There has been a discussion of using some Revo functions for retrieving resources like Ditto does, but I don’t use Revo and so don’t recall offhand what they are. I’m sure some of the Revo users and developers will be along to help out shortly.
                        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