We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17429
    • 18 Posts
    I’ve been doing my homework and learning to use MODx, but I have 3 questions which I cannot seem to find an answer for. Sorry if this is considered question bombing, but after searching through the forums, I cannot figure them out:

    1) I like the ’use friendly alias path’ option, and I have my ’site start’ set to a document on my tree, and I would like to base my site structure on the tree itself. Here is an example tree:

    Site
    -Doc01
    --Doc01.01
    --Doc01.02
    --Doc01.03
    --Doc01.04

    -Doc02
    --Doc02.01
    --Doc02.02
    --Doc02.03

    -Doc03 <--’site start’ points here
    --Doc03.01
    ---Doc03.01.01
    ---Doc03.01.02
    --Doc03.02
    ---Doc03.02.01
    ---Doc03.02.02
    ---Doc03.02.03
    --Doc03.03

    The only problem I run into with this is the friendly urls look like this:
    www.example.com/Doc03/
    www.example.com/Doc03/Doc03.01/
    www.example.com/Doc03/Doc03.01/Doc03.01.01
    www.example.com/Doc03/Doc03.01/Doc03.01.02
    etc...
    Since I’m using the Doc03 document as my ’root’ node, I would like to eliminate it from my urls. Is there any way to do this? I suppose I could hack up the .htaccess file, but I think that could get unwieldly, and I’d like to avoid it if possible.

    2) I’m trying to implement tagging for my documents. Here is what I’m doing:

    First, I created a node off of my site tree, and called it Tags. This document has the following Ditto snippet:
    [!Ditto? &startID=`19` &summarize=`1000` &tpl=`dittoTagsTpl`!]
    (19 is the id of the ’Tag’ document).

    The ’dittoTagsTpl’ chunk contains the follwing:
    <a href="[~[+id+]~]">[+title+]</a>
    .

    Next I created a TV called ’tags’. It consists of check boxes with the following for "input option values":
    @SELECT pagetitle FROM site_content WHERE parent=19 ORDER BY pagetitle ASC
    (remember that 19 is the id of the ’Tag’ document)
    I assign this TV to any template which might contain content which I would like to tag.

    Now, when I need to create a new tag, I just need to attach a new document to the original ’Tag’ document. These child documents have no content, but use the following template: "Pages marked with the "[*pagetitle*]" tag:
    [!Ditto? &startID=`12` &summarize=`5` &emptyText=`Nothing has been tagged with this tag...` &tagData=`tvtags` &tagDelimiter=`,` &tags=`[*pagetitle*]`!]". Thus, they automatically list any documents which have been associated with them.

    Note that since the template variable uses a direct DB query, I don’t have to update anything to add a new tag - I just add the new tag as a child document of the "tag" document. This method seems to work great, but I’m wondering if I’m reinventing the wheel here. Is this a suitable method? Does anyone perhaps know of a much simpler way to do this? (I have a tendency to overcomplicate things embarrassed)

    3) Can I make certain pages only accessible to users who have logged in? I have played with the users settings and user group settings, but it seems to only apply to what users can edit, not what they can view.

    Whew! I’m sorry if I’m breaching any unspoken protocol by posting a bunch of questions at once, but I have been looking for the answers. I juts cannot find them. Thanks for any help!

    Also, thanks for the great forums. I’m just learning about MODx, and everyone here has been really helpfull and friendly. I appreciate the effort that goes into helping newcomers like me! grin And I really like MODx!!

    P.S. Has anyone else noticed that the spell checker here catches "MODx" as a misspelling? What’s the deal with that?!
      • 22303 MODX Staff
      • 10,725 Posts
      1) Add <base href="[(site_url)]"></base> to all your templates...this will resolve the virtual paths issues.
      2) Probably get better response if you post this specific question in the Ditto support forum, and include additional information, like what versions of MODx and Ditto are being used.
      3) See http://modxcms.com/why-web-users-and-web-groups.html
        • 17429
        • 18 Posts
        Thank you for your response, Jason. I will repost the Ditto question, and read up on web users. Thanks!