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

    I’m trying to create pages for members to use for blogs, diaries, etc. I’ve created a variant of my standard template, and added the following CSS link:

    <link rel="stylesheet" type="text/css" href="[~[*parent*]~][*version*]" />


    The parent is a folder named the same as the member. It is also a CSS file, so they have the option of using the text editor, or using CSS. The "version" TV is for those who will use CSS, so that they can force browsers to collect their latest CSS file:

    [*version*]" = ?version=2 etc.

    The URL will appear like the this: http://www.xxxxx.com/blog/harry/home. "harry" being empty, or containing CSS; and "home" being their, well, home page. I’ve also created a slightly advanced version, where they can control the TV calling the CSS, for those who will be creating subpages:

    <link rel="stylesheet" type="text/css" href="[*blog*][*version*]" />


    Two things. I’d prefer not have two versions of these blog templates, but I can see no way of easily referincing a file that will be their own CSS file, other than using "parent". Having the blog TV for them to point to their own CSS seems a bit like overkill; I’m probably missing some simple trick.

    On a related issue, using parent messes up the menu system. I’d like to use the menu snippet for the blog-like content, but of course the name of the member is the above folder - I will have "home" showing as a subfile, and of course, it is that file that must be selected.

    I guess that I should just drop the whole idea of using "parent", and provide some instructions for them on how to use the TV to point to their own CSS file. However, any help, pointers to snippets, or whatever, would be greatfully appreciated. There must be someone here who has already created someting similar.

    Thanks.
      • 7923
      • 4,213 Posts
      You could use a snippet like UltimateParent to get the top most parent.. so it would be something like:

      <link rel="stylesheet" type="text/css" href="[~[[UltimateParent]]~][*version*]" />

      But I’m not sure if I understood what your problems are, so don’t know if this is what you’re looking for..


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 37272
        • 216 Posts
        Does that go to the ultimate parent of the documents allowed for that member? If so, I gues it could work. However, it would still leave the CSS folder at the top, and the will upset menu system, I think. I can think of a possible workround, but also need to look at the menu snippets, and see what is actually possible.

        All I’m trying to do is give each member their own space, with the option of having their own CSS file to play with. I do need to for this work logically in a menu snippet too.

        Thanks.
          • 7923
          • 4,213 Posts
          Yes, it will go to the top most level that the user viewing the page has access to. Also, if you don’t want the css folder document to be displayed in the menu, why not just check the "hide in menu" checkbox?


            "He can have a lollipop any time he wants to. That's what it means to be a programmer."
            • 30223
            • 1,010 Posts
            Why don’t you make it much simpler and use the TV for CSS directly? In that case the you’d need to place the TV inside <style> tags in your template instead of calling an exteral stylesheet but for this kind of use that should hardly be a problem I would think. You wouldn’t have to go through the trouble of extra subpages an could use their ’top’ directory as their home page thus avoiding the menu problem. As TV’s can be inherited (or can easily be made to) sub pages would follow the same styles, but the user could overide this for each page if they wanted too.



              • 28042 ☆ A M B ☆
              • 24,524 Posts
              Quote from: TobyL at Sep 05, 2006, 10:06 AM

              Why don’t you make it much simpler and use the TV for CSS directly?
              And TVs can be edited in QuickEdit.
                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
                • 37272
                • 216 Posts
                Hi,

                I think this is what I will do. It’s what I was going to do at first, but then decided that I’d try and make it as simple as possible for those using it. Thinking about it though, those that can make use of the CSS, will be able to handle a TV. Those who who know no HTML/CSS will have no use for the TV, and can just use the text editor. For absolute simplicity, I guess that those who use the editor will have template version that does not have the CSS TV option. This all means that I can a more logical file structure too.

                Thanks for all your input.