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

    I break my head with this silly problem:

    say, I have a catalogue of items (let it be cars):

    /items/
    ---/small/
    ---/big/
    ---/speedy/
    ---/heavy/

    each item may belong to one or more category, so say big and heavy car will go to both heavy and big categories.

    I decided to go with tags and that's nice approach, I've created another document with id of 66, set it not to be listed in menu, add every item as a child of thet document, and then just use Ditto on each of \big\ and \heavy\ pages to list items with given tag, like this:

    [[Ditto? &startID=`66` ... &tags=`heavy`]]


    Works nice, but as I click on any item on '/heavy/' page I simple go to child of id=66, so the URL visible changes, and moreover menu highlited item won't now be heavy of big, but rather none at all (as id of 66 is set as hidden in menu).

    So I'd like to ask you how should I go now? I'd like to allow item to be shown in one or more categories but I hate to create multiply instance of each item as if ever the item be changed I'll have to change it in each instance. I also want to have the parent category highlighted (so if I go like item -> big -> item, then the menu should show that the item is under big section.

    A bit messy description, sorry for that. Hope the solution is possible anyway...

    Thank you in advance!
      • 2762
      • 1,198 Posts
      I understand, but same document in more category/folders will penalize your Seo.
      It's a duplicated content.
        Free MODx Graphic resources and Templates www.tattoocms.it
        -----------------------------------------------------

        MODx IT  www.modx.it
        -----------------------------------------------------

        bubuna.com - Web & Multimedia Design
        • 356
        • 31 Posts
        Quote from: banzai at Oct 06, 2013, 05:26 PM
        It's a duplicated content.

        That's not an issue. I deal with catalog that should be useful rather that simple SEO-friendly.

        So how should I handle the problem? Ok, how would you deal with it if it were your task?
          • 13226
          • 953 Posts
          @ achekalin

          I dont know if this will help you but here goes anyway:

          Quick and dirty:

          1)
          Login to the manager

          2)
          Create a new TV - name it "myTags"

          TV Settings:

          • Input type: Check Box
          • Input Option Values: @CHUNK TagOptions
          • Widget: Delimited List
          • Widget Properties - Delimeter "," (without inverted brackets)

          Set the Template access to the templates where you want the tags to be shown and then save the new TV

          3)
          Create a new Chunk - name it "TagOptions"

          Write your tags in the chunk code area e.g Tag1||Tag2||Tag 3||Another Tag

          Save the chunk

          4)
          Create a new Chunk - name it "dittotags"

          Write the following in the chunk code area: [+tagLinks+]

          Save the chunk


          5)
          Create a new page in the document tree that will solely be used to output all pages shown for the individual tags

          The URL can be whatever you want - the URL output will look similar to this => domain.com/FURLNAME.html?category=Tag+1

          In the settings tab remove the tick from "cacheable"

          Place the followig in the content area:
          [[Ditto? &parents=`1,2,3,4,5` &orderBy=`menuindex ASC` &tagData=`myTags` &tagDelimiter=`,` &summarize=`10` &paginate=`1` &paginateAlwaysShowLinks=`1` &showInMenuOnly=`0` &showPublishedOnly=`1`]]

          &parents => replace the numbers for yours

          Save the page


          6)
          The pages where you want to be able to select and show the tags on need the following:
          [[Ditto? &documents=`[*id*]` &tagDocumentID=`10` &tagData=`myTags` &tpl=`dittotags` &tagSort=`1` &tagDelimiter=`,` &tagDisplayDelimiter=`, `]]

          &tagDocumentID => change the ID "10" to the ID of your page, the page (described in point 5) that will output all the pages with the individual selected tags e.g. all pages with Tag 1

          You can add the code to the content or directly in the template used for the document

          Conclusion

          I suggest you read up on this here:

          There are other ways around this, but not as easy as this method [ed. note: iusemodx last edited this post 10 years, 6 months ago.]
            • 356
            • 31 Posts
            Quote from: iusemodx at Oct 06, 2013, 10:07 PM
            @ achekalin

            I dont know if this will help you but here goes anyway:

            Thanks for coming but that's exactly how I've done that. In fact that's the approach that's won't solve my problem which is different from simple how to set up Ditto to use tags.

            I appreciate your willing to help but I need answer for somewhat different question that the one you answered. I really ask you to re-read the initial question once again, please!
              • 13226
              • 953 Posts
              @ achekalin

              If my post doesnt help you, post more information.

              If you dont write down what you have already tried, you cant expect people to give you advice not knowing what has already been tried out and found not to work.

              Post the full Ditto calls for:

              1) The tag page e.g. Heavy, Small etc.
              2) The product / blog page where the Tag Links are rendered

              Post any chunks that are involved with the Ditto calls
                • 356
                • 31 Posts
                Quote from: iusemodx at Oct 07, 2013, 07:56 AM
                Post the full Ditto calls for:

                1) The tag page e.g. Heavy, Small etc.
                2) The product / blog page where the Tag Links are rendered

                Yes, sure. I'll do that a bit below. But please note that my Ditto calls are all working right, I see everything I should on my pages etc. I need to know how to handle my problem with item lists, not with Ditto calls.

                Let me repeat what I write in the first post:

                1. I have a list of items (cars), each of it have some characteristics associated (one car is "heavy" and "big", another is "light" and "small" etc, not limited only by size and weight). I put all these items as children of single document (id=66), and set this doc to be "hidden in menu".

                2. I set up several pages each contains Ditto call like this:

                [[Ditto? &startID=`66` 
                         &tpl=`ItemTpl` 
                         &tagData=`tvItemInfo` 
                         &tagDelimiter=`,` 
                         &tagMode=`onlyTags` 
                         &noResults=`` 
                         &tags=`heavy`]]


                the heavy is the tag, and this is the only piece I change on each page. Each such a page have its own address (like 'heavy', 'big' etc), so in fact I have such a docs tree:

                (root)
                  +---items
                      +----big
                      +----small
                      +----heavy
                      +----itemstorage <-- hidden in menu


                and under this last itemstorage all items are listed.

                3. Here is the fuzzy part.

                Ok, say user visits page with URI of /items/small/, where Ditto call with &tags=`small` is located. The user will see all the items with tag "small", with link on each item. Say user click on such a link - the page for that item will appear, but the page's URI won't be /items/small/item-name as user may expect, but rather /items/itemstorage. Moreover, on the item page I can't put "back link" such as "All small cars", since I don't know in advance which tags are assigned to that item/page. I also can not highlight menu item of "items -> small", since item page is under different parent.

                That's the problem. Surely I can post chunks involved but it won't ideologically solves my prblem, isn't it? And this is something I need help with - the approach itself.
                  • 13226
                  • 953 Posts
                  Sorry, but this seems extremely complicated for what you are trying to do.

                  I have the same methodic in a variety of websites and they all work perfectly

                  Ive now seen one difference between my call and yours - you use &startID=``

                  My call for the tag page e.g. Heavy, Small

                  [[Ditto? &parents=`3` &orderBy=`pub_date ASC` &tagData=`myTags` &tpl=`TagOverviewList` &tagDelimiter=`,` &summarize=`10` &paginate=`1` &paginateAlwaysShowLinks=`1` &showInMenuOnly=`0` &showPublishedOnly=`1` &hideFolders=`1` &depth=`2` &tagMode=`onlyTags` &tags=`[*menutitle*]`]]

                  The "Tag" page should be the one that outputs all of the pages that are tagged with that specific tag not "itemstorage"

                  Just to clear things:
                  but the page's URI won't be /items/small/item-name
                  That wont happen anyway, unless the product page is a child of the tag

                  The URL that should be / is rendered in the Ditto output will / should point to the product page as set in the tree, so if the product page is in a folder "products" it will look like "products/product.html" not "/items/small/product.html"

                  You could call the Tag page a quick link page - it wont be a parent for any product unless you place the product in it

                  A tip:

                  Instead of having to change this everytime &tags=`` for each tag, you can use &tags=`[*pagetitle*]` or any other field, just make sure it is written the same as your tag - case sensitive.
                    • 13226
                    • 953 Posts
                    UPDATE

                    A lot of misunderstanding is going on here

                    After re-reading your post (yet again) I see that all of your product pages are in the folder "itemstorage", which is a child of the tag parent folder

                    I havent seen anyone do it this way before - Ive only ever seen this completed when the products are not in the tag folder

                    e.g.
                    Home
                    Contact
                    Terms
                    Tags
                    =>=>Small
                    =>=>Medium
                    =>=>Large
                    Products
                    =>=>Product 1
                    =>=>Product 2
                    etc....

                    An example using the structure above:

                    Product 1 is tagged in Small & Medium
                    Tags are rendered on the Product 1 page and when clicked you are taken to:
                    Small => domain.com/Tags/Small
                    Medium => domain.com/Tags/Medium

                    The tag page "Small" outputs all products that are tagged with "Small"
                    Each link that is produced, renders as: domain.com/Products/ProductName

                    You can obviously have more than one parent document, so in turn the URL will change for the parent document e.g.

                    Using a blog:

                    Blog posts tagged in Small could render in the tag page as: "domain.com/Blog/Blogpost" [ed. note: iusemodx last edited this post 10 years, 6 months ago.]
                      • 356
                      • 31 Posts
                      Quote from: iusemodx at Oct 07, 2013, 09:13 AM
                      UPDATE
                      I havent seen anyone do it this way before - Ive only ever seen this completed when the products are not in the tag folder

                      I agree I went the hard way but so far I find no better solution. In fact I don't want to use "tags" word on pages at all (since the site is a catalogue, not a blog), so I have to deal with it internally only.

                      The idea behind all the mechanics is looking like this:

                      the user visits the site, and see sections named by our "tags":

                      /Big
                      /Heavy
                      /Small
                      ...etc...

                      When he/she click on "Heavy", the page with all heavy cars will be displayed. When user click on any of that "car" link, the single car page will appears, with a link reads "Back to heavy cars list". If the same car internally marked (tagged) as heavy and big, both /heavy/carname and /big/carname pages will be there, but /heavy/carname will only display link to /heavy page, and /big/carname will display link to /big page. We also don't care for SEO.

                      Frankly I understand that way too complicated and may not be necessary for the average visitor, but that was the idea.

                      Just for a second I suddenly got the idea: may I somehow accomplish that using weblinks instead of tags? Say, we populate /heavy subtree with cars docs, then under /big create weblinks that points to given cars in /heavy? I ask since I have no real serious experience with weblinks and I doubt if I'll be able to display parent folder in a right way.

                      Thank you for your patience and for the advices!