We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32645
    • 377 Posts
    Edit: Fixed typo. The space between {{ and Social_Bookmarks was intentional.

    I have a ditto chunk which outputs fine, however I need to output a social bookmark chunk.

    Because I need to use this chunk elsewhere, I need to seperate the chunk; it is also much cleaner to seperate the social bookmark chunk from my main ditto chunk.

    However I find that my social bookmark chunk does not pick up the template variables at all.

    I have tried using [+id+] and [*id*] within the social bookmark chunk, but it only outputs the calling Ditto page, and not the article.

    <h2><small>[*createdon:date=`%d/%m/%Y`*]</small><br />[+title+]</h2>
    [+tv_media+]
    <div class="blog_article">
    	<div class="section_left box300_w">
    		[+content+]		
    	</div>
    	<div class="section_right box300_w">
    		[+phx:if=`[+tv_relatedLinks+]`:isnot=``:then=`Related links:`+]
    		<div class="hide_ul_list">[+tv_relatedLinks+]</div>
    		<p class="txt_share">Share:</p>
    		<div class="hide_ul_list">
    
    {{Social_Bookmarks}}
    
    
    		</div>
                   [!PrintDoc? &print_doc=`170`!]
    	</div>
    	<div class="clearfix"></div>
    </div><!--end:div-->
    


    // Social bookmarks chunk
    [+id+]
    [*id*]
    [*title*] <-- This outputs the ditto caller, not the actual ditto article
    [+title+]
    


    I require the social bookmarks chunk to carry through the article variables.

    Is there a way to do this?
      • 36926
      • 701 Posts
      Quote from: worchyld at Oct 01, 2009, 09:19 AM



      
      
      {{ Social_Bookmarks}}
      
      
      


      You have a space between {{ and Social. This could be causing problems.

      Ben
        • 4172
        • 5,888 Posts
        try [+pagetitle+] instaed of [+title+] and perhaps use &hiddenFields=`tv1,tv2,tv3` for fields, which ditto cannot see in his tpl
          -------------------------------

          you can buy me a beer, if you like MIGX

          http://webcmsolutions.de/migx.html

          Thanks!
          • 32645
          • 377 Posts
          The space between {{ and Social_Bookmarks is intentional -- if I repair the issue, it will not output any of the template variables or document variables within the chunk.
            • 32645
            • 377 Posts
            This is the exact call/code (with minor modifications for efficacy)

            Task:
            Make Ditto call my blog chunk, and the social bookmarks chunk

            Problem:
            The Blog chunk pulls in the social bookmarks chunk, but the social bookmarks chunk loses simple article info, such as [+id+]


            Possible solutions:
            Put all the content in one chunk. (I would like to keep it seperate to keep stuff clean)


            // Ditto call in my Template
            [[Ditto? &startId=`[*id*]`  &showInMenuOnly=`1`  &pagesPerPage=`10` &depth=`0`  &hideFolders=`1` &paginateAlwaysShowLinks=`1` &tplPaginatePage=`pageSplitter` &tplPaginateCurrentPage=`currentPageSplitter` &paginate=`1` &display=`5` &summarize=`5 ` &phx=`0` &extenders=`summary` &tpl=`Blog_chunk` &hiddenFields=id,content,pagetitle,title`]]
            


            // Blog chunk
            <h2><small>[*createdon:date=`%d/%m/%Y`*]</small><br />[+title+]</h2>
            [+tv_media+]
            <div class="blog_article">
            	<div class="section_left box300_w">
            		[+content+]
            	</div>
            	<div class="section_right box300_w">
            		[+phx:if=`[+tv_relatedLinks+]`:isnot=``:then=`Related links:`+]
            		<div class="hide_ul_list">[+tv_relatedLinks+]</div>
            		<p class="txt_share">Share:</p>
            		<div class="hide_ul_list">
            
            {{Social_Bookmarks}} 
            
            		</div>
            	</div>
            	<div class="clearfix"></div>
            </div><!--end:div-->
            


            // Social bookmark chunk
            Testing output:
            [+id+] <-- This is blank
            [*id*] <-- This returns the document calling Ditto
            
            <div class="social-bookmark-list">
            <ul>
            <li>
            <a class="nohover" href="http://slashdot.org/bookmark.pl?url=[(site_url)][~[+id+]~]&title=[+title+]" target="_blank">
            <img alt="Save to slashdot" border="0" src="assets/images/bookmark/slashdot.png" title="Save to slashdot"/>
            </a>
            </li>
            </div>
            
              • 4172
              • 5,888 Posts
              Try to clear the cache and use uncached snippet-call: [!..............!]
                -------------------------------

                you can buy me a beer, if you like MIGX

                http://webcmsolutions.de/migx.html

                Thanks!
                • 32645
                • 377 Posts
                I’ve cleared the cache, unchecked cache in document and called the Ditto, like this:

                [!Ditto? &startId=`[*id*]`  &showInMenuOnly=`1`  &pagesPerPage=`10` &depth=`0`  &hideFolders=`1` &paginateAlwaysShowLinks=`1` &tplPaginatePage=`pageSplitter` &tplPaginateCurrentPage=`currentPageSplitter` &paginate=`1` &display=`5` &summarize=`5 ` &phx=`0` &extenders=`summary` &tpl=`Blog_chunk` &hiddenFields=id,content,pagetitle,title` !]
                


                However this still outputs the same problem.

                To confirm,

                I have a page which has the above ditto.

                The blog_chunk has a chunk inside it which is a list of social bookmarks (ie: digg), however the social bookmarks chunk loses simple data such as id, content, etc.

                I am going to put the code inside the chunk for the moment until a better solution can be found.

                  • 3866 ☆ A M B ☆
                  • 350 Posts
                  [!Ditto? &startId=`[*id*]` &showInMenuOnly=`1` &pagesPerPage=`10` &depth=`0` &hideFolders=`1` &paginateAlwaysShowLinks=`1` &tplPaginatePage=`pageSplitter` &tplPaginateCurrentPage=`currentPageSplitter` &paginate=`1` &display=`5` &summarize=`5 ` &phx=`0` &extenders=`summary` &tpl=`Blog_chunk` &hiddenFields=id,content,pagetitle,title` !]

                  I’ve noticed a typo, uou appear to be missing a ’`’ on &hiddenFields=`id,content,pagetitle,title` - don’t know whether this helps.
                    Helen Warner
                    Number one pixel!
                    Proud to be linked with MODX at Crimson Pixel
                    • 33337
                    • 3,975 Posts
                    This is a parser’s limitation if I recall correctly.

                    Chunks get parsed before placeholders. So you will have to do something else. Unfortunately I dont have the answer to "something else" myself yet tongue ...
                      Zaigham R - MODX Professional | Skype | Email | Twitter

                      Digging the interwebs for #MODX gems and bringing it to you. modx.link
                      • 26931
                      • 2,314 Posts
                      Chunks get parsed before placeholders. So you will have to do something else. Unfortunately I dont have the answer to "something else" myself yet Tongue ...
                      there was a thread about this yesterday somewhere in the forum, BobRay (i think) wrote a little snippet -> but i can’t find it right now