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

    I'm trying to implement a blog design using articles. I'm finding my way around most of the stuff in the default articles templates, but I'm running into a bit of a tough spot.

    On the sidebar, I have a call to generate the tags:
    <ul>
      [[+tags]]
    </ul>


    and my tag listing chunk in the advanced settings tab is called "sidetag", with the contents of my sidetag chunk being:
    <li class="cat-item">
      <a href="[[++site_url]][[+url]]">[[+tag]]</a>
    </li>

    -This portion of the site is outputting what I would like it to, however using the tolinks snippet is not working out as well.

    In the post preview section, I also want to display the tags for the individual post along with a preview of the post's content. Here is what I have in my template:
    <div class="meta-tags">
      [[!tolinks? &items=`[[+tv.articlestags]]` &target=`[[*id]]` &useTagsFurl=`1` &tpl=`linkstag`]]
    </div>


    the linkstag tpl contains:
    <a href="[[++site_url]][[+url]]" class="[[+cls]]">[[+item]]</a>
    

    Even with the above tpl, my code output is as follows:
    <div class="meta-tags">
      <a href="http://localhost/modx22pl/blog/tags/second" class="tl-tag">second</a>,
    <a href="http://localhost/modx22pl/blog/tags/blog" class="tl-tag">blog</a>,
    <a href="http://localhost/modx22pl/blog/tags/modx" class="tl-tag">modx</a>,
    <a href="http://localhost/modx22pl/blog/tags/post" class="tl-tag">post</a>,
    <a href="http://localhost/modx22pl/blog/tags/articles" class="tl-tag">articles</a>
    </div>

    My question is, where are these comma's coming from? I'm a rookie with modx, but I'm really trying to dive in. I'm 100+ pages into Bob Ray's book, which is a great jumping point. If I'm missing something obvious, please let me know.

    The other idea I had was to just have another
    [[+tags]]

    call, but can I force it to use a separate tpl, or is the tpl defined in the advanced settings tab in Articles the only tpl I can use?

    I did see this https://forums.modx.com/thread/72495/tags-and-archives-listing-chunks---can-t-find#dis-post-403304 post, but I would assume from Shaun's post response, that default chunks with the default placeholders would appear after installing Articles, however, they are no where to be found in my install. Is this assumption correct, or is the default output for tags and archives defined elsewhere? [ed. note: shick11sp last edited this post 14 years, 8 months ago.]
      • 14784
      • 16 Posts
      You may want to take a look at: http://rtfm.modx.com/display/ADDON/tagLister.tolinks


      "tolinks" has a property of outputDelim that defaults to a comma. Setting it to blank in your call should remove the mysterious comma. =)

      <div class="meta-tags">
        [[!tolinks? &items=`[[+tv.articlestags]]` &target=`[[*id]]` &useTagsFurl=`1` &tpl=`linkstag` &outputDelim=` ` ]]
      </div>
        • 27022
        • 47 Posts
        Quote from: josht at Jan 24, 2012, 02:55 AM
        You may want to take a look at: http://rtfm.modx.com/display/ADDON/tagLister.tolinks


        "tolinks" has a property of outputDelim that defaults to a comma. Setting it to blank in your call should remove the mysterious comma. =)

        <div class="meta-tags">
          [[!tolinks? &items=`[[+tv.articlestags]]` &target=`[[*id]]` &useTagsFurl=`1` &tpl=`linkstag` &outputDelim=` ` ]]
        </div>

        Thanks Josh. That was easy haha. I looked at that page several times, and completely missed it. Thank you. That worked great.

        Other questions:
        Where are the default tpl's (i believe this is the right name for them) for the archives and tags call?
        [[+archives]] & [[+tags]]

        or should I say are the default tpl's shown somewhere after articles installed?

        Also, when the tolinks snippet is called, is the default tpl applied the "default value" described here? http://rtfm.modx.com/display/ADDON/tagLister.tagLister.tpl

        I hope this makes sense...


          • 27022
          • 47 Posts
          Another quick question regarding Articles.

          I saw the post here https://forums.modx.com/thread/73478/adding-sidebar-latest-posts-latest-comments-to-non-blog-pages#dis-post-408227 about using Articles placeholders on other pages.

          Which made me wonder if there is a way to possibly show just the latest post, including the title and introtext for that specific post, on say the front page of the site? I'm having trouble wrapping my head around how I would accomplish this, but maybe its baked right in to articles?


          Still pertaining to the tags stuff, when I use the [[+article_tags]] placeholder on the individual post page, it is also adding comma's to my tags. How do I eliminate these? Is there a way to change the article_tags tpl like I did to change the "tag listing chunk" in the Articles advanced settings? Or is that something that you can add to the call of a placeholder? [ed. note: shick11sp last edited this post 14 years, 8 months ago.]
            • 27022
            • 47 Posts
            Quote from: shick11sp at Jan 27, 2012, 01:04 PM
            Still pertaining to the tags stuff, when I use the [[+article_tags]] placeholder on the individual post page, it is also adding comma's to my tags. How do I eliminate these? Is there a way to change the article_tags tpl like I did to change the "tag listing chunk" in the Articles advanced settings? Or is that something that you can add to the call of a placeholder?

            For anyone searching for help like I was, I found that when I'd use the tolinks snippet call stolen from my ArticleRowtpl ([[!tolinks? &items=`[[+tv.articlestags]]` &target=`[[*id]]` &useTagsFurl=`1` &tpl=`linkstag` &outputDelim=` `]]), I had no luck and the output was blank.

            However, after searching through the articles classes in my installation, I stumbled across another tolinks snippet call in a file, and upon modifying it to this ([[!tolinks? &useTagsFurl=`1` &items=`[[*articlestags]]` &target=`[[*parent]]` &outputDelim=` `]]), I was able to get the output I needed.

            This was not very obvious to me, and I'm really starting to see what people mean when they talk about MODX having a steeeeep learning curve! If I can help anyone else that stumbles upon this, I'll do my best.

            If anyone has answers to any of my other questions, answers would be much appreciated!
              • 27022
              • 47 Posts
              Is there a reason that certain chunks installed by Articles, ie the various quip chunks found here modx22pl\core\components\quip\elements\chunks, aren't listed in the resource tree? Maybe my installation botched this, but it seems like they should be displayed, right? Once again tho, I'll just assume I'm missing something obvious smiley

              Shaun if you read this, maybe if these chunks were listed in the tree upon articles installation, it might be easier for people to figure out what needs edited in order to output their desired results. Just a suggestion. That seems to be what has given me the most trouble working with articles thus far.....
                • 39607
                • 1 Posts
                Quote from: shick11sp at Jan 27, 2012, 02:38 PM


                However, after searching through the articles classes in my installation, I stumbled across another tolinks snippet call in a file, and upon modifying it to this ([[!tolinks? &useTagsFurl=`1` &items=`[[*articlestags]]` &target=`[[*parent]]` &outputDelim=` `]]), I was able to get the output I needed.


                Could you please tell me what file you modified to get rid of the blasted comma as I cant seem to find it...and I'm dealing with this at the moment.